Tuesday, March 27, 2012

Guide - Jobs (Room Jobs Event Example)

Well now that images are added lets take a look at running the room job events and the way they work. If you want to know details on how each event works and its syntax there are other guides for this. This is a practical example.

As mentioned many times first events go in a fall down method. So which ever event first meets the conditions is the one that fires and all other are ignored.

Lets go look at our bath attendant job from the previous guides. First off make the xml file, i recommend copying and pasting one of the existing ones to save time but it's up to you on this one.

As a standard please add the xml file to

libs/otherlib/xml/event/roomjobs

and don't forget to update

libs/otherlib/xml/event/events.xml

with the file name of the new job.


Paper work done lets go start making events. First off what if the girl is sick, this may seem weird but we need to stop anything else from happening if the girl is sick. Of course we really don't want to do much here better to just add a post event that is a standard for girl sick. Please, please, please you hold to this standard or sick girls will work themselves to death. Think of the slaves.



This really isn't a complicated system for selecting jobs were just doing a random 1 - 3. Which everyone is pulled we point out the girl and give her text. Because this isn't really a class specific job and more of a fun one no one should really care. So that is why the only real check we are doing is

evecheck label = "#rand3" check = "eq" vvar = "2"

So it chooses one and now we make some changes. The most common change is to drop the girls health... fatiguework = -33 but who knows its a variable so we can mod it if the player ever gets an item or effect with bonuses.

evechange label = "#health" check = "sub" vvar = "fatiguework"

After the default health change it's really up to the player what you want to modify plenty of examples and there is a long list of variables in

libs/otherlib/xml/textstories/variablereplace.xml

to choose from. You can assign points to classes the girl doesn't have and they will just be ignored.

Now comes the fun part post events. Most of these I have already built for you and are very generic. Does the girl get sick? Did she learn a class? Did she lose her virginity? So much fun. The only one I really want to see is sick after that it depends as you can see in our example she has the option of learning different classes based on the job performed. That's it for standard events.

Now fire the text! And that would be another tutorial all together just wanted to point out that based on which event fired we're firing a different text (bathattendantjobservice, bathattendantjoboral, bathattendantjobcleaning).

And we just wrote an entire job events. If you have any questions leave a comment I will do my best to answer.

Daisy

5 comments:

  1. I noticed something. All the xml accessibility of Otherworld will allow players to modify their game easily. I expect to see many mods for this game over time.

    Here's the problem: if you want to install more than one mod, it is likely both will want to change the same files, e.g. girls.xml if both mods add girls, or events.xml if both add events. AFAIK, you can't modify a file from xml. Therefore, either one mod overwrites the changes of the other mod, or the user edits in all changes to common files by himself. This will cause problems with less tech-savy people.

    A possible solution: Make your standards real standards, make them mandatory! If someone wants to add a new job, he must place the file in "libs/otherlib/xml/event/roomjobs". Then, once Otherworld is launched, the game creates events.xml on the fly by searching the appropriate directories for XML files. This way, everbody can add his own files to the game without breaking it, as long as the filenames are unique.

    ReplyDelete
  2. Interesting idea, but not one I want to play with any time soon. Sorry this works I've moved on to the next broken part at this time.

    Daisy

    ReplyDelete
  3. I completely understand. Still, I think it's a good idea to consider it in the future, when the problem it aims to solve might actually arise.

    ReplyDelete
  4. I think a good standard would be for two roor/job/etc files, +1 file for custom jobs, one for the ones the games came with. that way people can just put a tag on their custom file (ex. DSjobs.xml) and have a text file included with the game on how to add jobs/etc. files.
    then if there are any over laps we'd create a topic about it, and people would place a warning to others in their topic, etc.

    ReplyDelete
  5. To anom this is a great idea not sure how to enforce it though. Will depend on a lot of help from the modders sticking to the pattern.

    Daisy

    ReplyDelete