Home - Forums - Documentation - Gallery - Bugs
Current revision (15:05, 15 November 2008) (edit) (undo)
(Examples)
 
(18 intermediate revisions not shown.)
Line 9: Line 9:
=2*@par
=2*@par
-
=== Operators ===
+
=== Syntax ===
-
* @par -> dynamic parameter
+
* @par -> dynamic parameter (see annex 1 below)
* ?prop -> property from pcproperties
* ?prop -> property from pcproperties
 +
* ?entname.prop -> property from some entity pcproperties
* * -> multiply
* * -> multiply
* + -> add
* + -> add
Line 22: Line 23:
* == -> equality
* == -> equality
* != -> inequality
* != -> inequality
 +
* <= -> lesser or equal
 +
* >= -> greater or equal
 +
* < -> lesser
 +
* > -> greater
 +
* funcname(par1,par2...) -> run a function
=== values ===
=== values ===
Line 30: Line 36:
=== functions ===
=== functions ===
-
* pc(name,[ent])
+
parameters inside [] are optional
-
* pctag(name, tag, [ent])
+
 
 +
* pc([ent],name)
 +
* pctag([ent],name, tag)
* param
* param
-
* property(name,[pcname])
+
* property([pc],propid)
* id
* id
* parid
* parid
Line 67: Line 75:
* entname() -> entity name
* entname() -> entity name
* ent() -> entity, ent(entityname) -> entity
* ent() -> entity, ent(entityname) -> entity
-
* inventory_get
 
-
* inventory_count
 
-
* inventory_in
 
-
* inventory_find
 
-
* inventory_inname
 
-
* inventory_findname
 
* sound
* sound
* sound_paused
* sound_paused
Line 100: Line 102:
* key_light(light,key,[value])
* key_light(light,key,[value])
 +
=== Examples ===
 +
 +
* =if(mousex()<10,'left','right') <- returns left or right according to mousex position
 +
* =if(property(pc(tools.config.json),propid(index))==0,10,-1) <- returns 10 o -1 according to index property.
 +
* =property(pc(pc2d.billboard),propid(text)) <- returns the value of the "text" property from the "pc2d.billboard" pc in current entity.
 +
* =enemy+?i -> returns something like enemy13 (if i pcproperty was 13 at the moment)
 +
* =[1,2,3] -> returns a vector3 with contents x=1 y=2 z=3
 +
 +
== Annex 1: Dynamic parameters ==
 +
 +
If you use @par (instead
 +
of the already existing $par notation) you can get dynamic
 +
parameters from triggers. As opposed to static ($par) parameters
 +
these parameters can change every time the reward is fired.
 +
Currently there are the following limitations:
 +
 +
* @par notation does not work in triggers (that will stay).
 +
* @par notation does not work in sequences.
 +
 +
=== Dynamic parameters each trigger sends ===
 +
 +
* message --> forwards all message parameters
 +
* inventory --> @child (name of added or removed entity)
 +
* meshsel --> @entity (name of the selected entity)
 +
* trigger --> @entity (name of the entity triggering)
 +
 +
 +
== Annex 2: Escape characters ==
 +
 +
* some characters need to be escaped when they live in xml attributes:
 +
* < : "&#38;#60;"
 +
* & : "&#38;#38;"
 +
 +
example: 1<2 becomes 1&#38;#60;2
 +
 +
== Annex 3: unusable functions ==
 +
 +
functions which aren't useful due to some missing features from blxml
 +
 +
* inventory_get
 +
* inventory_count
 +
* inventory_in
 +
* inventory_find
 +
* inventory_inname
 +
* inventory_findname
 +
* actionname{par1=XXX,par2=XXX,par3=XXX...}
-
=== tokens ===
+
== Annex 4: undocumented tokens ==
-
not sure what these are for...
+
'''not sure what these are for... do not read (only here for internal documentation purpose'''
* property
* property
Line 164: Line 212:
* showmouse
* showmouse
* navigationinfo
* navigationinfo
- 
- 
-
=== Examples ===
 
- 
-
* =if(mousex()<10,'left','right')
 
- 
-
== Annex 1: Dynamic parameters ==
 
- 
-
If you use @par (instead
 
-
of the already existing $par notation) you can get dynamic
 
-
parameters from triggers. As opposed to static ($par) parameters
 
-
these parameters can change every time the reward is fired.
 
-
Currently there are the following limitations:
 
- 
-
* @par notation does not work in triggers (that will stay).
 
-
* @par notation does not work in sequences.
 
- 
- 
-
== Annex 2: Trigger dynamic parameters ==
 
- 
-
* message --> forwards all message parameters
 
-
* inventory --> child (name of added or removed entity)
 
-
* meshsel --> entity (name of the selected entity)
 
-
* trigger --> entity (name of the entity triggering)
 

Current revision

Contents

Quest Expressions

Quest expressions start with "="

Only supported for rewards.

example:

 =2*@par

