rdfs:comment
| - Freeciv supports Event Scripting in rulesets and scenarios since version 2.1, using the Lua language. The tutorial is implemented as a scripted scenario.
- Events are scripted interactions that can be placed at any position on any map. They can take a variety of inputs, with access to input from the player in the form of getting them to enter a word or phrase, choose from a number of pre-set options, or selecting a character. Events can modify a wide variety of in-game variables: character stats, health, conditions, party gold, gems, awards, and so forth. They can also modify the map by adding monsters, changing tiles, adding objects, removing objects, and removing events, as well as providing output to the player in the form of NPC dialogs and output windows full of text, playing sound effects or CD audio, etc.
|
abstract
| - Freeciv supports Event Scripting in rulesets and scenarios since version 2.1, using the Lua language. The tutorial is implemented as a scripted scenario.
- Events are scripted interactions that can be placed at any position on any map. They can take a variety of inputs, with access to input from the player in the form of getting them to enter a word or phrase, choose from a number of pre-set options, or selecting a character. Events can modify a wide variety of in-game variables: character stats, health, conditions, party gold, gems, awards, and so forth. They can also modify the map by adding monsters, changing tiles, adding objects, removing objects, and removing events, as well as providing output to the player in the form of NPC dialogs and output windows full of text, playing sound effects or CD audio, etc. The events for a given map are stored in a file named MAZExxxx.EVT, where xxxx is a decimal representation of the map number. Like all other map files used by the Xeen engine, the first zero is replaced by an 'X' if the map number is greater than 99: MAZE0024.EVT for map number 24, and MAZEX128.EVT for map number 128. Each individual event is stored as a set of lines, each of which contains an instruction for the engine to execute. The lines are numbered, so that it is possible to jump between lines using the equivalent of a GOTO command. The event file itself consists of these lines all stored one after the other. Each line consists of:
* Length byte - the next n bytes make up this line
* X-Coordinate (byte) - the X-offset of this event
* Y-Coordinate (byte) - the Y-offset of this event
* Facing Direction (byte) - the directions this event can be triggered from
* Line number (byte) - the relative number of this line in the current event
* Opcode byte - the command to execute
* Optional arguments - any number of bytes The X, Y, and facing bytes combine to indicate the tile the party must be standing on, and the direction they must be facing to trigger the event. A direction value of 4 means that the event can be triggered if the party is facing any direction.
|