I am getting this error trying to compile.
this is the last chunk of code I was working on when a series of errors popped up. the last one was an array out of bounds error at runtime. I assumed this was caused by referring to arrays starting with 1 and going past the last element by one. I tried to fix this by changing for next loops from 1 to # into 0 to #.
that is when i started getting this Undefined Parser Error. it doesnt say what line of the code and I dont know what i'm looking for.
DisplayCodeWindow:
paste sprite 9,5,100
paste sprite 10,410,100
paste sprite 11,413,105
paste sprite 12,413,131
paste sprite 13,10,103
center text 446,114,"ORDERS"
center text 446,139,"TRIGGERS"
text 15,108,"SCRIPT NAME:"
if ScriptNameActive=0 then text 110,108,AIScriptName$(ActiveScriptEdit)
sprite 1,mousex(),mousey(),103
OrdersClicked=sprite collision(1,11)
TriggersClicked=sprite collision(1,12)
ScriptNameClicked=sprite collision(1,13)
if OrdersClicked=1 and mouseclick()=1 and OrdersGroupActive=0 and TriggersGroupActive=0 then OrdersGroupActive=1
if TriggersClicked=1 and mouseclick()=1 and TriggersGroupActive=0 and OrdersGroupActive=0 then TriggersGroupActive=1
if ScriptNameClicked=1 and mouseclick()=1 and ScriptNameActive=0 then ScriptNameActive=1
if ScriptNameActive=1 then Gosub EditScriptName
if OrdersGroupActive=1 then gosub OrderScriptEditor
return
EditScriptName:
if firsttimechecker=0 then clear entry buffer
firsttimechecker=1
Rem flashing cursor
markertimer=markertimer+1
if markertimer<20
text 110,108,"*"
endif
if markertimer>20
text 110,108,""
endif
if markertimer>30 then markertimer=0
TypedName$=Entry$(1)
text 120,108,TypedName$
if returnkey()=1 then returncheck=1
if returnkey()=0 and returncheck=1
AIScriptName$(ActiveScriptEdit)=TypedName$
ScriptNameActive=0
firsttimechecker=0
returncheck=0
endif
return
OrderScriptEditor:
if firsttimechecker=0
clear entry buffer
gosub ParseCurrentOrder
firsttimechecker=1
endif
text 200,150,"ORDER "+str$(ActiveOrderEdit)
Rem zone for valid commands
paste sprite 14,490,100
Rem NextCommand button
paste sprite 15,15,445
Rem EditCommand button
paste sprite 16,135,445
rem SaveOrder button
paste sprite 17,255,445
center text 70,450,"Next Command"
center text 190,450,"Edit Command"
center text 310,450,"Save Order"
text 495,108,"VALID ORDER COMMANDS"
text 495,125,"BOT GOTO x x"
text 495,140,"BOT GOTOBEACON x x"
NextCommand=sprite collision(1,15)
EditCommand=sprite collision(1,16)
SaveOrder=sprite collision (1,17)
if NextCommand=1 and mouseclick()=1 then NextCommandClicked=1
if mouseclick()=0 and NextCommandClicked=1
inc OrderCommand
if OrderCommand>9 then OrderCommand=0
NextCommandClicked=0
endif
if EditCommand=1 and mouseclick()=1 then EditCommandClicked=1
if mouseclick()=0 and EditCommandClicked=1
EditCommandActive=1
EditCommandClicked=0
endif
if SaveOrder=1 and mouseclick()=1 then gosub SaveOrderRoutine
if EditCommandActive=1 then gosub EditCommandRoutine
inc ActiveCommandMarker
if ActiveCommandMarker<20 then text 10,100+((OrderCommand+1)*15),"*"
if ActiveCommandMarker=30 then ActiveCommandMarker=0
for commandcounter=0 to 9
if TempAIOrderTracker$(commandcounter)= "" then exit
text 20,100+((commandcounter+1)*15),TempAIOrderTracker$(commandcounter)
next commandcounter
return
EditCommandRoutine:
if firsttimechecker=0 then clear entry buffer
firsttimechecker=1
inc InputMarker
if InputMarker<20 then text 10,490,"*"
if InputMarker=30 then InputMarker=0
CommandEntry$=Entry$(1)
text 20,490,CommandEntry$
if returnkey()=1
TempAIOrderTracker$(OrderCommand)=CommandEntry$
EditCommandActive=0
clear entry buffer
endif
return
Rem seperates the active order into manageable statements for editing
ParseCurrentOrder:
if AIOrders$(ActivateScriptEdit,ActiveOrderEdit)<>""
TempAIOrderTracker$(OrderCommand)=first token$(AIOrders$(ActiveScriptEdit,ActiveOrderEdit),"")
repeat
TempAIOrderTracker$(OrderCommand)=next token$("")
inc OrderCommand
until TempAIOrderTracker$(OrderCommand)="" or OrderCommand=10
rem Display Current Order Commands
dec OrderCommand
for commandcounter=0 to 9
if TempAIOrderTracker$(commandcounter)= "" then exit
text 20,100+(commandcounter*15),TempAIOrderTracker$(commandcounter)
next commandcounter
commandcounter=0
OrderCommand=0
endif
return
I went back and commented out all the sections that have been modified since it last compiled correctly and it is still giving me the Undefined Parser Error. I'm beginning think its not related to my code. anyone have any ideas on this? i'm at a standstill.
2nd edit: you gotta be kiddin me. <sigh> nevermind, the undefined parser error was popping up because I was trying to compile while the error message from the runtime error was behind the editor. so many hours wasted. <repeatedly bounces his head on the floor> This kind of stuff is going to eat my brain, and i'll have a stroke by the time this game is finished.
Wandering the digital world in search of knowledge for 22 years... you would think I might have found something useful by now.