Donations
Help us to pay our Server!
(: Consider a donation :)
Donation pic
Donators
Main Menu
Language
Recent changes

[Main Page]

Trigger and Events Reference

From Widelands.org

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Contents

Triggers and Events Reference

All triggers and events that are available in Widelands are listed here. This is, because

  1. no other documentation but the source exists currently
  2. not all triggers/events have dialogs in the editor to configure them

Eventually all triggers and events should have configuration dialogs in the editor where they can be edited or modified with ease; but since we need more events and triggers fast now for the scenarios, i do not want to spent time on making configuration dialogs for them. I will instead list them here with a short description.

You can directly add or modify triggers by doing the following steps

  1. open the 'config' file in the widelands directory, add the line "nozip=true" in the global options
  2. now make a map (layout, resources, bobs and so on, maybe a few triggers and events)
  3. save the map. It will now be saved in a directory instead of a binary .wmf file
  4. edit in the directory the file "triggers" and "events"

Some variables have default values. They do not need to be written in the files. The default values are consistent across events and triggers; player numbers always have the default value 1, counts always have the default value 1 and radii always have the default value 0.


Triggers

All triggers have the following options:

setWhether the trigger is set (default value is "false").
versionThe version of the trigger. See the respective triggers.
typeWhat type of trigger is this. See the respective triggers.


Building

Triggers when the player has the specified number of buildings of the specified type in the specified area. You can use it to define scenario options like "get this and this many buildings around this mountain".

typeMust be "building".
versionShould be 3 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only look at the point itself, default is 0).
playerThe number of the player (default is 1).
countThe required number of buildings (default is 1).
buildingThe name of the building type. This is the name of the directory in which the configuration of the building is stored, for example "bakery" (not descriptionname).


Military Influence

Triggers when the player has some or highest military influence over the specified number of locations in the specified area.

typeMust be "military_influence".
versionShould be 3 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only look at the point itself, default is 0).
playerThe number of the player (default is 1).
countThe required number of locations (default is 1).
require_highestWhether to require that the player has the highest military influence of any player (in other words, no other player has higher military influence, default is false).


Null

A null trigger never changes by itself. It is used to mark certain conditions. For example you could define a Win Trigger as a Null Trigger and turn it on as soon as the win conditions are reached.

typeMust be "null".


Ownership

Triggers when the player owns the specified number of locations in the specified area.

typeMust be "ownership".
versionShould be 3 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only look at the point itself, default is 0).
playerThe number of the player (default is 1).
countThe required number of locations (default is 1).


Time

A time trigger is triggered after a certain time period. It goes to true if the time has passed.

typeMust be "time".
versionMust be 1.
wait_timeWait time in seconds.
last_start_timeThe most recent time when this tigger was started. Must be zero.


Vision

Triggers when the player sees the specified number of locations in the specified area.

typeMust be "vision".
versionShould be 3 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only look at the point itself, default is 0).
playerThe number of the player (default is 1).
countThe required number of locations (default is 1).
require_active_visionWhether to require that the player currently sees the location (otherwise it is enough that he has seen it some time).


Events

All events have the following options:

state(Default is "init".)
versionThe version of the event. See the respective events.
typeWhat type of event is this. See the respective events.


Allow Building

This event can be used to either allow or forbid a player to build buildings of a specified type.

typeMust be "allow_building".
versionMust be 2.
playerThe number of the player (default is 1).
buildingThe name (not descriptionname) of building type, for example "bakery". There must be a building with that name in the player's tribe.
allowWhether to allow the building type (otherwise forbid).


Building

Create a building for a player. Also creates the flag that belongs to it. Will make sure that the player owns the land and destroys all immovables that are in the way.

typeMust be "building".
versionMust be 1.
pointThe coordinates of the location. First x-coordinate then whitespace then y-coordinate (for example "19 137").
playerThe number of the player (default is 1).
buildingThe name (not descriptionname) of building type, for example "bakery". There must be a building with that name in the player's tribe.
fillWhether to fill the building with things that it would normally request (wares/workers/soldiers, currently only workers, default is true).


Conquer Area

Conquer Area gives a player control of a specified area.

typeMust be "conquer_area".
versionShould be 2 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only that particular location, default is 0).
playerThe number of the player (default is 1).


Flag

Create a flag for a player. Will make sure that the player owns the land and destroys all immovables that are in the way.

typeMust be "flag".
versionMust be 1.
pointThe coordinates of the location. First x-coordinate then whitespace then y-coordinate (for example "19 137").
playerThe number of the player (default is 1).


Immovable

Create an immovable. Destroys the immovable that is in the way (if any).

typeMust be "immovable".
versionMust be 1.
pointThe coordinates of the location. First x-coordinate then whitespace then y-coordinate (for example "19 137").
tribeThe name of the tribe. If this is omitted it is a world immovable.
nameThe name of the immovable.


