The folder python/tod in crossfire maps contains several scripts
ready to be linked to event_xxxx object in a map editor .
All those scripts use common naming and parameters conventions.
All parameters are passed as arguments in Message of event, using JSON (JavaScript Object Notation).
Basically, it takes the forms of “key” : “value” list enclosed in braces.
Example:
{ "key1" : "value1", "key2" : "value2", "key3" : "value3" }
For a boolean type, the possible values are True
and False
, other type are, for now, only String between double quotes.
Some script parameters accept list of value.
A list uses square bracket and separate it's value by comas.
Example:
{ "key" : "skeleton kills" "when" : ["Dawn","Morning","Noon","Evening","Dusk"] "from" : ["skeleton","generator"], "to" : ["bones1","bones2","bones3"], "match" : "one" }
I hope to see the Gridarta editor be able to edit such structure for you, but until then you will have to do it by hand. It's not very complex to understand anyway.
All time based scripts use the notion of period name, as can be found in following table. The names are case sensitive.
name of period | description |
---|---|
The Season of New Year | Starting 1st month of the year, ending 3rd month |
The Season of Growth | Starting 4th month of the year, ending 6st month |
The Season of Harvest | Starting 7th month of the year, ending 9th month |
The Season of Decay | Starting 10th month of the year, ending 12th month |
The Season of the Blizzard | Starting 13th month of the year, ending 17th month |
Month of Winter | |
Month of the Ice Dragon | |
Month of the Frost Giant | |
Month of Valriel | |
Month of Lythander | |
Month of the Harvest | |
Month of Gaea | |
Month of Futility | |
Month of the Dragon | |
Month of the Sun | |
Month of the Great Infernus | |
Month of Ruggilli | |
Month of the Dark Shades | |
Month of the Devourers | |
Month of Sorig | |
Month of the Ancient Darkness | |
Month of Gorokh | |
the Day of the Moon | First day of the week |
the Day of the Bull | Second day of the week |
the Day of the Deception | Third day of the week |
the Day of Thunder | Fourth day of the week |
the Day of Freedom | Fifth day of the week |
the Day of the Great Gods | Sixth day of the week |
the Day of the Sun | Last day of the week |
Night | Between 9:00 pm and 5:00 am |
Dawn | Between 5:00 am and 8:00 am |
Morning | Between 8:00 am and 13:00am |
Noon | Between 13:00 am and 1:00 pm |
Evening | Between 1:00 pm and 6:00 pm |
Dusk | Between 6:00 pm and 9:00 pm |
For demonstration of the scripts, mapmakers are invited to take a look at the demo maps
at /test/tod and /test/tod2
in the default crossfire maps.
Script /python/tod/filter.py
Description Prevent the event this filter is attached to to occurs at specific period of the day. This can stop a lever (event_apply) from working, prevent a magic hear (event_say) from hearing anything, prevent a gate (event_trigger) from opening.
Parameters
Script /python/tod/push.py
Description: Schedules a map trigger at a specific period of time. It runs a “connected” list inside the current map, at a specific time. This script could be used by any event, however it is typical to use it in the EVENT_TIME of a living object, so as to ensure the script is run often enough to react on time. However you could, without trouble, use it in EVEN_DEATH or a monster, EVENT_APPLY of a button, etc. Just keep in mind the script can't do anything unless it gets called ;) This script keep information on it's current push state, so it won't push twice the connected list and will release the connected list when needed. That way, it will behave nicely with map swapping and when connected to non regular events.
Parameters
Script /python/tod/replace.py
Description: Makes the object is is attached to swap at given periods of day with a specific object in the event's inventory. To use it, give this event's parameters a period an a match rule. Put also in the inventory the swapped object (owner of event) the object that will replace it. The swap is reversed when leaving the swap matching period. This work both on map items and on inventory items. Typically this script would be attached to the event_time of the object to transform.
Parameters
Script /python/tod/replace_in_map.py
Description: Scan the current map of objects matching some criteria and transform them into another specific object. Like for Object Transforming, the transformation is reverted at end of specified period. This works only on map items. Typically this script would be attached to the event_time of guardian object.
Parameters