struct command {
int whattodo; //these would be enums: SHOWTEXTBOX=0 etc
int args[5]; //the arguments passed along
}
struct script {
command commands[100];
int whatcommandareweon; //keeps track of pos through script
int whenshouldwereturntocommands; //ie when the npc starts moving east, come back to the script when he's arrived at the next tile.
}
Scripting structure-Store or Read?
Ok, here's my proposition for my two ways of doing my scripting language. Example script:
SCRIPT 0 Make npc dance and talk //title
SHOWTEXTBOX 0 //textbox #0: "Boy: Watch me dance!"
MOVENPC 0 2 S //Move npc "0" two times south
CHANGENPCDIR 0 E //make npc "0" look east
MOVENPC 0 2 W
END SCRIPT
Now, two ways of doing this.
Lets say that when you activate an npc, it would activate script 0.
Now first, we could make a structure:
then it would scan through the script, fill the script structure and store it
or, we could read it as it's moving along. Which is better?
--Muzlack
[edited by - Muzlack on September 10, 2002 9:23:00 PM]
It is simpler to store it. If you''re concerned about memory usage, say for a very large script or a large number of scripts, you''d read as you go along.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement