I am attempting to make a console for my game, using an array to keep track of my commands, as I will,in the future that is, add in a scripting system.
What happens is the game loads and you can use a command prompt to play, when I type in the correct command, it crashes the game,, when I just want it to close it the "good" way. I'm prototyping the method so I can add on more commands later.
I am 90% sure it's possible because I believe had the problem solved at one point, but before I could save it the editor crashed on me so I lost it. 3 hours later I still haven't been able to work it out. Any ideas?
#constant quit 1
type command
keyword as string
endtype
dim console$(100) as command
console$(1).keyword = "exit"
function commands()
if controlkey()=1
cls
center text screen width()/2,(screen height()/2), "ENTER COMMAND"
set cursor screen width()/2-80,(screen height()/2)+ 20: print "> " : set cursor screen width()/2-70,(screen height()/2)+ 20: input console$(i).keyword
if returnkey()=1
select console$(i).keyword
case quit
end
endcase
endselect
endif
endif
ENDFUNCTION