So, if you’ve been following my game, Angel’s Burden - Fire Kitsune, you’ve probably noticed that I work on the engine a lot. Well I’m planning on releasing the engine, which is written in Haxe, as soon as it’s done. And one thing I’m really excited about for the Angel Engine is the scripting language that it uses. The scripting language was originally read from little pieces of code in .tmx Tiled files, but since it’s too inconvient to write a whole script into just one line, especially if that script is used over an over again by different objects, I’ve decided to make the scripts readable from files. (Don’t ask why I didn’t in the first place :) ) The resulting language is called AngelScript. So far, it’s very easy to use, the main language barrier being it’s weird syntax. It uses a very small amount of symbols, and so far doesn’t even use the parentheses or quotes.
The engine works around a ‘World’ class that controls all of scenes in the game and the ‘Event’ objects held in the game. The world class also stores an array of ‘Command’ Objects, all of which are defined by the programmer using the library. The world class waits for an event in it’s current scene to fire an AngelScript command, which is then parsed into a name and a list of parameters. The world then searches for a Command with the fired command’s name and runs it with the list of parameters. The command then parses the parameters, in a proccess defined by the user of the library and produces an output.
The event object also has different ways to fire commands. You can define events to only fire commands if:
They are initialized
They are collided with
They are talked to
They are attacked
If you need a better example, here’s the script I’m working on now:
Activate{
say:This stump is dead, it will become ash if you burn it.;
}
Attack{
remove:treestump;
}
The words ‘Activate’ And ‘Attack’ are the conditions that the event will fire the commands inside of the brackets. the words ‘say’ and ‘remove’ are commands and the words after the colon are the parameters of the command.
Sorry if this seems disorganized, I just wanted to tell anyone who wanted to use my engine when it’s done about this new feature and how to use it. Thanks for reading!
-Cobra










0 comments