Sunday, July 17, 2016

Activity features

Hello,

I added a new information to week activities.

Just to refresh your memory. What's a week activity?
A week activity is what youre gonna do during the week and that you can select during week planning.

The activities are defined inside an xml file.
And now when you define an activity you can declare a new information called Feature.

So, what's an activity feature?

An activity feature is just a piece of text that describe the activity. This description can be retrieved while the activity is running. This will be mostly useful for generic events and checks that might happen in the game.

But let's take an example,

in the Xmaker world, nudity is not allowed in public.
So, do I have to check in every activity if the slave is nude and if yes react?
Well, yes, if you have some custom event.
But in general you just want a default event to fire.
By default a guard will stop you and give you a fine / send you to jail.


I could easily add this event in the activity start hook, right?
Well, yes and no.

It's correct for this to be executed at the start of an activity, but not all activities are done in public or where guard are available...

Enter the features

The solution can be found by using activity features.
By giving an activity the following features: Public place and Presided by guards (I hope it's correct english because I'm not really sure :/ )

Now in the activity start event we could check if the activity has both these features and in case give a fine or jail the player.


Okay, that it, bye people. Hope this will be useful for other things than the nudity check in the future.



Thursday, July 7, 2016

Finally the weekend arrive

Hi folks,

finally I added hooks for the events.
The hook are fired when a week start or end and when an activity start or end.

What's the idea behind this?

Well, mostly it's needed to do some common checks on the state of the game for example, during the week end (which was actually the only hook already implemented) I check for game over conditions.
The next step will be to add a way to check the current activity data, this will open a world of new opportunity (just exaggerating).
For example, once you know that an activity is done in a public place, before the activity start, I could check whether the slave is nude (public display is against the law in the game) and if so a random event might trigger, were the guard give you a fine or take you to the prison (and you know what will happen in prison to your slave right?)


Anyway that's it for now.