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

Tuesday, March 6, 2012

Events Part 2


So some basic's in this little walk through the first is that events have 2 basic tags.

label = "example"
text = "exampletextrolled1"

The label is just a tag that calls the event. You can have dozens of events with the same label, if so they then fall down each testing the condition until one succeeds at which point all others are ignored. Please see the picture above as an example. Be advised that even if all of the label do not succeed or the label does not exist it will generate an error. So as a good rule of thumb its good to just have an empty event with the label. Empty events are processed but if nothing happens nothing happens.

In review its a fall down, if, else if, else system.

Text is the text label that is called to be displayed and passed onto the text system. That't it. Empty labels are ignored. So text = "" will spawn no text, but you can still have stuff happen in the background for the event, even if no text is shown.

That's the basics user created variables are next.

---------

Setting up jobs for examples the next few days including today, and will hopefully be ready to ask everyone for there help xmling the jobs when the walk through is done.

Daisy

Monday, March 5, 2012

Events Creating Part 1


So we are finally at the event creating walkthrough. Soon, very soon, going to ask for help building events for all the jobs. So need a walkthroguh, lets start at the basics.

First off all xml is slowly being moved moved to xml directory.

libs/otherlib/xml

Events are the same at

libs/otherlib/xml/event/


each time you add a new xml file to events you need to add it the

libs/otherlib/xml/event/events.xml

Then just one line for the path can be added anywhere in the file.

book name = "roomjobs/restjob.xml" (minus the brackets since they don't show up in html.)

That's all it is to actually set up the loading of the event file. Tomorrow the basic event commands.

---------------------------------------------------------

To Mr. Anonymous who recommended the http://www.masterofmana.com/ mod to civ4. Damn I hate you this mod is hard. I have been loving it. But such a time sink. Thanks!

Daisy

Sunday, March 4, 2012

Even more variable replacement now with health


Okay so this one is a bit more complicated to try to understand. Basically changing a game variable with an on the fly variable. A nice little addition to the overall and lets me finally end this variable rampage.

So now you can do:

GameArray[whatGirl].HP = GameArray[whatGirl].HP - health

or any on the fly variable.

Now on to sick and will be done until someone finds a bug.

Daisy

Saturday, March 3, 2012

Class jobs updating


It works! classes now update and can be checked. What a pain in the rear. Perhaps I should explain why it was such an issue.

The girls have 2 sets of classes. That may seem obvious, but we have to know does the class exist, is it known by the girls, and then we have to update the right one class 1 or 2.

That means you can't use a direct update.

GameArray[whatGirl].girlClass11Total while can be changed would mean that we may have changed a class that doesn't exist or could be at location 21. Needless to say we can do 2x as many events checking the classes etc but better for everyone to use the girl functions that are already made.

Doing so was a pain but I got it working.

Daisy

Friday, March 2, 2012

A terrible list of nothing

Tonight should start working on the variables again for the event system. Hopefully will finish up all the basic stuff this weekend and will be able to go onto assistants.

Daisy

Thursday, March 1, 2012

civ4...

still just trying to destroy England.

Daisy