Editing Pattern script
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: | ||
− | + | = Introduction = | |
− | + | Pattern scripts is special kind of expressions that returns 1 or 0. | |
− | Pattern scripts is special kind of expressions that returns 1 or 0 | + | |
− | + | Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. | |
− | + | ||
− | + | ||
− | + | ||
− | + | Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). | |
− | + | ||
− | + | ||
− | + | ||
− | + | Example of things controlled by pattern scripts: | |
+ | |||
+ | * Enemy appearance (some enemies are only active at night, some only at day etc.) | ||
+ | * Gamemodels damage masks (checks if could be damaged by certain weapon) | ||
+ | * Checking if trigger could be touched | ||
+ | |||
+ | Example of how patter script looks like: | ||
// this script check if its a night or if there is an enemy within 300 units | // this script check if its a night or if there is an enemy within 300 units | ||
Line 24: | Line 23: | ||
(night & fullmoon) | raining | (night & fullmoon) | raining | ||
− | + | ||
− | {| | + | = Operators = |
− | ! | + | |
− | ! | + | {| border=1 cellspacing=0 cellpadding=5 style="border-collapse: collapse" |
− | ! | + | ! # |
− | + | ! Operator | |
− | + | ! Description | |
|- | |- | ||
− | | align=center | | + | | align=center | 1 |
− | | align=center | '''('''''expression''''')''' | + | | align=center | '''(''' ''expression'' ''')''' |
| Expression | | Expression | ||
|- | |- | ||
− | | align=center | | + | | align=center | 2 |
− | | align=center | | + | | align=center | '''x & y''' |
− | | Logical 'And' | + | | Logical 'And' |
|- | |- | ||
− | | align=center | | + | | align=center | 3 |
− | | align=center | | + | | align=center | '''x | y''' |
− | | Logical 'Or' | + | | Logical 'Or' |
|- | |- | ||
− | | align=center | | + | | align=center | 4 |
− | | align=center | | + | | align=center | '''x = y''' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
| Equal | | Equal | ||
|- | |- | ||
− | | align=center | | + | | align=center | 5 |
− | | align=center | | + | | align=center | '''x != y''' |
| Not equal | | Not equal | ||
|- | |- | ||
− | | align=center | | + | | align=center | 6 |
− | | align=center | | + | | align=center | '''x > y ''' |
| Greater | | Greater | ||
|- | |- | ||
− | | align=center | | + | | align=center | 7 |
− | | align=center | | + | | align=center | '''x >= y''' |
| Greater or equal | | Greater or equal | ||
|- | |- | ||
− | | align=center | | + | | align=center | 8 |
− | | align=center | | + | | align=center | '''x < y''' |
| Lesser | | Lesser | ||
|- | |- | ||
− | | align=center | | + | | align=center | 9 |
− | | align=center | | + | | align=center | '''x <= y''' |
| Lesser or equal | | Lesser or equal | ||
|- | |- | ||
− | | align=center | ''' | + | | align=center | 10 |
− | | align=center | | + | | align=center | '''x & not y''' |
+ | | Logical Not | ||
+ | |- | ||
+ | | align=center | 11 | ||
+ | | align=center | '''x >< start end ''' | ||
| x > start And x < end | | x > start And x < end | ||
|- | |- | ||
− | | align=center | | + | | align=center | 12 |
− | | align=center | | + | | align=center | '''x =>< start end ''' |
| x >= start And x < end | | x >= start And x < end | ||
|- | |- | ||
− | | align=center | | + | | align=center | 13 |
− | | align=center | | + | | align=center | '''x ><= start end ''' |
| x > start And x <= end | | x > start And x <= end | ||
|- | |- | ||
− | | align=center | | + | | align=center | 14 |
− | | align=center | | + | | align=center | '''x =><= start end ''' |
| x >= start And x <= end | | x >= start And x <= end | ||
|} | |} | ||
− | |||
− | + | = Functions = | |
− | ===GenericPattern=== | + | Set of functions is determined by pattern realisations. There is two pattern realizations as of yet. |
+ | |||
+ | === 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]]. | ||
− | + | === GamemodelHitPattern === | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ===GamemodelHitPattern=== | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon. | |
− | + |