Home - Forums - Documentation - Gallery - Bugs
Line 111: Line 111:
* =if(mousex()<10,'left','right') <- returns left or right according to mousex position
* =if(mousex()<10,'left','right') <- returns left or right according to mousex position
* =property(pc(pc2d.billboard),propid(text)) <- returns the value of the "text" property from the "pc2d.billboard" pc in current entity.
* =property(pc(pc2d.billboard),propid(text)) <- returns the value of the "text" property from the "pc2d.billboard" pc in current entity.
 +
* =enemy+?i
== Annex 1: Dynamic parameters ==
== Annex 1: Dynamic parameters ==

Revision as of 05:48, 28 October 2008

Contents

Quest Expressions

Quest expressions start with "="

Only supported for rewards.

example:

 =2*@par

Operators

 * @par -> dynamic parameter
 * ?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

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
 * inventory_get
 * inventory_count
 * inventory_in
 * inventory_find
 * inventory_inname
 * inventory_findname
 * 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
 * =property(pc(pc2d.billboard),propid(text)) <- returns the value of the "text" property from the "pc2d.billboard" pc in current entity.
 * =enemy+?i

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)


Annex 3: 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 |