BlackFire Script Language part 3 Command Tree, today I will be talking about the Command Tree. The command tree is the heart of the system and is hot swappable with game states. So lets first talk about the basic command structure.
Commands are setup just like Command Patterns, when another command creates an event or anything else in the system creates an event it gets put into the Command Tree/Stream. An event will have a name of command its trying to access along with appropriate data.
The Event enters the top of the Command tree and drops down into through the tree until it finds something that matches its event name. A single command can also be made up of multiple commands. This is all done in the linking process talked about before. For instance lets talk about the new character command. It goes down and is caught by the new character command. In the new character command is a list of commands that need to go through. First is name, then class, etc… down the list of the command. With this approach you could easily move the stuff around so that name goes last and class picking first etc.
This is a great segway into game states. Game States is the ability to save an entire Command tree and essentially backing it up. So you can have an entirely different command tree at any point in the game. Lets say there is a command tree for battles which don’t allow saving(just an example). This command tree would be the same as the normal one with save command removed from tree. This would essentially disallow saving.
So lets talk about some example Commands. There are commands like save, new character, level up character, monster battle, quest related and many more. There will also be generic commands like add to generic stat. These can be used over and over repeatable with scripts. In your xml file you would say you want to use the generic command then give the stat name and the amount to increase and the name of this implementation of the generic command. This will essential give you a new command based off the generic command that will add your amount to stat when called. Then add your new command’s name to the end of some other command like the level up command and it will be called at every level up. Or you could have it called as part of a quest completion command.
Sorry this took so long to get out but thats it for now on Command portion of BSL. Look forward to animation and graphics next!

