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.



1 comment: