Archived

This topic is now archived and is closed to further replies.

Scripting structure-Store or Read?

This topic is 5576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites