You can add response to events during play with the scripting languaje of Ollvaror Caves. First of all you must assign a tag to an actor who is going to be the trigger of the event.
Then you have to create a text file with the same name of the map with the extension "olsc". For example, if your map's name is "Example map", the file must be named "Example map.olsc".
The following script is an simple "hello world" example triggered on the death of the creature tagged as "miner".
All the scripts go in this ".olsc" file, like in this example:
The list of the events are the following:
The onload event is different because does't need neither admit an actor in declaration.
The onplayerentermodule doesn't admit an actor in declaration, but has a player. It triggers everytime a player enter o reenter the game. Is intended only for mechanical purposes, like sending big textures.
Switches have onturnon and onturnoff events.
Areas have onenter, onexit and onturnonevents.
Actors have ondie and onplayertak events.
You can include conditionals that evaluates the truth of it's assignment each time, for example:
The conditionals must end with an "end;" command.
Checks if a message contains an specific portion of text. Only uses a parameter, the text to check, for example:
Checks the player (or npc) has sent "die" in the message. Will be true if the player says "die bastard" or "do diet".
Checks if a message matchs a text. Only uses a parameter, the text to check, for example:
Checks the player (or npc) has sent "die" as an exact message.
Checks if a local variable has an specific value. Local variables are assigned by the abstract command "assign". Have two parameters, as seen in the example.
Exactly the opossed to conditionalequal.
Checks if the actor is a player. Have no parameters.
Checks if the actor is in a faction.
The faction can be chaos, players and no.
conditionalfaction:players; and conditionaplayer:; are not the same, as npc have players faction.
Checks if the actor have an especific tag. Never true for players.
Similar to conditionalequal, but with entire numbers. Have a name and a entire value.
Similar to conditionalequal, but variables are assigned to a specific actor.
Only to be used with "onglobalchange" event.
Checks the status of tagged actor and furnitures.
Cheks if a player choose a particular option on an election. Only in "onplayerchoose" event.
Checks the status of an accomplished task.
Look for "accomplish" command.
A "more open" conditional
The sentence is written as a SQL command.
Stupid example (always true, as 3 is always differente from 4):
Check "Coding structures" for not so stupid usages.
Have no perceptible effect, but are necesary for advanced effects.
Assigns a value on a variable.
The same, for an actor.
Assign an entire value to a counter
Increases or decreases the value of a counter, by one or a value
Send a texture skipping the normal flux. Created to be used with "onplayerentersmodule".
Deprecated now: all textures are sent on entering map.
Add a background. Only in onload.
Stablish the sight range in pixels. The server sends the players objects in their sight range. However only works in 400-pixels cells, so it will round other values.
By default the value is 800, and cannot be reduced.
Actually only makes sense to view moving visuals which begins far away, but would enter de sight range in their moves.
Don't use if you don't need. It overloads the data transmission.
Load each relic individually so the screen knows of its existence.
The loadrelic goes inside the event:onload;
Example:
Do a perceptible effect.
Finish an objetive of the game. Have a parameter.
It's posible to repeate the name if they're equal.
The same, but only for one target. Only for persistant maps.
Pauses de game for a time
Sends a message to all player in the chatbox
Sends a message in a position of the screen. Bigmessage send to all player, and bigmessageto send to the player that triggers the event.
The parameters are (in order):
A reasonable option for dialoging with non-player characters.
First, the necessary variables are declared with #. The .= is used to concatenate the variable.
The parameters are (in order):
A reasonable option for responding non-player characters.
It's even possible to make payments to get [x item/thing]. In this case, the payment method is secure. A server cannot cheat players out of their money, as confirmation is always requested from the player, indicating the amount to be paid.
The playeroptions must be inside the messagecontains.
The parameters are (in order):
Shows an image to all players, or to a player.
The effect of this line is best seen on this image:
The parameters are (in order):
Creates a movile (or not) visual effect. It can be animated.
The parameters are (in order):
We can create a snow falling effect repeting the following line:
Changes the texture of an static tagged object.
Change the alpha channel.
Change the light radious.
Starts a custom sound.
Sends a message to the console
Perhaps useful for debugging.
The parameters are (in order):
Start a stopped trap (0 cycles left). Must be prepared previously with "addtrap", but it is not required to start until stopped.
The parameters are (in order):
Stops a trap. It will conclude it cycle.
The parameter is:
Fades to black or other color.
The parameters are (in order):
Moves a tagged tile to a direction.
The parameters are (in order):
The same, but doesnt care about actors trapped.
Set a parameter on a switch.
The parameters are (in order):
Stablish the return status of an used switch. Only for "onturnon" event of a switch.
Status can be "true" or "false".
Sends an actor an order to change its home in the X axis.
Assing a contagion to a tagged object (actor, furniture...)
Create penalty for actors. Intended for "onenter".
The parameters are (in order):
Create bonus for actors.
The parameters are (in order):
Create limits for actors. Intended for "onenter".
The parameters are (in order):
Remove all limits and effects.
Intended for areas. Tag must be empty when used on "onexit" event.
Create an area around objets with a tag.
Summon a creature at a position.
The parameters are (in order):
ID | Name |
1 | Dormenian soldier |
2 | Eridian soldier |
3 | Harrassian soldier |
4 | Tirtic soldier |
5 | Chaos eyes |
6 | Unarmed |
7 | Oso del caos |
8 | Perro del caos |
9 | Caracol del caos |
10 | Cabra del caos |
11 | Rapaz del caos |
12 | Blando menor |
13 | Falta de personalidad menor |
14 | Codicia menor |
15 | Simpleza menor |
16 | Mezquindad menor |
17 | NPC |
18 | Minero corrupto corto |
19 | Minero corrupto largo |
20 | Minero corrupto pesado |
21 | Minero corrupto aura |
22 | Masa de carne |
23 | Guardián corrupto guerrero hacha |
24 | Guardia esclavista |
25 | Guardia corrupta cadenas |
26 | Masa de carne voladora |
27 | Maza de carne mini |
28 | Masa de carne torreta |
29 | Crow |
30 | Temeridad menor |
31 | Agente corrección |
32 | Guerrero ollvaror |
33 | Cobardía menor |
34 | Falsedad menor |
35 | Crueldad menor |
36 | Desidia menor |
37 | Indecisión menor |
38 | Desenfreno menor |
39 | Insistencia menor |
40 | Individualismo menor |
41 | Ostentosidad menor |
42 | Guerrero rebelde ollvaror |
43 | alma_l |
44 | alma_c |
45 | alma_v |
46 | Inconstancia menor |
47 | Brusquedad menor |
48 | Belicosidad menor |
49 | Agente correción boss |
50 | Inconstancia menor true |
51 | Masa de carne voladora enorme |
An actor sends a message
Create a healing effect. If not tag wil heal the trigger of the event.
Clean up the consumed chaos. If not tag, will clean up the chaos of the trigger of the event.
The character recovers an amount of 'never surrender'.
In the following example it recovers as many as its power
Teleports the event trigger to a position.
The parameters are (in order):
It establishes that you cannot exit in an area.
Example:
Replaces the inventory of the trigger.
The parameters are (in order):
Any parameter can be 0.
ID | Name | Weight (kg) |
1 | Leather armor | 3 |
2 | Mail armor | 7 |
3 | Eridian armor | 12 |
4 | Carsij armor | 13 |
5 | Ollvaror armor | 18 |
101 | Dagger | 0.5 |
102 | Short sword | 1 |
103 | Long sword | 1.5 |
104 | Greatsword | 2.5 |
105 | Hand axe | 2 |
106 | War axe | 3 |
107 | Gunear axe | 4 |
108 | Dormenian halberd | 2 |
109 | Eridian halberd | 3 |
110 | Hammer (not implemented) | 3 |
111 | Maul | 5 |
112 | Flail | 1 |
113 | Mace | 1.5 |
116 | Club | 0.6 |
201 | Light shield | 1 |
202 | Round shield | 1.5 |
203 | Heavy shield | 2 |
Sends the player the order to preload music.
Sends the player the order to load a section of the preload music.
Delays the execution of a portion of script.
Delays can't be delayed.
As actorassign, but the value is stored on the server for further reading.
Global variables are saved on the hard drive when assigned, and read when the player joins game in the server in an individual file for each character.
Shall not be abused.
Similar to conditionalactorequal, but stored on a file on the server. The values are read from the program memory, so can be abused.
As assign, but the value is stored on the server for further reading.
Global variables are saved on the hard drive when assigned, and read when the server launches.
Triggers onglobalchange in all games in the server.
Shall not be abused.
Similar to conditionalequal, but stored on a file on the server. The values are read from the program memory, so can be abused.
Cheks if a character has an attribute.
You can use basic logic operators (==, >=, <=, < and >) and some attributes:
Creates a proyectile.
Creates a switch.
The parameters are (in order):
The switch has to be somewhere on the map in the map editor. You can put it hidden outside of accessible areas.
Note: with character(posx) and character(posy) you access the character's coordinates.
Creates a furniture.
The parameters are (in order):
The furniture has to be somewhere on the map in the map editor. You can put it hidden outside of accessible areas.
Set the animation of a map surface.
Turn a tagged switch, if posible.
Checks if tagged swith is on.
If multiple switch are tagged, checks if all are on.
Same as conditionalswitchon.
Checks random circunstances.
Cheks if a switch is on a position.
It is used to hand over the relic to a character.
Does not work without loadrelic command.
Example:
Change the target's behavior.
In the following example it is used so that chaos creatures have a more limited vision.
The parameters are (in order):
Add a custom item to inventory.
Example:
The parameters are (in order):
If you want to know if a character has the key you can use ncustomitem(key) to get the number of items named 'key' in the inventory
Example:
Turn the NPC in the direction of the character. Useful in interactions with them.
Example:
With this command, which goes in the event:onload; we can modify the lights. It's great for adding darkness in caves for example.
Example:
The parameters are (in order):
Changes the player's camera to the desired position, or returns the camera to the player.
Example:
The parameters are (in order):
Stuns the actor
Example:
The parameters are (in order):
Note: If you put nothing, or put "cast", the value counts as if it were damage. If you put "nothing" the stune force counts as game turns (30 is a second)
removes the actor's stun
Example:
Most of the commands admits variables ad parameters.
Example
We spanish people say "To the good understander few words are enough".
Not all commands have implemented variable parameters.
Declared an checked with #. Works as text, so expect some problems.
The following example makes the same as the previous one.
Variables are lost at the end of the event.
Declared in the top of the code.
Funtions works as a text replacement, call a function only insert its contents on the calling code.
So the following example is exactly the same as the previous one.
Functions have no parameters (perhaps some day), but as they are code insertions yo can use variables (#) in and out and you have to TAKE CARE not using the same variable names.