The points command is used to award points to the player and must be followed by a single integer indicating the number of points to be awarded. The awarded points will be added to the variable SCORE. Below are two examples of the points command being used:
points 10 points gold(points)
If the notify directive has been set in the jacl.conf file, the following message will be displayed:
[YOUR SCORE JUST WENT UP BY n POINTS]
The proxy command is used to issue an in-game move as though it was typed by the player and must be of the following syntax:
proxy Move
The specified Move may consist of multiple parameters, built up from plain text, variables, item labels or item pointers. When the move is issued, all the normal testing will take place and all usual messages will be displayed. The most common use for the proxy command is to translate one command into another similar command. For example, sometimes two different commands can be mapped to the same function:
grammar put *held in *here >insert grammar insert *held in *here >insert
With the above two grammar statments only the verb is different so mapping them to the same function is possible. In some situations, however, this is not possible as the nouns appear in a different order. Below is an example of how the proxy command can save the day:
grammar look at *here through *held >look_at_through
{+look_at_through
;main function code tied to this syntax
}
grammar look through *held at *here >look_through_at
{+look_through_at
proxy "look at " noun2 " through " noun1 ; This will cause
; the alternate
; syntax to be used
}
As you can see, when the second syntax is used, a proxy command is executed. This issues a command on the player's behalf that matches the first syntax, therefore arriving at the main function with noun1 and noun2 pointing to the correct objects.
When a proxy command encounters an object label or pointer, it will output all of that objects names. If the object reference is stored in a variable, integer constant or object element, the macro {names} must be used otherwise the integer value of the container will be output instead. For example, the following code will issue the command "set safe dial to 42":
object dial : safe dial
short the "safe dial"
{set
execute +build_command<this<42
}
{+issue_set
proxy "set " arg[0]{names} " to " arg[1]
}
![]() |
Don't forget to put spaces before and after any item labels or pointers referred to in a proxy command. |
The position command is used to change an object's x and y elements to simulate it moving on a grid. The movement that occurs depends on the current values for the object's bearing and velocity. A position command is simply followed by the label of the object to be moved:
set ship_object(bearing) = 100 set ship_object(velocity) = 180 set ship_object(x) = 500 set ship_object(y) = 500 position ship_object
The above code will set ship_object(x) to equal 500 and ship_object(y) to equal 400.
The bearing command is used to calculate the angle from one object to another based on their current x and y values. A bearing command is followed by a container to store the calculated distance in, the object to measure the angle from, then the object to measure the angle to. For example:
bearing INDEX lighthouse ship_object
write "<p>Bearing from " lighthouse{the} " to "
write ship_object{the} ": " INDEX ^
The distance command is used to calculate the distance between two objects based on the current x and y values. A distance command works in the same manner as a bearing command:
distance INDEX lighthouse ship_object
write "<p>Distance from " lighthouse{the} " to "
write ship_object{the} ": " INDEX ^