Welcome to the Creatures Wiki! Log in and join the community.

Difference between revisions of "Script numbers"

From Creatures Wiki
Jump to navigation Jump to search
(Added "see also")
Line 18: Line 18:
 
<tr><td>6</td><td>Collision (with a [[room]] boundary)</td></tr>
 
<tr><td>6</td><td>Collision (with a [[room]] boundary)</td></tr>
 
<tr><td>9</td><td>Timer (see [[TICK]])</td></tr>
 
<tr><td>9</td><td>Timer (see [[TICK]])</td></tr>
 +
<tr><td>10</td><td>[[Constructor Script]]</td></tr>
 
<tr><td>12</td><td>Eaten</td></tr>
 
<tr><td>12</td><td>Eaten</td></tr>
 
</table>
 
</table>

Revision as of 15:56, 23 June 2018

Script numbers are used in CAOS scripts, both to define what a script does (so the engine can run the relevant event script as necessary), and to allow other agents to call specific scripts.

They are used by such commands as SCRP, SCRX, CODE. They differ slightly from message numbers, which are used by commands such as MESG WRIT.

Numbers 0 to 255 are reserved for engine use, although not all of them have events associated with them, and the rest can be used for any purpose.

Creatures Evolution Engine examples

A few of the more common reserved script numbers from the Creatures Evolution Engine (C3, DS and CV) are listed below:

