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

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Sat Nov 17 15:46:09 CST 2007


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

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

@@ -37,8 +37,9 @@
  |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 map at /test/tod
  ===== Filtering based on period list =====
  ==== match any ====
  
  Script name: **/python/tod/filter_one_period.py**
@@ -52,9 +53,9 @@
    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.
  
- ===== Match all  =====
+ ==== 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
@@ -95,4 +96,37 @@
    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.
+ 
+ ===== Changing object depending on time =====
+ Those scripts can exchange object at specific period of times. When entering a matching period, the object for which the event is trigger get replaced by an object stored in the event. When leaving the matching period of time, the original object is restored and the replacement object is put back inside the event, hidden to the players. With this system you can replace any object with any other object. Typical use is to create gargoylesn that transfom into stone during the day, or werewolves that transforms during the nights of the Day of the moon. One important thing to keep in ming is that, is you use event_time to make the change, the originial object **and** the replacement object should create the time event. This is because the scriptnot only replace the orignial object by the one configured but also displace the event responsible for the script from the original object to the replacement.
+ 
+ ==== Matching any period of a list ====
+ Script name: **/python/tod/replace_one_period.py**
+ 
+ This script will make the replacement upon matching any period of time given in argument list. Typical use:
+ 
+   arch event_time
+   title Python
+   slaying /python/tod/replace_one_period.py
+   name Morning,Noon
+   arch beholder
+   end
+   end
+ 
+ This script will, between Morning and Noon, replace it's containing object by the beholder that is inside the script.
+ 
+ ==== Matching all periods of a list ====
+ Script name: **/python/tod/replace_all_periods.py**
+ 
+ This script, when matching all period of time given as argument, will do the swap. Typical use:
+ 
+   arch event_time
+   title Python
+   slaying /python/tod/replace_one_period.py
+   name Night,the Day of the Moon
+   arch beholder
+   end
+   end
+ 
+ This example will, during the Night of the Day of the Moon, replace it's container by a beholder. The container will be restored when leaving the period.


IP-Address  : 87.67.125.37
Old Revision: http://wiki.metalforge.net/doku.php/cfpython:tod?rev=1195334964
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