Functions

int Rand void Quit void Waitframe void Waitdraw void Trace void TraceB void TraceS void TraceToBase void TraceNL void ClearTrace float Sin float Cos float Tan float RadianSin float RadianCos float RadianTan float ArcTan float ArcSin float ArcCos float Max float Min int Pow int InvPow float Log10 float Ln int Factorial float Abs float Sqrt void CopyTile void SwapTile void ClearTile int SizeOfArray
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

Global Functions Documentation

Functions and Properties

Return Type Function Information
intRand(int maxvalue)
Computes and returns a random integer i such that 0 <= i < maxvalue.
The return value is undefined if maxvalue is 0 or negative.
voidQuit()
Terminates execution of the current script. Does not return.
voidWaitframe()
Temporarily halts execution of the current script. This function returns at the beginning of the next frame of gameplay.
Slots 1, 3 and 4 Global scripts and item scripts only execute for one frame, so in those scripts Waitframe() is essentially Quit().
It is safe to call Waitframe in the active global script.
voidWaitdraw()
Halts execution of the script until ZC's internal code has been run (movement,
collision detection, etc.), but before the screen is drawn. This can only
be used in the active global script.
voidTrace(float val)
Prints a line containing a string representation of val to allegro.log.
Useful for debugging scripts.
voidTraceB(bool state)
Prints a boolean state to allegro.log
voidTraceS(int s[])
Takes the array pointer as its argument, and prints it as a string to allegro.log
Maximum 512 characters. Functions from string.zh can be used to split larger strings.
voidTraceToBase(int val, int base, int mindigits)
Prints a line in allegro.log representing 'val' in numerical base 'base'
where 2 <= base <= 36, with minimum digits 'mindigits'.
Can be useful for checking hex values or flags ORed together, or just to trace
an integer value, as Trace() always traces to four decimal places.
voidTraceNL()
Traces a newline to allegro.log
voidClearTrace()
Clears allegro.log of all current traces and messages from Zelda Classic/ZQuest.
floatSin(float deg)
Returns the trigonometric sine of the parameter, which is interpreted
as a degree value.
floatCos(float deg)
Returns the trigonometric cosine of the parameter, which is
interpreted as a degree value.
floatTan(float deg)
Returns the trigonometric tangent of the parameter, which is
interpreted as a degree value. The return value is undefined if
deg is of the form 90 + 180n for an integral value of n.
floatRadianSin(float rad)
Returns the trigonometric sine of the parameter, which is interpreted
as a radian value.
floatRadianCos(float rad)
Returns the trigonometric cosine of the parameter, which is
interpreted as a radian value.
floatRadianTan(float rad)
Returns the trigonometric tangent of the parameter, which is
interpreted as a radian value. The return value is undefined for
values of rad near (pi/2) + n*pi, for n an integer.
floatArcTan(int x, int y)
Returns the trigonometric arctangent of the coordinates, which is
interpreted as a radian value.
floatArcSin(float x)
Returns the trigonometric arcsine of x, which is
interpreted as a radian value.
floatArcCos(float x)
Returns the trigonometric arccosine of x, which is
interpreted as a radian value.
floatMax(float a, float b)
Returns the greater of a and b.
floatMin(float a, float b)
Returns the lesser of a and b.
intPow(int base, int exp)
Returns base^exp. The return value is undefined for base=exp=0. Note
also negative values of exp may not be useful, as the return value is
truncated to the nearest integer.
intInvPow(int base, int exp)
Returns base^(1/exp). The return value is undefined for exp=0, or
if exp is even and base is negative. Note also that negative values
of exp may not be useful, as the return value is truncated to the
nearest integer.
floatLog10(float val)
Returns the log of val to the base 10. Any value <= 0 will return 0.
floatLn(float val)
Returns the natural logarithm of val (to the base e). Any value <= 0 will return 0.
intFactorial(int val)
Returns val!. val < 0 returns 0.
floatAbs(float val)
Return the absolute value of the parameter, if possible. If the
absolute value would overflow the parameter, the return value is
undefined.
floatSqrt(float val)
Computes the square root of the parameter. The return value is
undefined for val < 0.
voidCopyTile(int srctile, int desttile)
Copies the tile specified by scrtile onto the tile space
specified by desttile.
voidSwapTile(int firsttile, int secondtile)
Swaps the two tiles specified by firsttile and secondtile.
voidClearTile(int tileref)
Erases the tile specified by tileref.
intSizeOfArray(int array[])
Returns the size of the array pointed by 'array'