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. _P1_ and _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 IMSK is set. The key code is sent in _P1_.
74Raw Key UpCalled when a key is released and IMSK is set. The key code is sent in _P1_.
75Raw Mouse MoveCalled when the mouse moves and IMSK is set. The new x and y position is sent in _P1_ and _P2_
76Raw Mouse DownCalled when a mouse button is pressed and IMSK is set. The button is sent in _P1_ - 1 left, 2 right, 4 middle.
77Raw Mouse UpCalled when a mouse button is released and IMSK is set. The button is sent in _P1_ - 1 left, 2 right, 4 middle.
78Raw Mouse WheelCalled when the mouse wheel is moved and IMSK is set. The delta value is sent in _P1_ - 120 units per 'click'.
79Raw Translated CharCalled when a translated character is received and IMSK is set. For example, on Japanese systems the raw key down and up codes can be in Roman characters, but the Input Method Editor converts them to Japanese characters, which are sent to the game with this message. The translated key code is sent in _P1_. You can use this for character input, but it is easier to use 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 NORN. _P1_ is the new creature, _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. _P1_ is the text being spoken, _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 HIST EVNT. _P1_ is the moniker that the event happened to, _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.

Number Name Description

135Net OnlineConnection to the Babel server has been made.
136Net OfflineConnection to the Babel server is broken.
137User OnlineUser chosen with NET: WHON has gone online. _P1_ contains the user's id.
138User OfflineUser chosen with NET: WHON has gone offline. _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 OVxx with a NULL target. If this script isn't present for OWNR, you get a run time error. If it is present, that script is called and you can reset variables as necessary.
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.