The scripting in FreedroidRPG is currently still very limited. It is also very badly documented. And it is also a bit clumsy to edit. It works like this: There are 'triggers' and 'actions'. A trigger is a list of conditions that has to be satisfied in order for something to happen. The trigger can contain a pointer to an action. The action is executed by the game engine once all the conditions mentioned in the trigger are satisfied.
In FreedroidRPG, all the triggers and events are stored in the file map/EventsAndEventTriggers. And example of a trigger might look like this:
// This is a pure location trigger. Copy and adapt is as you feel like it. * Start of an Event Trigger Subsection * Influencer must be at X=2 Y=11 Lev=0 Use map location from map label="TeleportIntoTheWarehouse" Event Action to be triggered by this trigger="teleport_into_the_warehouse" Delete the event trigger after it has been triggered=-1 * End of this Event Trigger Subsection *
Some explanation for this: the line "Influencer must be at X=2 Y=11 Lev=0" specifies a position the main character must be at (where the map squares are the units and the level is the map number). This however is a very bad system, as the triggers need to be (manually) updated when the map is changed or shifted. Therefore we also have some other alternative: You can also use a map label to specify the condition. This label must be contained in the map file of course. Labels can be edited and displayed in visual form via the map editor that is built into the game engine. In general, that's the preferred method to specify positions for an event trigger.
Then there is a label for the 'action' to trigger. In this case it's the action labels "teleport_into_the_warehouse". Since the teleporter should continue to work after being used once, we don't delete the trigger after first usage (-1) in the next line.
That's about all there is in a FreedroidRPG trigger.
Let's look at an 'action': Again, I paste an example:
* Start of an Event Action Subsection * Action label for this action="open_novice_arena_exit_door" Mapchange at X=-1 Y=-1 Lev=-1 to new value=-1 Use map label for map change location="NO_LABEL_DEFINED_YET" modify_obstacle_with_label="NoviceArenaExitDoor" modify_obstacle_to_type=11 Teleport to TelX=-1 TelY=-1 TelLev=-1 Use map label for teleport target="NO_LABEL_DEFINED_YET" Action is Influencer say="Thanks for unlocking the door!" Action is mission assignment=-1 * End of this Event Action Subsection *
The obvious first line is the label for the action. Then there is the mapchange stuff: That can be used to edit a floor value somewhere (on an arbitrary map level). Again, a floor label can be used as an alterantive for specifying the position of the map change. This is hardly used at all, since changing floor values doesn't have much effect in FreedroidRPG. More interesting is the possibility to edit an obstacle. Obstacles are anything that reaches above ground and might even block the movement of Tux or the like. Obstacles sit on top of the floor in each map level. Again, a label can be attached to any obstacle from within the map editor built into the game engine. This label can be used here to specify the obstacle in question. Once the action is executed, we'll change the obstacle type (in this case it's a locked door that will be changed to an unlocked door [code 11]). Maybe the main character (Tux) should also say something (hardly used in the game right now) once the event is executed. A teleportation is also possible. In fact, all the teleporter connections in the game work via such triggers and actions. Maybe even a predefined mission from the mission list can be assigned. But this is also not in use in the current game.
Well, that's about all there is to say about the current scripting possibilities. It would be nice to add some features, like teleporting a different character to a predefined location, such that the Tux and some helpers could appear somewhere to solve some quests. But that's currently not implemented. Also a predefined in-game dialog could be scripted this way. But that's even farther into the future.
So much for the current state of the art of the scripting in our game.
The disadvantage is, that it takes a text-editor to edit and modify the events and triggers, which in general games don't like. Also there is some cluttering because of the mass of events and triggers that accumulate in the course of the story development. This makes editing events and triggers even less attractive.
Even better though might be to skip this stuff with the external 'EventsAndEventTriggers' file altogether and integrate these into the map file. Then there would be less cluttering of game triggers (because they could be displayed in the map editor with a colorful flag or something) and also the associated actions could be edited there (without having to manually set up correctly matching labels at two places inside the EventsAndEventActions file manually with a text editor, which is REALLY CLUMSY!).
Hope we'll see the day when this gets implemented and integrated into the map files and the map editor offers convenient processing.