Syntax

 * @par -> dynamic parameter (see annex 1 below)
 * ?prop -> property from pcproperties
 * ?entname.prop -> property from some entity pcproperties
 * * -> multiply
 * + -> add
 * - -> substract
 * / -> divide
 * % -> modulo
 * ~ -> bitnot
 * ^ -> bitxor
 * == -> equality
 * != -> inequality
 * <= -> lesser or equal
 * >= -> greater or equal
 * < -> lesser
 * > -> greater
 * funcname(par1,par2...) -> run a function

values

 * false -> boolean false
 * true -> boolean true

functions

parameters inside [] are optional

 * pc([ent],name)
 * pctag([ent],name, tag)
 * param
 * property([pc],propid)
 * id
 * parid
 * actid
 * propid
 * rgb(r,g,b) -> color code
 * abs(number)
 * min(n1,n2) -> min
 * max(n1,n2) -> max
 * config
 * mousex() -> mousex
 * mousey() -> mousey
 * normalize(vector) --> normalized vector
 * bb_mousex
 * bb_mousey
 * cos(number) -> cos
 * sin(number)
 * tan(number)
 * acos(number)
 * asin(number)
 * atan(number)
 * sign(number)
 * sqrt(number)
 * sqdist(vec1,vec2)
 * hasclass
 * intpol(a,b,c)
 * int(something)
 * float(something)
 * bool(something)
 * rand(number)
 * bb_testcollide
 * if(expr, trueexpr, falseexpr) 
 * entname() -> entity name
 * ent() -> entity, ent(entityname) -> entity
 * sound
 * sound_paused
 * strlen
 * strsub
 * stridx
 * scr_width()
 * scr_height()
 * testvar(name) -> test existance
 * chdirauto(dir,file) -> change to dir if file is present
 * readfile
 * writefile
 * getyrot(dx,dy) -> angle
 * vecx(vec) -> vec.x
 * vecy(vec) -> vec.y
 * vecz(vec) -> vec.z
 * colred(col) -> col.red
 * colgreen(col) -> col.red
 * colblue(col) -> col.red
 * getmsg(msg) -> translated message
 * key_node(sector,node,key,[value])
 * key_meshobj(meshobj,key,[value])
 * key_sector(sector,key,[value])
 * key_meshfact(meshfact,key,[value])
 * key_texture(texture,key,[value])
 * key_material(material,key,[value])
 * key_light(light,key,[value])

Examples

 * =if(mousex()<10,'left','right') <- returns left or right according to mousex position
 * =if(property(pc(tools.config.json),propid(index))==0,10,-1) <- returns 10 o -1 according to index property.
 * =property(pc(pc2d.billboard),propid(text)) <- returns the value of the "text" property from the "pc2d.billboard" pc in current entity.
 * =enemy+?i -> returns something like enemy13 (if i pcproperty was 13 at the moment)
 * =[1,2,3] -> returns a vector3 with contents x=1 y=2 z=3

Annex 1: Dynamic parameters

If you use @par (instead of the already existing $par notation) you can get dynamic parameters from triggers. As opposed to static ($par) parameters these parameters can change every time the reward is fired. Currently there are the following limitations:

 * @par notation does not work in triggers (that will stay).
 * @par notation does not work in sequences.

Dynamic parameters each trigger sends

 * message --> forwards all message parameters
 * inventory --> @child (name of added or removed entity)
 * meshsel --> @entity (name of the selected entity)
 * trigger --> @entity (name of the entity triggering)


Annex 2: Escape characters

 * some characters need to be escaped when they live in xml attributes:
   * < : "&#60;"
   * & : "&#38;"

example: 1<2 becomes 1&#60;2

Annex 3: unusable functions

functions which aren't useful due to some missing features from blxml

 * inventory_get
 * inventory_count
 * inventory_in
 * inventory_find
 * inventory_inname
 * inventory_findname
 * actionname{par1=XXX,par2=XXX,par3=XXX...}

Annex 4: undocumented tokens

not sure what these are for... do not read (only here for internal documentation purpose

 * property
 * action
 * bb_movelayer
 * bb_move
 * bb_tofront
 * bb_toback
 * bb_up
 * bb_down
 * par
 * var
 * lvar
 * expr
 * while
 * if
 * for
 * print
 * call
 * case
 * mount
 * hitbeam
 * inherit
 * destroyentity
 * createentity
 * createpropclass
 * destroypropclass
 * default
 * inventory
 * inventory_add
 * inventory_rem
 * chdir
 * sound
 * sound_stop
 * sound_pause
 * sound_unpause
 * sound_restart
 * sound_volume
 * sound_speed
 * config_add
 * config_rem
 * config_set
 * config_save
 * class_add
 * class_rem
 * super
 * switch
 * strsplit
 * return
 * reporterror
 * variables
 * traceon
 * traceoff
 * callstack
 * selectentity
 * stop
 * randomize
 * quit
 * hidemouse
 * showmouse
 * navigationinfo
| Article | Discussion | View source | History |