NumberDescription
0Deactivate
1Activate 1 (Push)
2Activate 2 (Pull)
3Hit
4Pickup (by something which isn't a vehicle)
5Drop (again, by something which isn't a vehicle)
6Collision (with a room boundary)
9Timer (see TICK)
10Constructor Script
12Eaten

Full list of Creatures Evolution Engine script numbers

NumberNameDescription
0DeactivateCalled when the agent receives a deactivate message.
1Activate 1Called when the agent receives an activate 1 message.
2Activate 2Called when the agent receives an activate 2 message.
3HitCalled when the agent receives a hit message.
4PickupCalled when the agent has been picked up by something other than a vehicle.
5DropCalled when the agent has been dropped by something other than a vehicle.
6CollisionCalled when the agent collides with an obstacle. _P2_ are the x and y components of the collision velocity.
7BumpCalled when a creature walks into a wall.
8ImpactCalled when an agent's presence impacts with another agent's presence (this is assuming both agents have their presence switched on).
9TimerCalled at a regular time interval, as set by TICK.
10ConstructorCalled on creation.
12EatCalled when the creature eats something.
13Start Hold HandsCalled when a creature starts holding hands with the pointer.
14Stop Hold HandsCalled when a creature stops holding hands with the pointer.
16Quiescent on AgentsScripts 16 - 30 are executed on a creature when it decides to do something with its attention on an ordinary agent (rather than a creature). The script should perform this action. Quiescent means stand and watch it. The catalogue entry "Action Script To Neuron Mappings" maps the brain to these scripts, although which scripts require an it object are hard-wired.
17Activate 1 on AgentsActivate 1 it.
18Activate 2 on AgentsActivate 2 it.
19Deactivate on AgentsDeactivate it.
20Approach on AgentsGo up and look at it.
21Retreat on AgentsWalk or run away from it.
22Pickup on AgentsPick it up.
23Drop on AgentsDrop anything you're carrying.
24Need on AgentsSay what's bothering you.
25Rest on AgentsBecoming sleepy.
26West on AgentsWalk idly to west.
27East on AgentsWalk idly to east.
28Eat on AgentsEat it.
29Hit on AgentsHit it.
30Undefined on AgentsFor future expansion.
31Undefined on AgentsFor future expansion.
32Quiescent on CreaturesScripts 32 - 47 are executed on a creature when it decides to do something with its attention on another creature. Quiescent means stand and twiddle your thumbs.
33Activate 1 on CreaturesMating script.
34Activate 2 on CreaturesMating script.
35Deactivate on CreaturesDeactivate it.
36Approach on CreaturesGo up and look at it.
37Retreat on CreaturesWalk or run away from it.
38Pickup on CreaturesPick it up.
39Drop on CreaturesDrop anything you're carrying.
40Need on CreaturesSay what's bothering you.
41Rest on CreaturesRest or sleep.
42West on CreaturesWalk idly to west.
43East on CreaturesWalk idly to east.
44Eat on CreaturesEat it.
45Hit on CreaturesHit it.
46Undefined on CreaturesFor future expansion.
47Undefined on CreaturesFor future expansion.
64FlinchInvoluntary action called when the creature flinches.
65Lay EggInvoluntary action called when the creature lays an egg.
66SneezeInvoluntary action called when the creature sneezes.
67CoughInvoluntary action called when the creature coughs.
68ShiverInvoluntary action called when the creature shivers.
69SleepInvoluntary action called when the creature sleeps.
70FaintingInvoluntary action called when the creature faints.
71UnassignedInvoluntary action for future expansion.
72DieSpecial involuntary action called when a creature dies. Any death animations go here.
73Raw Key DownCalled when a key is pressed and _P1_.
74Raw Key UpCalled when a key is released and _P1_.
75Raw Mouse MoveCalled when the mouse moves and _P2_
76Raw Mouse DownCalled when a mouse button is pressed and _P1_ - 1 left, 2 right, 4 middle.
77Raw Mouse UpCalled when a mouse button is released and _P1_ - 1 left, 2 right, 4 middle.
78Raw Mouse WheelCalled when the mouse wheel is moved and _P1_ - 120 units per 'click'.
79Raw Translated CharCalled when a translated character is received and PAT: TEXT.
92UI Mouse DownCalled when the mouse clicks on an agent.
101Pointer Activate 1Called on the pointer when an agent is activated 1. The script has the same classifier as the agent being activated.
102Pointer Activate 2Called on the pointer when an agent is activated 2. The script has the same classifier as the agent being activated.
103Pointer DeactivateCalled on the pointer when an agent is deactivated. The script has the same classifier as the agent being deactivated.
104Pointer PickupCalled on the pointer when an agent is activated 1. The script has the same classifier as the agent being activated.
105Pointer DropCalled on the pointer when an agent is dropped. The script has the same classifier as the agent being dropped.
110Pointer Port SelectCalled on the pointer when you manipulate a port.
111Pointer Port ConnectCalled on the pointer when you complete the connection between two ports.
112Pointer Port DisconnectCalled on the pointer when you complete the disconnection of two previously connected ports.
113Pointer Port CancelCalled on the pointer if you cancel a port change part way through.
114Pointer Port ErrorCalled on the pointer if there is some error with the configuration of ports the user is trying to make.
116Pointer Clicked BackgroundCalled when the pointer is clicked but there aren't any agents under it.
117Pointer Action DispatchCalled on the pointer to tell it what action clicking would take on the creature under it. _P1_ says what will happen: 0 means no action or not above a creature, 1 means deactivate (slap), 2 means activate 1 (tickle).
118Connection BreakCalled on an agent when any of its ports are broken as a result of exceeding the maximum connection distance.
120Selected Creature ChangedCalled on all agents with this script when the selected creature is changed by _P2_ is the previously selected creature.
121Vehicle PickupCalled when an agent has been picked up by a vehicle.
122Vehicle DropCalled when an agent has been dropped by a vehicle.
123Window ResizedCalled on all agents with this script whenever the main view is resized.
124Got Carried AgentTells an agent that they have just picked something up.
125Lost Carried AgentTells an agent that they have just dropped something.
126Make Speech BubbleCalled when a creature speaks, so scripts can display a speech bubble. Every agent which has this script is called. _P2_ is the creature who is speaking.
127Life EventCalled whenever there is a new life event, whether an event built into the engine, or a custom event sent with _P2_ is the event number as an index into the events for that moniker.
128World LoadedCalled when the world had just been loaded, whether from bootstrap or from a saved file.
135Net OnlineConnection to the Babel server has been made.
136Net OfflineConnection to the Babel server is broken.
137User OnlineUser chosen with _P1_ contains the user's id.
138User OfflineUser chosen with _P1_ contains the user's id.
150Creature Navigation Callback Valid ItCalled by the approach command with _P1_ and _P2_ set to the IT object's X and Y coordinates respectively.
151Creature Navigation Callback Outside Room SystemCalled by the approach command when you are unable to use the CA because you're outside the room system.
152Creature Navigation Callback NeighbourCalled by the approach command if there is no IT object. _P1_ and _P2_ are set to the X and Y coordinates of the room's centre with the highest (or lowest if retreating) smell of IT nearby.
153Creature Navigation Callback LinkAs for 152 but called when the best room is a link.
154Creature Navigation Callback Current Room BestAs for 152 but called when the room you're in is already the best one.
160Creature Ageing CallbackCalled when the creature is about to age. _P1_ contains the value of the next age stage.
200MateReserved for use in the mating scripts, but not directly used by the engine. Tells a male to mate.
255Agent ExceptionThis script specifies the behaviour when an agent tries to do something to an invalid agent. For example, if you try and access an OWNR, you get a run time error. If it is present, that script is called and you can reset variables as necessary.

See also

External links