A Look at Cog Verbs
There are three general types of cog verbs:
- Verbs that return a value.
- Verbs that set a value.
- Verbs that perform an action.
Verbs That Return A Value
The first type usually begins with "get." These verbs find a value and return it for relational tests
and variable definitions. For example:
if(GetCurrentCamera() == 1) cam=1;
And also:
cam=GetCurrentCamera();
In both cases, GetCurrentCamera() returned a value to be used by other code.
Verbs That Set A Value
These verbs set a value that will affect some element of the game.
An example:
SetThingMoveSize(player, 5);
In that example, the movesize template setting for the player was reset to 5 JKUs.
Verbs That Perform An Action
The third type performs an action. Some of these verbs also return a value. Here's an
example with the verb, CreateThing().
thing=CreateThing(thingtemp, player);
CreateThing() creates a thing with the template provided in the first parameter. The second parameter was the thing to create
the new thing at. CreateThing() returns the thing number of the thing it created. The variable, thing, was assigned to the thing
number of the thing that was created.
Verb Parameters
JK reads a verb's parameters from right to left. It will ignore any extra parameters to the left of the list. Any parameters to the left of the list
that are not passed in will have a default value of -1.