[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython:tod

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Sat Nov 17 15:29:26 CST 2007


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2007/11/17 15:29
User        : tchize
Edit Summary: 

@@ -37,9 +37,13 @@
  |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 |
  
- ===== Script /python/tod/filter_one_period.py =====
+ ===== Filtering based on period list =====
+ ==== match any ====
+ 
+ Script name: **/python/tod/filter_one_period.py**
+ 
  This script will stop the event from propagating if the current time of the server matches **any** of the times defined as script parameters. Typical use:
  
    arch event_apply
    title Python
@@ -48,9 +52,11 @@
    end
  
  If any of the period of day/year mentionned in parameter match the current server time, the event will be propagated. Otherwise it will be stopped. In this example, the object this event is attached too will be usable on ly during New Year, blizzard or Morning.
  
- ===== Script /python/tod/filter_all_periods.py =====
+ ===== Match all  =====
+ Script name: **/python/tod/filter_all_periods.py**
+ 
  This script will stop the event from propagating if the current time of the server matches **all** of the times defined as script parameters. Typical use:
    arch event_apply
    title Python
    slaying /python/tod/filter_all_periods.py
@@ -58,4 +64,35 @@
    end
  
  If all of the period of day/year mentionned in parameter match the current server time, the event will be propagated. Otherwise it will be stopped. In this example, the object this event is attached too will be usable only during Mornings of days of the moon during the season of Blizzard.
  
+ 
+ ===== Scheduling map triggers =====
+ Those scripts run a "connected" list inside the current map, at a specific time. Arguments required by those scripts are, the value of the "connected" chain to run and the periods of time concerned by this triggering. Those script could be used by any event, however it is typical to use them 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 get called ;)
+ 
+ ==== On any matching period of time ====
+ Script name: **/python/tod/push_one_period.py**
+ 
+ This will trigger the connected list if any of the specified periods matches the current time of server. The "source" of the trigger will be the object containing event. The script will "push" the connected list when entering period and "release" it when exiting period. The script will keep correct state, whatever happens concerning map loading / caching. Upon reload, it will resynchronized to current server state and take appropriate action to "release" or "push" the connected list. The first argument or parameter list is always the integer number of connected list to trigger.
+ 
+ Typical use:
+ 
+  arch event_time
+  title Python
+  slaying /python/tod/push_one_period.py
+  name 69,Morning,Noon
+  end
+ 
+ This example will trigger the connected list number 69 on current map whenever it is Morning or Noon.
+ ==== On matching all periods ====
+ Script name: **/python/tod/push_all_periods.py**
+ 
+ This will trigger the connected list if all of the specified periods matches the current time of server. The "source" of the trigger will be the object containing event. The script will "push" the connected list when entering period and "release" it when exiting period. The script will keep correct state, whatever happens concerning map loading / caching. Upon reload, it will resynchronized to current server state and take appropriate action to "release" or "push" the connected list. The first argument or parameter list is always the integer number of connected list to trigger.
+ 
+ Typical use:
+   arch event_time
+   title Python
+   slaying /python/tod/push_all_periods.py
+   name 69,Morning,The Season of New Year
+   end
+ 
+ This example will push the connected list number 69 of current Map upon entering a Morning of Season of New Year and release it when leaving that day. The source of the push and release will be the object the event is embedded in.


IP-Address  : 87.67.125.37
Old Revision: http://wiki.metalforge.net/doku.php/cfpython:tod?rev=1195333514
New Revision: http://wiki.metalforge.net/doku.php/cfpython:tod

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list