Scripting structure-Store or Read?

Started by
0 comments, last by Muzlack 21 years, 7 months ago
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:
      
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.

}
      
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]
--Muzlack
Advertisement
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