C
Cooltrain
Guest
Hey All,
So I've been doing some work on a command system for my game (and future games). Everything is handled inside a command object which pauses the game when opened, it uses a standard pause system of deactivating all instances, taking a screenshot of the view and drawing it to a surface. This means that any commands that apply to another instance won't take effect because that instance won't exists while paused. I've had the idea to store the commands that are run into a 2D array and once the game is unpaused, to loop through the list and parse each one to my command script (which contains all of the possible commands and there actions). I just need some help with doing this.
Commands use the following layout: command,value
Once a command is entered the command section is stored into splits[0] and the value in splits[1]. I then
Obj_command Create
Obj_command Step
I need to run through all of the avaliable commands once the game is resumed and then remove or maybe reset a value in the commandList array so its not read again ?
Thanks in advance.
So I've been doing some work on a command system for my game (and future games). Everything is handled inside a command object which pauses the game when opened, it uses a standard pause system of deactivating all instances, taking a screenshot of the view and drawing it to a surface. This means that any commands that apply to another instance won't take effect because that instance won't exists while paused. I've had the idea to store the commands that are run into a 2D array and once the game is unpaused, to loop through the list and parse each one to my command script (which contains all of the possible commands and there actions). I just need some help with doing this.
Commands use the following layout: command,value
Once a command is entered the command section is stored into splits[0] and the value in splits[1]. I then
Obj_command Create
Code:
globalvar commandList;
commandList=0;
pos=0;
Code:
pos = array_height_2d( commandList );
commandList[pos,0] = splits[0]//Command
commandList[pos,1] = splits[1]//Value
for (i = 0; i < pos; i += 1){
if (pause == false){
scr_commandList(commandList[i,0], commandList[i,1]) //run command
}
}
Thanks in advance.