- BlackFire Script Langauge
- BlackFire Script Language
- Command Tree
- BlackFire Graphics System
Sorry this is late I promised this yesterday but I got bogged down working on a website thing. Anyways its here now and I hope you enjoy reading about my game language.
In the second part of the BlackFire Script Language discussion I will be talking about Parsing. Parsing is the first step in constructing the BlackFire Script Language. Parsing is what handles the creation of the BlackFire Script Langauge backend. Its also what sets executes or at least sets up BlackFire Scripts. So parsing is important and the first step to the Parsing part is the linking files or config links. This will be the first step in the BSL.
Linking refers to linking together files this is done on a folder basis. A link file will point to a folder and claim all files in there to be on one link. Multiple nested links can be made where by a folder has more folders in it so each folder in a folder will be a nested link. Massive links can be compressed into zip files for either protection of modification or other reasons. I will talk about protection of data later on.
Now in each folder is a group of xml files that can be linked together in the commands folder is a bunch of command links, same for animation, ai, and others. Now the first link to be put together is the parse links. The parse links will be needed to continue the parsing after the parsing of links is done.
Link parsing will simply organize the order in which each action is executed. While linking it will also parse each individual file that is being linked. This happens for everything except parse linking. Here is the order it will go if your confused.
ParseLinking -> CommandLinking -> parse command -> link command v
^ <————————————-
When it completes this loop it will move on to animation and other linking followind the same pattern. It will do this for every file in the folder.
When a file is parsed it is very similar to what I talked about in command pattern. An file will enter the top parser which is an xml parser. This xml parser will seperate the files elements and attributes out and send them into the parser pipeline. The pipeline is what was created during parselinking. They travel down until the reach a point where something in the parser pipeline can handle them. For instance lets say we have an item and in the item we added a new stat called itemlevel. The item object will be split up and sent down the pipeline. The element itemlevel will eventually reach a point where a parser will recognize it and handle it. The parser will grab the value and the item and assign it.
So how do we go about handling a new stat. Lets say we want to script in a brand new stat for a quest. Lets make it questcategory how do we add it without adding a new class? Well there are a couple of things you can do. You can piggyback off an existing general element like stat. Heres what you would right
<stat name=”questcategory”>old quest</stat> the parser will grab the stat parser and then grab the name and value and process it. This doesn’t do much for you but it does create a variable in the quest called questcategory. Now in any other command or file you can reference this by doing <questname>.<stat>.<statname> this will give you the variable you need or an exception if the variable doesn’t exist.
But lets say you want to parse something alittle more complex well you could string multiple parsing together like a stat and image. Well you could make a stat that is an image. So lets see it would look like this. <stat name=”questimage”><image>blah.jpg</image></stat> There you go when the stat is called above it will give you an image. The parse will go through and parse that stat and when it sees the image tag it will go through the process of parsing the image file.
Now lets say you want to make something totally different never seen before. Its gonna require a new parse class. What do you have to change inorder to setup this new parse? First you need to right the class and drop it into the mods folder so that the exe can grab it. Next you need to create the parse config file. Simple drop it into any of the parse folders and it will be linked when the game starts. In the parse config file just right the name of the class and the name of the parsing. Then when parse linking occurs it will get the config file in the folder grab the class and link it with the others. Now you can use it in any thing it implemented in your other files. Its that easy! You don’t have to modify any existing code and you only had to create two files.
You have to be careful about multiple element names because if there are two places that handle the element tag <item></item> only the first one in the pipeline will ever be reached. Also the C# code you write in your new parse must implement a generalparse. Also it must have no errors or you could screw up the entire game.
Thats all I will be talking about today thanks for listening and keep looking out for more information.

