Editing Pattern script

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{TOCRIGHT}}
+
{{article unfinished}}
==Introduction==
+
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.
+
  
===Script input===
+
== Introduction ==
 +
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.
 +
 
 +
=== Script input ===
 
* Pattern - script string
 
* Pattern - script string
* Script owner - entity that owns script
+
* Script owner - entity that owns pattern comparison
 
* Script activator - entity that launched comparison event
 
* Script activator - entity that launched comparison event
  
===Script rules===
+
=== Script rules ===
 
* Instructions are case sensative
 
* Instructions are case sensative
* Operators (excluding ''('' and '')'') should be separated with space or tab.
+
* Operators (excluding ''()'') should be separated by space or tab.
 
* Null script always returns 1
 
* Null script always returns 1
  
Line 24: Line 25:
 
   (night & fullmoon) | raining
 
   (night & fullmoon) | raining
  
==Operators==
+
== Operators ==
 
{| width=800 border=1 cellspacing=0 cellpadding=5 style="border-collapse: collapse"
 
{| width=800 border=1 cellspacing=0 cellpadding=5 style="border-collapse: collapse"
 
! width=10% | Operator
 
! width=10% | Operator
Line 91: Line 92:
 
|}
 
|}
  
==Functions==
+
== Functions ==
  
 
Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.
 
Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.
  
===GenericPattern===
+
=== GenericPattern ===
  
 
This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].
 
This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].
Line 104: Line 105:
 
'''false'''
 
'''false'''
 
:Always no
 
:Always no
 +
 +
==== Entity checks ====
  
 
'''self'''.''field''
 
'''self'''.''field''
 
:Checks one of the field of script owner. Fields could be:
 
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
+
:* '''found''' - entity exists.
:* '''touchable''' - entity is touchable trigger or zone
+
:* '''touchable''' - entity is touchable trigger or zone.
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
+
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
+
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
:* '''killed''' - entity was killed (deadflag is set)
+
:* '''killed''' - entity was killed (deadflag is set).
:* '''dist''' ''x'' ''operator'' - check distance to activator
+
:* '''dist''' ''x'' ''operator'' - check distance to activator.
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead
+
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
  
 
'''enemy'''.''field''
 
'''enemy'''.''field''
Line 126: Line 129:
 
'''sid<'''''name'''''>'''.''field''
 
'''sid<'''''name'''''>'''.''field''
 
:Find entity by [[SaveId]]. See fields list above.
 
:Find entity by [[SaveId]]. See fields list above.
 +
 +
==== Activator checks ====
  
 
'''player'''
 
'''player'''
Line 131: Line 136:
  
 
'''monster'''
 
'''monster'''
:Script activator is [[Radiant/Glossary | NPC]].
+
:Is [[Radiant Glossary | NPC]].
  
 
'''posessed'''
 
'''posessed'''
:Script activator is  [[Radiant/Glossary | NPC]] posessed by player.
+
:Is [[Radiant Glossary | NPC]] posessed by player.
  
 
'''info''' ''infoportion''
 
'''info''' ''infoportion''
Line 141: Line 146:
 
'''infovalue''' ''infoportion'' ''operator''
 
'''infovalue''' ''infoportion'' ''operator''
 
:Infoportion value comparison (false is always returned is there is no such infoportion).
 
:Infoportion value comparison (false is always returned is there is no such infoportion).
 +
 +
==== [[Gametime]] checks ====
 +
 +
'''fullmoon'''
 +
:Moon is on full state (note that moon can be on full state at day).
 +
 +
'''newmoon'''
 +
:Moon is on null state.
  
 
'''morning'''
 
'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.
+
:Gametime hour is within 5.00 - 9.59.
  
 
'''day'''
 
'''day'''
Line 166: Line 179:
 
:Gametime check using float gametime representation (moontime).
 
:Gametime check using float gametime representation (moontime).
  
'''fullmoon'''
+
==== Other checks ====
:Moon is on full state (note that moon can be on full state at day).
+
 
+
'''newmoon'''
+
:Moon is on null state.
+
  
 
'''raining'''
 
'''raining'''
 
:Check if it is raining or snow.
 
:Check if it is raining or snow.
  
===GamemodelHitPattern===
+
=== GamemodelHitPattern ===
  
 
'''true'''
 
'''true'''
Line 209: Line 218:
 
:* '''soulreaver''' - soul reaver magic attack
 
:* '''soulreaver''' - soul reaver magic attack
  
==See also==
+
== See also ==
 
* [[Trigger event]]
 
* [[Trigger event]]

Please note that all contributions to Blood Wiki are considered to be released under the Creative Commons Attribution Share Alike (see BloodWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)

Template used on this page:

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox