mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 04:36:55 +00:00
314 lines
6.7 KiB
INI
314 lines
6.7 KiB
INI
# This file contains shortcuts for common WML events (such as prestart, side
|
|
# turn, and such), which can be used to write events faster and in less space.
|
|
#
|
|
# It is recommended that you only use these if you're confident you could write
|
|
# the expanded form as well; these are mostly intended as shortcuts for
|
|
# experienced WML authors.
|
|
|
|
|
|
# Creates a generic event, only intended to be used when no other event can be
|
|
# used.
|
|
|
|
#define ON_EVENT NAME ACTION
|
|
[event]
|
|
name={NAME}
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
|
|
# Creates an event that triggers when the scenario starts but before the user
|
|
# gets any visible output.
|
|
#
|
|
# For example, you can make side 2 start the scenario with ownership of the
|
|
# village at 13,15:
|
|
#
|
|
# {ON_PRESTART (
|
|
# [capture_village]
|
|
# side=2
|
|
# x,y=13,15
|
|
# [/capture_village]
|
|
# )}
|
|
|
|
#define ON_PRESTART ACTION
|
|
[event]
|
|
name=prestart
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
|
|
# Creates an event that triggers when the scenario starts, after the map is
|
|
# displayed but before the player can act.
|
|
#
|
|
# For example you could display some dialogue when the scenario starts:
|
|
#
|
|
# {ON_START (
|
|
# [message]
|
|
# speaker=Konrad
|
|
# message= _ "Hey, I can see some enemies up ahead!"
|
|
# [/message]
|
|
#
|
|
# [message]
|
|
# speaker=Delfador
|
|
# message= _ "Yes, so it would seem. Charge!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_START ACTION
|
|
[event]
|
|
name=start
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
|
|
# Creates an event that triggers at the end of every turn.
|
|
#
|
|
# For example, you could give a player some gold at the end every turn:
|
|
#
|
|
# {ON_NEXT_TURN (
|
|
# [gold]
|
|
# amount=35
|
|
# side=1
|
|
# [/gold]
|
|
# )}
|
|
|
|
#define ON_NEXT_TURN ACTION
|
|
[event]
|
|
name=new turn
|
|
first_time_only=no
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers at the end of the current turn.
|
|
# For example you could give a player some gold before his/hers next turn.:
|
|
# {ON_NEXT_TURN (
|
|
# [gold]
|
|
# amount=100
|
|
# side=1
|
|
# [/gold]
|
|
# )}
|
|
|
|
#define ON_NEXT_TURN_ONCE ACTION
|
|
[event]
|
|
name=new turn
|
|
first_time_only=yes
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers at the start of every players turn
|
|
# For example you could set each players gold to a fixed amount every turn.
|
|
# {ON_SIDETURN (
|
|
# [modify_side]
|
|
# side=3
|
|
# gold=0
|
|
# [/modify_side]
|
|
# )}
|
|
|
|
#define ON_SIDETURN ACTION
|
|
[event]
|
|
name=side turn
|
|
first_time_only=no
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers at the start of turn TURN
|
|
# For example you can create a Wose belonging to player 1 at turn 3:
|
|
# {ON_TURN 3 (
|
|
# [unit]
|
|
# side=1
|
|
# type=wose
|
|
# x,y=12,4
|
|
# [/unit]
|
|
# )}
|
|
|
|
#define ON_TURN TURN ACTION
|
|
[event]
|
|
name=turn {TURN}
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers when the last turn ends.
|
|
# For example you could display a message saying they suck:
|
|
# {ON_LAST_TURN (
|
|
# [message]
|
|
# speaker=narrator
|
|
# message="They suck!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_LAST_TURN ACTION
|
|
[event]
|
|
name=time over
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers when a player wins the game, before the game ends.
|
|
# For example you could congratulate the player:
|
|
# {ON_VICTORY (
|
|
# [message]
|
|
# speaker=narrator
|
|
# message="Congratulations!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_VICTORY ACTION
|
|
[event]
|
|
name=victory
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers when a player wins the game, before the game ends.
|
|
# For example you could suggest an easier difficulty the player:
|
|
# {ON_DEFEAT (
|
|
# [message]
|
|
# speaker=narrator
|
|
# message="Aww.. you lost. Try again with 800g and +40g income?"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_DEFEAT ACTION
|
|
[event]
|
|
name=defeat
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers anytime a unit steps on a given tile.
|
|
# The filter can be used to only affect special units, or units of a given player.
|
|
# For example we could make a tree where the first players leader can read a note, but noone else:
|
|
# {ON_TILE 5 7 (
|
|
# side=1
|
|
# canrecruit=1
|
|
# ) (
|
|
# [message]
|
|
# speaker=narrator
|
|
# message="This is a note."
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_TILE X Y FILTER ACTION
|
|
[event]
|
|
name=moveto
|
|
first_time_only=no
|
|
[filter]
|
|
x={X}
|
|
y={Y}
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers the first time a unit steps on a given tile.
|
|
# The filter can be used to only affect special units, or units of a given player.
|
|
# For example we could make a text-message that is only readable once:
|
|
# {ON_TILE_ONCE 5 7 () (
|
|
# [message]
|
|
# speaker=narrator
|
|
# message="This is a note."
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_TILE_ONCE X Y FILTER ACTION
|
|
[event]
|
|
name=moveto
|
|
first_time_only=yes
|
|
[filter]
|
|
x={X}
|
|
y={Y}
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers anytime a unit matching FILTER dies.
|
|
# For example we can make all units scream in pain upon death:
|
|
# {ON_DEATH () (
|
|
# [message]
|
|
# speaker=unit
|
|
# message="AAaaaaAAaaAAaarrrghh!!!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_DEATH FILTER ACTION
|
|
[event]
|
|
name=die
|
|
first_time_only=no
|
|
[filter]
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers the first time a unit matching FILTER dies.
|
|
# For example we can make only player 3s leader units scream in pain upon death:
|
|
# {ON_DEATH (
|
|
# side=3
|
|
# canrecruit=1
|
|
# ) (
|
|
# [message]
|
|
# speaker=unit
|
|
# message="AAaaaaAAaaAAaarrrghh!!!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_DEATH_ONCE FILTER ACTION
|
|
[event]
|
|
name=die
|
|
first_time_only=yes
|
|
[filter]
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers before any unit matching FILTER advances to a new class.
|
|
# For example we could make it smile:
|
|
# {ON_ADVANCEMENT () (
|
|
# [message]
|
|
# speaker=unit
|
|
# message=":D"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_ADVANCEMENT FILTER ACTION
|
|
[event]
|
|
name=advance
|
|
first_time_only=no
|
|
[filter]
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef
|
|
|
|
# Creates an event that triggers after any unit matching FILTER advanced to a new class.
|
|
# For example we could make it claim to be the strongest one alive:
|
|
# {ON_POSTADVANCEMENT () (
|
|
# [message]
|
|
# speaker=unit
|
|
# message="I'm the strongest one alive!"
|
|
# [/message]
|
|
# )}
|
|
|
|
#define ON_POSTADVANCEMENT FILTER ACTION
|
|
[event]
|
|
name=post_advance
|
|
first_time_only=no
|
|
[filter]
|
|
{FILTER}
|
|
[/filter]
|
|
{ACTION}
|
|
[/event]
|
|
#enddef |