Home - Forums - Documentation - Gallery - Bugs
Line 128: Line 128:
-
== Annex 2: unusable functions ==
+
== Annex 2: Escape characters ==
 +
 
 +
* some characters need to be escaped when they live in xml attributes:
 +
* < : &#60;
 +
* & : &#60;
 +
 
 +
== Annex 3: unusable functions ==
functions which aren't useful due to some missing features from blxml
functions which aren't useful due to some missing features from blxml
Line 140: Line 146:
* actionname{par1=XXX,par2=XXX,par3=XXX...}
* actionname{par1=XXX,par2=XXX,par3=XXX...}
-
== Annex 3: undocumented tokens ==
+
== Annex 4: undocumented tokens ==
'''not sure what these are for... do not read (only here for internal documentation purpose'''
'''not sure what these are for... do not read (only here for internal documentation purpose'''

Revision as of 15:01, 15 November 2008

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
 * =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:
   * < : <
   * & : <

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 |