prevnext   » SZS: Wiimms SZS Tools » wszst: Wiimms SZS Tool » wszst functions

wszst functions

Print a list with all parser functions. If one key ore more key entered, then only functions that match at least one key are printed.

Contents

1.   Syntax

wszst FUNCTIONS [key]...

2.   Options

Options
Option Param Description
-H --no-header Suppress printing of header and footer.
-l --long Normally only the function syntax is compared against the key. But if --long is set, the description is compared too.
-v --verbose Normally only the function result and the syntax are printed. But if --verbose is set, the description is printed too.

3.   Description

This command prints the list of parser functions. Parser functions are available during encoding and scanning of text files. There is a set of function avaialble for all file types. Other functions are only available if scanning a special type of file.

Function Reference
File
Type
Return Value
& Function Name
& Parameters
Description
* int
$
(...)
This debug function returns the number of parameters.
* *
abs
(val)
Returns the absoulte value of 'val'. If 'val' is a vector, the absoulte value of each component is calculated. The return type is identical to the type of 'val'.
* flt|vec
acos
(val)
Returns the arc cosine of 'val' in degree. If 'val' is a vector, the arc cosine of each component is calculated.
KMP int
area$dest
(area_idx)
Returns the destination index (e.g. camera index) of an area.
KMP int
area$mode
(area_idx)
Returns the mode of an area.
KMP int
area$n
()
Returns the number of areas.
KMP vector
area$pos
(area_idx)
Returns the position of an area.
KMP vector
area$rot
(area_idx)
Returns the rotation of an area.
KMP vector
area$scale
(area_idx)
Returns the scale of an area.
KMP int
area$set
(area_idx,val_idx)
Returns setting 0..3 of an area.
KMP int
area$type
(area_idx)
Returns the type of an area. Cameras are type 0.
KMP int
area$unknown
(area_idx)
Returns the unknown value of an area.
* flt|vec
asin
(val)
Returns the arc sine of 'val' in degree. If 'val' is a vector, the arc sine of each component is calculated.
* flt|vec
atan
(val)
Returns the arc tangent of 'val' in degree. If 'val' is a vector, the arc tangent of each component is calculated.
* float
atan2
(x,z)
Returns the arc tangent of 'z/x' in degree, using the signs of the two arguments to determine the quadrant of the result. Both arguments are converted to a float before operation. If 'x' is a vector, its x component is used. If 'z' is a vector, its z component is used.
* flt|vec
bezier
(pos,v1,va[,vb],v2)
Calculate the position 'pos' on a bezier curve going from 'v1' to 'v2'. 'va' and 'vb' are helper points. If 'vb' is not set, a quadratic bezier curve is calculated. Otherwise 'va' and 'vb' are set and a cubic bezier curve is calculated. Position 0.0 returns 'v1' and position 1.0 'v2'. All position values between 0.0 and 1.0 return a point of the calculated bezier curve between points 'v1' and 'v2'. If 'pos' is a vector, different positions for each coordinate are used. If any parameter is a vector, all parameters are converted to vectors and the result is a vector. Otherwise all parameters are converted to floats and the result is a float.
KMP int
came$n
()
Returns the number of cameras.
KMP int
came$next
(came_idx)
Returns -1 or the link to the next camera.
KMP int
came$ocam
()
Returns the index of the opening camera.
KMP vector
came$pos
(came_idx)
Returns the position of a camera.
KMP int
came$route
(came_idx)
Returns -1 or the link to the related route.
KMP int
came$scam
()
Returns the index of the selection camera.
KMP float
came$time
(came_idx)
Returns the run time of a camera in 1/60 sec.
KMP int
came$type
(came_idx)
Returns the type of a camera.
KMP int
came$unknown_02
(came_idx)
Returns the unknown value at offser 0x02 of a camera.
KMP int
came$unknown_04
(came_idx)
Returns the unknown value at offser 0x04 of a camera.
KMP int
came$unknown_0a
(came_idx)
Returns the unknown value at offser 0x0a of a camera.
KMP vector
came$unknown_18
(came_idx)
Returns the unknown value at offser 0x18 of a camera.
KMP vector
came$viewpt_begin
(came_idx)
Returns the start position of the view point.
KMP vector
came$viewpt_end
(came_idx)
Returns the end position of the view point.
KMP int
came$viewpt_speed
(came_idx)
Returns the view point speed in units per 100/60 sec.
KMP float
came$zoom_begin
(came_idx)
Returns the zoom begining angle of a camera.
KMP float
came$zoom_end
(came_idx)
Returns the zoom ending angle of a camera.
KMP int
came$zoom_speed
(came_idx)
Returns the zoom speed in units per 100/60 sec.
* *
ceil
(val)
Returns the smallest integral value that is not less than 'val'. If 'val' is a vector, the calculation is done for each component. The return type is identical to the type of 'val'.
KMP int
ckph$len
(ckph_idx)
Returns the number of check points of a check point group.
KMP int
ckph$n
()
Returns the number of check point groups.
KMP int
ckph$next
(ckph_idx,val_idx)
Returns link 0..5 to the next check point group.
KMP int
ckph$prev
(ckph_idx,val_idx)
Returns link 0..5 to the previous check point group.
KMP int
ckph$start
(ckph_idx)
Returns the check point start index of a check point group.
KMP int
ckph$unknown
(ckph_idx)
Returns the unknown value of a check point group.
KMP vector
ckpt$left
(ckpt_idx)
Returns the left position of a check point.
KMP int
ckpt$mode
(ckpt_idx)
Returns the mode of check point.
KMP int
ckpt$n
()
Returns the number of check points.
KMP int
ckpt$next
(ckpt_idx)
Returns the index of the next check point.
KMP int
ckpt$prev
(ckpt_idx)
Returns the index of the previous check point.
KMP int
ckpt$respawn
(ckpt_idx)
Returns the respawn index of a check point.
KMP vector
ckpt$right
(ckpt_idx)
Returns the right position of a check point.
KMP int
cnpt$effect
(cnpt_idx)
Returns the efffect value of a canon point.
KMP int
cnpt$id
(cnpt_idx)
Returns the ID of a canon point.
KMP int
cnpt$n
()
Returns the number of canon point points.
KMP vector
cnpt$pos
(cnpt_idx)
Returns the position of a canon point.
KMP vector
cnpt$rot
(cnpt_idx)
Returns the rotation of a canon point.
* flt|vec
cos
(val)
Returns the cosine of 'val', where 'val' is given in degree. If 'val' is a vector, the cosine of each component is calculated.
* vector
cross
(v1,v2)
Returns the cross product of the 2 vectors 'v1' and 'v2'.
* float
dot
(v1,v2)
Returns the dot product of the 2 vectors 'v1' and 'v2'.
KMP int
enph$len
(enph_idx)
Returns the number of enemy points of an enemy point group.
KMP int
enph$n
()
Returns the number of enemy point groups.
KMP int
enph$next
(enph_idx,val_idx)
Returns link 0..5 to the next enemy point group.
KMP int
enph$prev
(enph_idx,val_idx)
Returns link 0..5 to the previous enemy point group.
KMP int
enph$start
(enph_idx)
Returns the enemy point start index of an enemy point group.
KMP int
enph$unknown
(enph_idx)
Returns the unknown value of an enemy point group.
KMP float
enpt$hDir
(enpt_index[,next_index])
Calculate the horizontal direction in degree of an enemy point. The 'next_index' is only used, if multiple links are available.
KMP int
enpt$n
()
Returns the number of enemy points.
KMP int
enpt$next
(enpt_index[,next_index])
Returns the index of the next enemy point. The 'next_index' is only used, if multiple links are available.
KMP vector
enpt$pos
(enpt_idx)
Returns the position of an enemy point.
KMP int
enpt$prop
(enpt_idx,val_idx)
Returns property 0 or 1 of an enemy point.
KMP float
enpt$scale
(enpt_idx)
Returns the scale of an enemy point.
* flt|vec
exp
(val)
Returns the value of e (the base of natural logarithms) raised to the power of 'val'. If 'val' is a vector, the calculation is done for each component.
* *
floor
(val)
Returns the largest integral value that is not greater than 'val'. If 'val' is a vector, the calculation is done for each component. The return type is identical to the type of 'val'.
KMP int
gobj$id
(gobj_idx)
Returns the object ID of a global object.
KMP int
gobj$n
()
Returns the number of global objects.
KMP int
gobj$pflags
(gobj_idx)
Returns the presence flags of a global object.
KMP vector
gobj$pos
(gobj_idx)
Returns the position of a global object.
KMP vector
gobj$rot
(gobj_idx)
Returns the rotation of a global object.
KMP int
gobj$route
(gobj_idx)
Returns -1 or the index of a related route of a global object.
KMP vector
gobj$scale
(gobj_idx)
Returns the scale of a global object.
KMP int
gobj$set
(gobj_idx,val_idx)
Returns setting 0..7 of a global object.
KMP int
gobj$unknown
(gobj_idx)
Returns the unknown value of a global object.
* float
hDir
([v1,]v2)
The horizontal direction in degree from position 'v1' to 'v2' is calculated. If 'v1' is not set, v(0,0,0) is used.
* float
hLen
(v1[,v2])
Returns the horizontal length of the vector 'v1' (ignoring the y component). If 'v2' is set, the horizontal distance of both points is returned.
* vector
hRot
(pt,deg,[origin])
The point 'pt' is horzontal rotated around 'origin' by 'deg' degree. If 'origin' is not set, v(0,0,0) is used.
* int
ifLevel
()
This debug function returns the current IF..ENDIF level (number of active '@if's).
* int
isDef
(name)
Returns 2, if variable 'name' is defined, or 1, if a variable with the base name is defined as vector, or 0, if it is not defined.
* int
isFloat
(name)
Returns 2, if variable 'name' is defined as float with a value >0, or 1, if it is a float with a value <=0. Otherwise it returns 0.
* int
isFunction
(name)
Returns 1, if 'name' is defined as system function, or 2, if 'name' is defined as user function, or 3, if 'name' is defined as system and as user function. Otherwise it's not a function and 0 is returned.
* int
isInt
(name)
Returns 2, if variable 'name' is defined as an integer with a value >0, or 1, if it is an integer with a value <=0. Otherwise it returns 0.
* int
isMacro
(name)
Returns 2, if 'name' is defined as user function, or 1, if 'name' is defined as simple macro. Otherwise it's not a macro or user function and 0 is returned.
* int
isNumeric
(name)
Returns 1, if variable 'name' is an integer, float or vector. Otherwise it returns 0.
* int
isScalar
(name)
Returns 2, if variable 'name' is an integer or float with a value >0, or 1, if it is an integer or float with a value <=0. Otherwise it returns 0.
* int
isVector
(name)
Returns 1, if variable 'name' is defined as vector. Otherwise it returns 0.
KMP int
itph$len
(itph_idx)
Returns the number of item points of an item point group.
KMP int
itph$n
()
Returns the number of item point groups.
KMP int
itph$next
(itph_idx,val_idx)
Returns link 0..5 to the next item point group.
KMP int
itph$prev
(itph_idx,val_idx)
Returns link 0..5 to the previous item point group.
KMP int
itph$start
(itph_idx)
Returns the item point start index of an item point group.
KMP int
itph$unknown
(itph_idx)
Returns the unknown value of an item point group.
KMP float
itpt$hDir
(itpt_index[,next_index])
Calculate the horizontal direction in degree of an item point. The 'next_index' is only used, if multiple links are available.
KMP int
itpt$n
()
Returns the number of item points.
KMP int
itpt$next
(itpt_index[,next_index])
Returns the index of the next item point. The 'next_index' is only used, if multiple links are available.
KMP vector
itpt$pos
(itpt_idx)
Returns the position of an item point.
KMP int
itpt$prop
(itpt_idx,val_idx)
Returns property 0 or 1 of an item point.
KMP float
itpt$scale
(itpt_idx)
Returns the scale of an item point.
KMP int
jgpt$effect
(jgpt_idx)
Returns the efffect value of a respawn point.
KMP int
jgpt$id
(jgpt_idx)
Returns the ID of a respawn point.
KMP int
jgpt$n
()
Returns the number of respan points.
KMP vector
jgpt$pos
(jgpt_idx)
Returns the position of a respawn point.
KMP vector
jgpt$rot
(jgpt_idx)
Returns the rotation of a respawn point.
KMP int
ktpt$id
(ktpt_idx)
Returns a start point ID.
KMP int
ktpt$n
()
Returns the number of start points.
KMP vector
ktpt$pos
(ktpt_idx)
Returns a start point position.
KMP vector
ktpt$rot
(ktpt_idx)
Returns a start point rotation.
KMP int
ktpt$unknown
(ktpt_idx)
Returns the unknown value of a start point.
* float
len
(v1[,v2])
Returns the length of the vector 'v1'. If 'v2' is set, the distance of both points is returned.
* int
line
()
This debug function returns the current line number.
* flt|vec
log
(val[,base])
If base is not set or invalid, the function returns the natural logarithm of 'val'. Otherwise base is converted to a float and logarithm with the entered base is returend (=log(val)/log(base)). If 'val' is a vector, the calculation is done for each component.
* int
loopCount
([level])
This debug function returns the loop counter of the specified loop level. If 'level' is omitted, the loop count of the current loop is returned.
* int
loopLevel
()
This debug function returns the current loop level (number of active loops).
* *
max
(p1,...)
Returns the maximum value of all parameters. If at least one parameter is a vector, the result is a vector too and the maximum value of each component is calculated.
* *
min
(p1,...)
Returns the minimum value of all parameters. If at least one parameter is a vector, the result is a vector too and the minimum value of each component is calculated.
* *
minMax
(val,minval,maxval)
Returns 'max(min(val,minval),maxval)': Limit the value 'val' by 'minval' and 'maxval'. The return type is identical to the type of 'val'.
KMP int
mspt$effect
(mspt_idx)
Returns the efffect value of a battle point.
KMP int
mspt$id
(mspt_idx)
Returns the ID of a battle point.
KMP int
mspt$n
()
Returns the number of battle points.
KMP vector
mspt$pos
(mspt_idx)
Returns the position of a battle point.
KMP vector
mspt$rot
(mspt_idx)
Returns the rotation of a battle point.
* *
param
(index)
Returns the value of the macro or function parameter with the entered 1-based index. Therefor the private variable '$N' and one of '$1', '$2', ... are read.
* flt|vec
pos
(pos,p1,p2)
The result is: p1+pos*(p2-p1). If one of the 3 arguments is a vector, the result is also a vector and the calculation is done for each component.
KMP int
poti$back
(route_idx)
Returns the forward+backward value of a route (route header byte at offset 0x03).
KMP int
poti$n
()
Returns the number of routes.
KMP int
poti$nn
()
Returns the total number of points of all routes.
KMP int
poti$np
(route_idx)
Returns the number of points of a route.
KMP vector
poti$pos
(route_idx,pt_idx)
Returns the position of a point of a route. The point index is relative to the route.
KMP int
poti$set
(route_idx,pt_idx,val_idx)
Returns setting 0 or 1 of a point of a route. The point index is relative to the route.
KMP int
poti$smooth
(route_idx)
Returns the smooth value of a route (route header byte at offset 0x02).
* flt|vec
pow
(a,b)
Returns the value of 'a' raised to the power of 'b'. If 'a' is a vector, each component is raised by 'b'. The operator ** does the same, but have integer support.
* *
random
([max])
Returns a random number between 0 and 'max', but never equal 'max'. The return type is identical to the type of 'max'. If 'max' is not set, 1.0 is assumed. If 'max' is a vector, a vector with three random numbers will be returned.
* *
result
()
Returns the last include, macro or function result. The value is usually '$NONE', unless the command '@RETURN' is used.
* *
round
(val)
Returns the rounded integer value of 'val'. If 'val' is a vector, the calculation is done for each component. The return type is identical to the type of 'val'.
* *
select
(sel,p0,...,pN)
First the selector 'sel' is converted to an integer. If 'sel' is less or equal 0, 'p0' is returned. If 'sel' is greater or equal N, 'pN' is returned. Otherwise 'sel' is between 0 and N and 'p' is returned.
* *
sign
(val)
Returns the sign of 'val': -1 if 'val<0'; 0, if 'val==0'; +1 if 'val>0'. If 'val' is a vector, the sign of each component is calculated. The return type is identical to the type of 'val'.
* flt|vec
sin
(val)
Returns the sine of 'val', where 'val' is given in degree. If 'val' is a vector, the sine of each component is calculated.
* int
sourceLevel
()
This debug function returns the current source level (number of open files and macros).
* flt|vec
sqrt
(val)
Returns the nonnegative square root of 'abs(val)'. If 'val' is a vector, the square root of each component is calculated.
KMP int
stgi$byte
(stgi_idx,val_idx)
Returns setting byte 0..11 of a stage info.
KMP int
stgi$n
()
Returns the number of stage infos.
* flt|vec
tan
(val)
Returns the tangent of 'val', where 'val' is given in degree. If 'val' is a vector, the tangent of each component is calculated.
* *
trunc
(val)
Returns the nearest integer not larger in absolute value 'val' (rounding towards zero). If 'val' is a vector, the calculation is done for each component. The return type is identical to the type of 'val'.
* int
type
(name)
Returns the type of the variable 'name' (TYPE$UNSET, TYPE$INT, TYPE$FLOAT, TYPE$VECTOR, TYPE$X, TYPE$Y, TYPE$Z) or value 'TYPE$UNDEF', if it is not defined. It is guaranteed, that 'TYPE$UNDEF < TYPE$UNSET < all_others'.
* vector
unit
(v1[,v2])
Returns the unit vector of the vector 'v1'. If 'v2' is set, then the unit vector for the difference 'v2-v1' is returned.
* vector
v
([val])
Defines a vector. If 'val' is a vector, it is copied. Otherwise 'val' is used for the x coordinate and y and z are set to 0.0. If 'val' is not set, 0.0 is assumed. This function is used if an internal conversion to a vector is needed.
* vector
v
(x[,y],z)
Defines a vector by using the entered coordinates. If 'y' is not set, 0.0 is assumed. If 'x', 'y' or 'z' is a vector itself, the corespondent coordinate is used.
* vector
v3
(val)
Create a vector with all 3 components equal to 'val'
* *
var
(name,val)
If variable 'name' is defined and valid, return its value. Otherwise return 'val'.
* vector
vd
(len,deg[,y])
Creates a vector of length 'len' and horizontal angle 'deg' (degree). Value 'y' is used for the height, or, if not set, 0.0.
* vector
vx
(x[,v])
Read the vector 'v' and replace the x component by 'x'. If 'x' is a vector, the x component of 'x' is used. If 'v' is not entered, use v(0,0,0) as source.
* vector
vy
(y[,v])
Read the vector 'v' and replace the y component by 'y'. If 'y' is a vector, the y component of 'y' is used. If 'v' is not entered, use v(0,0,0) as source.
* vector
vz
(z[,v])
Read the vector 'v' and replace the z component by 'z'. If 'z' is a vector, the z component of 'z' is used. If 'v' is not entered, use v(0,0,0) as source.
* float
x
(val_1,...,val_n)
Scan all parameters (at least 1 must exist) and find the first vector. If found, return its x component. If no vector exists, return the last value 'val_n'. Confirming the rules above, 'x(val)' means: If 'val' is a vector, return its x component. Otherwise convert 'val' to a float and return it.
* float
y
(val_1,...,val_n)
Same as 'x(...)', but for the y component.
* float
z
(val_1,...,val_n)
Same as 'x(...)', but for the z component.