https://wiki.wesnoth.org/api.php?action=feedcontributions&user=Queenkiller&feedformat=atomThe Battle for Wesnoth Wiki - User contributions [en]2024-03-28T07:20:28ZUser contributionsMediaWiki 1.31.16https://wiki.wesnoth.org/index.php?title=User:Queenkiller&diff=12818User:Queenkiller2006-11-26T13:23:38Z<p>Queenkiller: </p>
<hr />
<div>== Queen Killer ==<br />
Also known as qk or qk-gen. In wesnoth I primary work on bug fixing. <br />
<br />
In real life I study informatics at Charles university at Prague. I add to wesnoth project at September 06, but know about wesnoth long time, my first release which I play is 0.8.11.<br />
<br />
You can contact me via ICQ: 163121964 , jabber qk@njs.netlab.cz or IRC at channel wesnoth-dev (freenode).<br />
<br />
<br />
== planned ==<br />
<br />
After release 1.2 I plan help with OGL(open GL) engine and implement some WML features. Also still fixing bugs.<br />
<br />
<br />
== in Progress ==<br />
<br />
fixing bugs until release 1.2.<br />
<br />
<br />
== Done ==<br />
<br />
Fixed some bugs in 1.2 especialy WML bugs, segmentation fault bugs and other non-graphic non-network bugs.</div>Queenkillerhttps://wiki.wesnoth.org/index.php?title=EventWML&diff=12016EventWML2006-10-10T12:37:58Z<p>Queenkiller: /* the [event] tag */</p>
<hr />
<div>{{WML Tags}}<br />
== the [event] tag ==<br />
<br />
This tag is a subtag of [scenario] (or [unit] - see '''event''', [[UnitWML]]) which is used to describe a set of actions<br />
which trigger at a certain point in the scenario.<br />
<br />
keys and tags that describe when the event should trigger:<br />
<ul><li> ''name'' this is not like a normal 'name' key. It is a basic description of when the event will trigger.<br />
* ''prestart'' the event is triggered before a scenario 'starts' -- before anything is shown on the screen at all. You can use this event to set up things like village ownership. For things displayed on-screen such as character dialog, use 'start'.<br />
* ''start'' this event triggers after the map is shown but before the scenario begins<br />
* ''new turn'' this event triggers whenever the last player ends their turn. See also '''first_time_only=no'''. When the last player ends their turn, before any events of this type trigger, the value of the WML variable '''turn_number''' is set to the number of the turn that is beginning.<br />
* ''side turn'' this event triggers when a side starts it's turn. Before events of this type trigger, the value of the WML variable '''side_number''' is set to the number of the side of the player about to take their turn.<br />
* ''turn ''X'''' this event triggers at the start of turn ''X''. ''X'' cannot be 1.<br />
* ''time over'' this event triggers on turn ''turns''. (''turns'' is specified in [scenario])<br />
* ''enemies defeated'' this event triggers when all units with '''canrecruit=1''' (i.e. all leaders) not allied with side 1 are killed.<br />
* ''victory'' in this scenario, any tag of the form '''[endlevel] result=victory [/endlevel]''' will be automatically preceded by all actions in this tag. It helps debugging if the victory event allows you to safely advance to any of the possible next maps after using the ":n" command. Scenarios where key units are picked up before the victory, or where some action chosen earlier determines which map to advance to, make it hard to quickly test scenarios in a campaign. (See also [endlevel], [[DirectActionsWML]])<br />
* ''defeat'' in this scenario, any tag of the form '''[endlevel] result=defeat [/endlevel]''' will be automatically preceded by all actions in this tag. (See also [endlevel], [[DirectActionsWML]])<br />
* ''ai turn'' is triggered just before the AI is invoked for a player. This is called after ''side turn'', so if you move a unit here, its movement will not be reset .<br />
<br />
Events with the following trigger types can be filtered on (see [[FilterWML]]).<br />
Whenever one of these events is triggered,<br />
the position of ''primary_unit'' is stored in the variables 'x1' and 'y1',<br />
and the position of ''secondary_unit'' is stored in 'x2' and 'y2'.<br />
<br />
* ''moveto'' triggers after ''primary_unit'' moves. Usually the location of ''primary_unit'' is also filtered on; remember that this is the location that ''primary_unit'' lands on, not the location it started on or any location it travels on.<br />
* ''sighted'' this event triggers when ''primary_unit'' moves to a location where ''secondary_unit'' is in ''primary_unit'''s sight range. Works only in shroud or fog.<br />
* ''attack'' this event triggers when ''primary_unit'' attacks ''secondary_unit''.<br />
* ''attacker_hits'' this event triggers when the attacker (''primary_unit'') hits the defender (''secondary_unit'').<br />
* ''attacker_misses''} same as ''attacker_hits'', but is triggered when the attacker misses.<br />
* ''defender_hits'' this event triggers when the attacker (''primary_unit'') is hit in retaliation by the defender (''secondary_unit'').<br />
* ''defender_misses'' same as ''defender_hits'', but is triggered when the defender misses.<br />
* ''attack_end'' is similar to ''attack'', but is instead triggered after the fight, not before. Note that if either unit is killed during the fight, this event triggers before any ''die'' events.<br />
* ''stone'' this event triggers when ''primary_unit'' is hit by an attack with the 'stones' ability (See ''stones'', [[AbilitiesWML]]) by ''secondary_unit'' (''secondary_unit'' is the unit with the 'stones' ability.)<br />
* ''die'' this event triggers when ''primary_unit'' is killed by ''secondary_unit''.<br />
* ''capture'' this event triggers when ''primary_unit'' captures a village. The village may have been previously neutral, or previously owned by another side; merely moving into your own villages does not constitute a capture.<br />
* ''recruit'' this event triggers when ''primary_unit'' is recruited or recalled. (That is, when a unit is recruited or recalled, it will trigger this event and this event's filter will filter that unit.)<br />
* ''advance'' this event triggers just before ''primary_unit'' is going to advance to another unit.<br />
* ''post_advance'' this event triggers just after ''primary_unit'' has advanced to another unit.<br />
* ''select'' triggers when a unit is selected. Mainly useful for the tutorial.<br />
<br />
An '''[allow_undo]''' tag anywhere within a moveto event will cancel any lack of undo functionality the event would have<br />
caused. It is up to the scenario designer to avoid abusing this command by allowing undo on events that shouldn't be<br />
undoable. The results of doing this may be strange. This actually does have functionality beyond aesthetics like<br />
signs: suppose you have an event that performs some action depending on the condition of an 'if' statement. This event<br />
might be executed on every single move, but the body of the 'if' statement entered only in a few cases. Previously<br />
this would completely disable undo for the entire scenario, while now it can be made to only disable undo in the cases<br />
where the event mutates the scenario.<br />
</li></ul><br />
<br />
''Primary_unit'' can be referred to as '''unit''' and ''Secondary_unit'' can be referred to as '''second_unit''' in [message] tags. For example:<br />
[event]<br />
name=die<br />
[message]<br />
speaker=second_unit<br />
message="Hahaha, I finally killed you!"<br />
[/message]<br />
<br />
[message]<br />
speaker=unit<br />
message="It's not over yet! I'll come back to haunt you!"<br />
[/message]<br />
[/event]<br />
<br />
These keys and tags are more complex ways to filter when an event should trigger:<br />
* ''first_time_only'' whether the event should be removed from the scenario after it is triggered. Default is 'yes'.<br />
* '''[filter]''' the event will only trigger if ''primary_unit'' matches this filter.<br />
** standard unit filter - attributes for [filter] are described in [[FilterWML]]<br />
* '''[filter_second]''' is like [filter], but for ''secondary_unit''.<br />
** standard unit filter<br />
* '''[special_filter]''' and '''[special_filter_second]''' can be used to set some additional filtering criteria for ''primary_unit'' and ''secondary_unit'' that are not generally available in a standard unit filter. Can be used in events ''attack'', ''attacker_hits'', ''attacker_misses'', ''defender_hits'', ''defender_misses'' and ''attack_end''.<br />
** ''weapon'' the name of the weapon used.<br />
** ''terrain'' the letter of the terrain the unit is on.<br />
<br />
=== Actions triggered by [event] ===<br />
<br />
After the trigger conditions have been met, all action tags within the [event] tag are executed in the order they are written in.<br />
<br />
There are 3 main types of actions:<br />
* direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay<br />
* display actions ([[InterfaceActionsWML]]) which show something to the user<br />
* internal actions ([[InternalActionsWML]]) which are used by WML internally<br />
<br />
Several actions use standard filters to find out which units<br />
to execute the command on. These are denoted by the phrases<br />
"standard unit filter" and "standard location filter".<br />
<br />
=== Nested events ===<br />
<br />
There is 1 special type of action: event creation. By placing an '''[event]''' tag inside another '''[event]''' tag, the nested event is created when the outer event executes. For example, you could create a portal that opens on turn 10. The outer event executes on turn 10, creating the nested moveto event, which executes when a player steps on a certain spot. An equivalent way of doing this would be to a single moveto event with an if statement to check for turn number, but using nested '''[event]''' tags is a simple and elegant way to accomplish more complex tasks without resorting to excessive if statements.<br />
<br />
== See Also ==<br />
<br />
* [[DirectActionsWML]]<br />
* [[InternalActionsWML]]<br />
* [[InterfaceActionsWML]]<br />
* [[FilterWML]]<br />
* [[ReferenceWML]]<br />
<br />
<br />
[[Category: WML Reference]]</div>Queenkillerhttps://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&diff=11914InterfaceActionsWML2006-09-24T21:56:55Z<p>Queenkiller: /* Other interface tags */</p>
<hr />
<div>{{WML Tags}}<br />
== Interface actions ==<br />
<br />
Interface actions are actions that do not have an effect on gameplay;<br />
instead, they show something to the player. The main interface tags<br />
are '''[message]''' and '''[objectives]''', but several other tags affect<br />
the interface also.<br />
<br />
== [message] ==<br />
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.<br />
<br />
The following key/tags are accepted for [message]:<br />
* standard unit filter - the unit whose profile and name are displayed. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).<br>'''[message]''' elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.<br />
<br />
* ''speaker'' an alternative to standard unit filter<br />
** 'narrator' the dialog box is displayed without a caption for the unit speaking or a unit image<br />
** 'unit' the primary unit for the event is speaking<br />
** 'second_unit' the secondary unit for the event is speaking<br />
<br />
* ''message'' (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' " ''')<br />
* ''image'' (default: profile image of speaker) the image to display next to the message.<br />
* ''caption'' (default: name of speaker) the caption to display under the image. Name to be displayed.<br />
* ''duration'' (default: 10) the minimum number of frames for this message to be displayed. (A frame lasts about 30 milliseconds.) During this time any dialog decisions will be disregarded. {{DevFeature}}<br />
* ''sound'' a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.<br />
* '''[option]''' zero or more '''[option]''' elements may be present. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option.<br />
** ''message'' (translatable) the text displayed for the option (see [[DescriptionWML]])<br />
** '''[command]''' an element containing actions which are executed if the option is selected.<br />
<br />
Text formatting options for '''[message]'''. These can also be used in unit names (user_description), objectives, and such.<br />
* An asterisk (*) as the first character causes the line to be boldfaced.<br />
* An at symbol (@) as the first character causes the line to be green, as done with victory conditions.<br />
* A pound symbol (#) as the first character causes the line to be red, as done with defeat conditions.<br />
* A backquote (`) as the first character causes the line to be smaller.<br />
* If used, the caption key text is boldfaced.<br />
* An RGB colour code in the beginning causes the line to be the given colour. This can still be preceded by the above characters. Example: ''message=_"<255,0,0>Red!"''<br />
<br />
== [objectives] ==<br />
The other tag used for plot development is '''[objectives]'''.<br />
The '''[objectives]''' tag overwrites any previously set objectives,<br />
and displays text which should describe the objectives of the scenario.<br />
Scenario objectives are displayed on the player's first turn after the tag is used,<br />
or as part of the event if it triggers during that player's turn.<br />
Objectives can also be accessed at any time in a scenario using the<br />
"Scenario Objectives" game menu option, making this tag useful for<br />
scenario-specific information that the player may need to refer to during play.<br />
<br />
This tag renders the ''objectives'' attribute of [scenario] obsolete (see ''objectives'', [[ScenarioWML]]).<br />
Instead of using ''objectives'', use '''[objectives]''' to set scenario objectives inside a prestart event.<br />
It can also be used to overwrite the starting objectives mid-scenario.<br />
<br />
Attributes of '''[objectives]''':<br />
* ''side'' Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides.<br />
* ''summary'' Displayed first in the objectives text, this should describe the basic objective for the overall scenario. Can be omitted.<br />
* ''note'' Displayed last in the objectives text, this is sometimes used for hints or additional information. Can be omitted.<br />
* ''victory_string'' Default ' _ "Victory:"', this text precedes the victory objectives.<br />
* ''defeat_string'' Default ' _ "Defeat:"', this text precedes the defeat objectives.<br />
* ''silent'' Default: not present. If set to "yes", the objectives are silently changed. Else, they will be shown to the user when appropriate.<br />
<br />
Tags of '''[objectives]''':<br />
* '''[objective]''' describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.<br />
** ''description'' text for the specific win or loss condition.<br />
** ''condition'' The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'')<br />
<br />
<br />
== Other interface tags ==<br />
<br />
The following tags are also action tags:<br />
* '''[item]''' makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something.<br />
** ''x'', ''y'' the location to place the item.<br />
** ''image'' the image (in ''images/ ''as .png) to place on the hex.<br />
** ''halo'' an image to place centered on the hex. Use this instead of ''image'' if the image is bigger than the hex.<br />
* '''[removeitem]''' removes any graphical items on a given hex<br />
** ''x'', ''y'' the hex to remove items off<br />
* '''[print]''' displays a message across the screen. The message will disappear after a certain time.<br />
** ''text'' (translatable) the text to display.<br />
** ''size'' (default=12) the pointsize of the font to use<br />
** ''duration'' (default=50) the length of time to display the text for. This is measured in the number of 'frames'. A frame in Wesnoth is usually displayed for around 30ms.<br />
** ''red'', ''green'', ''blue'' (default=0,0,0) the color to display the text in. Values vary from 0-255.<br />
* '''[move_unit_fake]''' moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.<br />
** ''type'' the type of the unit whose image to use<br />
** ''x'' a comma-seperated list of x locations to move along<br />
** ''y'' a comma-seperated list of y locations to move along (x and y values are matched pairs)<br />
** ''side'' the side of the fake unit, used for team colouring the fake unit<br />
* '''[hide_unit]''' makes the given unit become invisible. Useful in conjunction with '''[move_unit_fake]''' to move a leader unit into position on-screen. Only one unit may be hidden at a time.<br />
** ''x'', ''y'' location of the unit to be hidden. (NOT a standard unit filter! Just x and y.)<br />
* '''[unhide_unit]''' stops the currently hidden unit from being hidden.<br />
* '''[scroll]''' Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.<br />
** ''x'', ''y'' the number of pixels to scroll along the x and y axis<br />
* '''[scroll_to]''' Scroll to a given hex<br />
** ''x'', ''y'' the hex to scroll to<br />
** ''check_fogged'' (default=true) check for fogged hex and if yes then don`t scroll<br />
* '''[scroll_to_unit]''' Scroll to a given unit<br />
** standard unit filter<br />
* '''[sound]''' Plays a sound<br />
** ''name'' the filename of the sound to play (in ''sounds/'' as .wav or .ogg)<br />
* '''[music]''' Switches to playing different music<br />
** ''name'' the filename of the music to play (in ''music/'' as .ogg)<br />
** see [[MusicListWML]] for the correct syntax<br />
* '''[colour_adjust]''' tints the colour of the screen.<br />
** ''red'', ''green'', ''blue'' values from -255 to 255, the amount to tint by for each colour<br />
* '''[delay]''' pauses the game<br />
** ''time'' the time to pause in milliseconds<br />
* '''[redraw]''' redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).<br />
** ''side'' if used, recalculates fog and shroud for that side. Useful if you for example spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).<br />
* '''[unit_overlay]''' sets an image that will be drawn over a particular unit, and follow it around<br />
** ''x'', ''y'' the location of the unit to overlay on<br />
** ''image'' the image to place on the unit<br />
* '''[remove_unit_overlay]''' removes a particular overlayed image from a unit<br />
** ''x'', ''y'' the location of the unit to remove an overlay from<br />
** ''image'' the image to remove from the unit<br />
* '''[animate_unit]''' uses the custom animation of a unit to animate it on screen (if the unit has the corresponding animation)<br />
** ''flag'' the key to find the good custom animation in the unit description see the '''[extra_anim]''' description in [[AnimationWML]]<br />
** '''[filter]''' a standard unit filter see [[FilterWML]] by default, the unit at the event location will be animated. You can use this tag to choose what unit to animate<br />
* '''[label]''' places a label on the map.<br />
** ''x'', ''y'' the location of the label<br />
** ''text'' what the label should say<br />
<br />
== See Also ==<br />
* [[DirectActionsWML]]<br />
* [[InternalActionsWML]]<br />
* [[EventWML]]<br />
* [[ReferenceWML]]<br />
<br />
<br />
[[Category: WML Reference]]</div>Queenkiller