Message Box

A Message Box will appear whenever this event is triggered. It can be used to grant informations to a player or as a way of telling the story behind a scenario.

type Must be "message_box".
versionShould be 2 (older versions still work but have other variables).
texttext to appear within the box. There are 'single-line' and 'multi-line' texts possible - a single-line text contains all text within one row, whereas in a multi-line text you are allowed to spread the text across several rows. The syntax for single-line texts is either text=abc or text="abc". The syntax for multi-line texts is text=""first row" for the first row, "second row" for any following row, and "last row"" for the last row - all rows are in double quotes, the first row begins with an additional double quote, the last row ends with an additional double quote. You can also change the format of the text and even insert pictures; to do so, you have to write <p> at the beginning of the formatted text and </p> at the end; by adding further options into the first bracket, after the p, you can then format the text. Such options are specified below. Furthermore, a <br> into the text inserts a line break.
window_titleThe title of the message box.
is_modalWheter the game will stop while the Message Box is being displayed, until a button is clicked.
button_00The caption of the button.
button_00_triggerOptional. The name of the null trigger which is being set to true by clicking this button. If any button has a trigger, the message box must be modal.
posx, posy(optional - if omitted, default screen-centred position) numerical value determining the position of the Message Box; -1 is the central default position
width, height(optional - if omitted default standard size) numerical value determining the size of the Message Box

The options for editing the text are:

font-sizenumber - changes font size to specified value
font-facefont-name - changes font to specified font; one currently implemented, aside of the standard one, is Domestic_Manners
font-colorRGB-value - changes color to specified value; FFFFFF would be white, for instance, FF0000 is red, 40FF40 light green, and so forth.
text-allignleft/centre/right - changes text allignment
image map:picturename.xxx - displays picture from pics-directory with specified path (where xxx would be jpg or png most likely)
image-alignleft/centre/right - changes picture allignment
line-spacingnumber - changes line-spacing


Move View

Move View shifts the player's view to a specified area, which can be used to direct his attention to an area.

typeMust be "move_view".
versionShould be 2 (older versions still work but have other variables).
pointThe coordinates of the map location that player's view is to be centered on. First x-coordinate then whitespace then y-coordinate (for example "19 137").
playerThe number of the player (default is 1).


Reveal Campaign

This event reveals a campaign

typeMust be "reveal_campaign".
versionMust be 2.
entryThe name of the cconfig entry to be revealed.


Reveal Objective

This event unhides or hides an objective that was formerly hidden/seen.

typeMust be "reveal_objective".
versionMust be 1.
objectiveThe name of the objective (that is what comes between the [] in the objectives file).


Reveal Scenario

This event reveals a scenario

typeMust be "reveal_scenario".
versionMust be 2.
entryThe name of the cconfig entry to be revealed.


Road

Create a road for a player. Will create flags at start and end unles they are already present. Will make sure that the player owns the land and destroys all immovables that are in the way.

typeMust be "road".
versionMust be 1.
pointThe coordinates of the location where the road starts. First x-coordinate then whitespace then y-coordinate (for example "19 137").
stepsA sequence steps that forms the road. Must be at least 2. Each step is a digit; {1 (northeast), 2 (east), 3 (southeast), 4 (southwest), 5 (west), 6 (northwest)} (for example "33334445555555566"). Illegal or clearly nonoptimal paths (such as "333633") are not allowed.
playerThe number of the player (default is 1).
fillWhether to fill the road with things that it would normally request (a carrier, default is true).


Set Null Trigger

This event can change the set state of a Null Trigger. It can be used to mare an objective as done.

typeMust be "set_null_trigger".
versionMust be 1.
triggerThe name of the null trigger (that is what comes between the [] in the triggers file).
settoWheter the trigger should be set (true) or unset (false) (default is true).


Unhide Area

Unhide Area removes the fog of war at a specified location, allowing the player to see this area even before it has been scouted.

typeMust be "unhide_area".
versionShould be 2 (older versions still work but have other variables).
pointThe coordinates of the centre of the area. First x-coordinate then whitespace then y-coordinate (for example "19 137").
areaThe radius of the area (0 means only that particular location, default is 0).
playerThe number of the player (default is 1).
durationThe duration (in ms) during which full vision is given (default is 0).

Retrieved from "http://xoops.widelands.org/modules/mediawiki/index.php/Trigger_and_Events_Reference"

This page has been accessed 3,494 times. This page was last modified 19:29, 14 August 2008. Content is available under GNU General Public License 2.





Search


Login
Username:

Password:


Lost Password?

Register now!
Polls
Which requires the fewest improvements
Animations in game (buildings, workers, nature, animals)
Graphics in main menu
Campaigns (as well as number of campaigns)
Network support
Sounds
Music
Structure of the economies of the tribes
Maps
The transportation system
In game user interface
The editor
Hosted by