Pattern script

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
Line 37: Line 37:
 
|-
 
|-
 
| align=center | 2
 
| align=center | 2
| align=center | '''x & y'''
+
| align=center | x '''&''' y
 
| Logical 'And'
 
| Logical 'And'
 
|-
 
|-
 
| align=center | 3
 
| align=center | 3
| align=center | '''x | y'''
+
| align=center | x '''|''' y
 
| Logical 'Or'
 
| Logical 'Or'
 
|-
 
|-
 
| align=center | 4
 
| align=center | 4
| align=center | '''x = y'''
+
| align=center | x '''=''' y
 
| Equal
 
| Equal
 
|-
 
|-
 
| align=center | 5
 
| align=center | 5
| align=center | '''x != y'''  
+
| align=center | x '''!=''' y
 
| Not equal
 
| Not equal
 
|-
 
|-
 
| align=center | 6
 
| align=center | 6
| align=center | '''x > y '''
+
| align=center | x '''>''' y
 
| Greater
 
| Greater
 
|-
 
|-
 
| align=center | 7
 
| align=center | 7
| align=center | '''x >= y'''
+
| align=center | x '''>=''' y
 
| Greater or equal
 
| Greater or equal
 
|-
 
|-
 
| align=center | 8
 
| align=center | 8
| align=center | '''x < y'''
+
| align=center | x '''<''' y
 
| Lesser
 
| Lesser
 
|-
 
|-
 
| align=center | 9
 
| align=center | 9
| align=center | '''x <= y'''
+
| align=center | x '''<=''' y
 
| Lesser or equal
 
| Lesser or equal
 
|-
 
|-
 
| align=center | 10
 
| align=center | 10
| align=center | '''x & not y'''  
+
| align=center | x & '''not''' y
 
| Logical Not
 
| Logical Not
 
|-
 
|-
 
| align=center | 11
 
| align=center | 11
| align=center | '''x >< start end '''
+
| align=center | x '''><''' start end
 
| x > start And x < end
 
| x > start And x < end
 
|-
 
|-
 
| align=center | 12
 
| align=center | 12
| align=center | '''x =>< start end '''
+
| align=center | x '''=><''' start end
 
| x >= start And x < end
 
| x >= start And x < end
 
|-
 
|-
 
| align=center | 13
 
| align=center | 13
| align=center | '''x ><= start end '''
+
| align=center | x '''><=''' start end
 
| x > start And x <= end
 
| x > start And x <= end
 
|-
 
|-
 
| align=center | 14
 
| align=center | 14
| align=center | '''x =><= start end '''
+
| align=center | x '''=><=''' start end
 
| x >= start And x <= end
 
| x >= start And x <= end
 
|}
 
|}

Revision as of 10:28, 3 July 2012

Contents

Introduction

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 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 pattern script looks like:

 // this script check if its a night or if there is an enemy within 300 units
 night | enemy<300>.found
 // this scripts check if gametime is between 12 and 14 hours
 hour =><= 12 14
 // this script check if it's fullmoon night or raining 
 (night & fullmoon) | raining


Operators

# Operator Description
1 ( expression ) Expression
2 x & y Logical 'And'
3 x | y Logical 'Or'
4 x = y Equal
5 x != y Not equal
6 x > y Greater
7 x >= y Greater or equal
8 x < y Lesser
9 x <= y Lesser or equal
10 x & not y Logical Not
11 x >< start end x > start And x < end
12 x =>< start end x >= start And x < end
13 x ><= start end x > start And x <= end
14 x =><= start end x >= start And x <= end


Functions

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, zone appearance.

GamemodelHitPattern

Pattern functions used by Gamemodels to determine, if break animation is available for a certain type of weapon.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox