Wednesday, March 7, 2012

Events Part 3 - Variables


Variables today, thrilling huh.

First lets look at on the fly variables. I know I said on the fly but you actually do have to declare them, then the game makes them on the fly. You can set intengers and booleans. Don't worry the game will figure out which is which. Syntax is label and then starting state.

So for a boolean it will be:

label = "booleanexample"
vvar = "true" or "false"

for an integer it will be:

label = "integerexample"
vvar = "10000000" or "-5"

That's it for now we will get to calling them later on. Now some people out there are probably wondering about strings. Sorry no string support. String replacement is handled by the text engine. Did not see a reason for it in the event engine.

But we do have variable replacement. I did most of these for everyone so they can be found at

libs/otherlib/xml/textstories/variablereplace.xml


Yes these are shared with the text engine. Translated variables are NOT translated by the event system, you have been notified. These are all variables that already exist in game. Just so we are clear this is a lot of power and a misspelling or just a bad capitalization will CRASH THE GAME! Also currently there are only a few classes that you as an event designer have access to. If you need access to others please contact me.

GameData <-- holds a lot of core data
eveSys <-- the event system it self
whatGirl translated by the game into GameData[whatGirl] <--- the girl currently on deck

Syntax here is pretty simple with lots of examples, in the file.

search = "labelcalled" -- what the game is searching for, just a label
rclass = "whatGirl" -- game class the information is in. Example: eveSys, GameData
rep = "variable" -- the game variable that's part of the previous class. Example GameData[whatGirl].girlName, GameData.charGold
rgirlclass = "artist" -- Tells the game we are accessing a girl class to modify.

Tomorrow we look at comparing them.

Daisy

No comments:

Post a Comment