Pattern script

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
(Functions)
Line 23: Line 23:
  
  
= Operators =
+
= Expression operators =
 +
 
 +
Link expressions together.
  
 
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse: collapse"
 
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse: collapse"
Line 101: Line 103:
 
| x >= start And x <= end
 
| x >= start And x <= end
 
|}
 
|}
 
  
 
= Functions =
 
= Functions =
Line 129: Line 130:
 
* solved - puzzle trigger is solved
 
* solved - puzzle trigger is solved
 
* killed - entity was killed (deadflag is set)
 
* killed - entity was killed (deadflag is set)
* dist ''boundaries'' - check distance to activator within boundaries (see boundaries macro)
+
* dist ''x'' ''operator'' - check distance to activator
* deadtime ''boundaries'' - check time enemy being dead (0 if not dead)
+
* deadtime ''x'' ''operator'' - check time enemy being dead
 
|-
 
|-
 
| '''target<'''''name'''''>'''.''field''
 
| '''target<'''''name'''''>'''.''field''

Revision as of 23:14, 17 July 2012

Template:Article unfinished

Contents

Introduction

Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, infoportions etc.).

Usage examples:

  • 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


Basic syntax:

 // 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


Expression operators

Link expressions together.

# Operator Example 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 not 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 implementation. There is two pattern implementations as of yet.

GenericPattern

This is generic appearance pattern. It used on enemies appearance, zone appearance.

GamemodelHitPattern

Used on misc_gamemodel when model is hit.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox