MAI test scenarios: remove uses of deprecated MESSAGE macro

(cherry-picked from commit 5e5a9e69e5)
This commit is contained in:
mattsc 2018-05-13 15:27:15 -07:00
parent ece2a6092f
commit c98fad3791
18 changed files with 450 additions and 120 deletions

View file

@ -213,9 +213,13 @@
message= _ "There are too many to fight, far too many. We must escape!"
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
{PLACE_IMAGE "scenery/signpost.png" 1 1}

View file

@ -218,7 +218,11 @@
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -335,14 +339,27 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "Important Note" _"<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."}
[message]
speaker=narrator
image=wesnoth-icon.png
caption="Important Note"
message= _ "<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."
[/message]
# wmlindent: start ignoring
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
"+{ANIMAL_AI_DESCRIPTIONS1}}
"+{ANIMAL_AI_DESCRIPTIONS1}
[/message]
# wmlindent: stop ignoring
{MESSAGE narrator "wesnoth-icon.png" "" {ANIMAL_AI_DESCRIPTIONS2}}
[message]
speaker=narrator
image=wesnoth-icon.png
message={ANIMAL_AI_DESCRIPTIONS2}
[/message]
[message]
speaker=narrator
@ -410,8 +427,11 @@ Also note: The Animal AIs are coded as Micro AIs. A Micro AI can be added and ad
[/filter_second]
# wmlindent: start ignoring
{MESSAGE $second_unit.id "" "" _"Yowl!
Translation: Those Ogres are mean! We better stay away from them and their young."}
[message]
speaker=$second_unit.id
message= _ "Yowl!
Translation: Those Ogres are mean! We better stay away from them and their young."
[/message]
# wmlindent: stop ignoring
[micro_ai]

View file

@ -82,14 +82,24 @@
[event]
name=start
{MESSAGE LuaAI "" "" _"All right, chaps. Those orcs need to be stopped."}
[message]
speaker=LuaAI
message= _ "All right, chaps. Those orcs need to be stopped."
[/message]
{STORE_UNIT_VAR (id=Big Bad Orc) profile profile}
{MESSAGE (Big Bad Orc) "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Big Bad Orc
image=$profile~FL()~RIGHT()
message= _ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE LuaAI "" "" _"We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
[message]
speaker=LuaAI
message= _ "We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
# wmllint: local spellings AIs RCA
@ -148,7 +158,10 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
side=1
[/have_unit]
[then]
{MESSAGE LuaAI "" "" _"I may have fallen, but we will continue to defend the pass to the last man!"}
[message]
speaker=LuaAI
message= _ "I may have fallen, but we will continue to defend the pass to the last man!"
[/message]
[/then]
[/if]
[/event]
@ -181,7 +194,11 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory

View file

@ -78,10 +78,15 @@
name=start
{STORE_UNIT_VAR (id=Dreadful Bat) profile profile}
{MESSAGE (Dreadful Bat) "" "" _"Be careful to stay out of the way of that dragon. He's a mean one."}
[message]
speaker=Dreadful Bat
message= _ "Be careful to stay out of the way of that dragon. He's a mean one."
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE Rowck "" "" _"Hi there. I am Rowck and here is what I do:
[message]
speaker=Rowck
message= _ "Hi there. I am Rowck and here is what I do:
When hungry, I move around part of the map in a random wander until I get into range of an enemy. If enemies are within range, I attack and devour the weakest of them. After that, I retreat to my rest location, where I stay for a certain number of turns or until fully healed.
A few details (features, not bugs, but can be changed if desired):
- If my way home is blocked on the return, the normal RCA AI takes over my behavior.
@ -89,7 +94,8 @@ A few details (features, not bugs, but can be changed if desired):
- A kill only makes me go home when I am the attacker, not as defender.
- Occasionally I will not move at all while wandering (a dragon has to rest sometimes!)
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -136,7 +142,10 @@ Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted
[event]
name=end_scenario
{MESSAGE (Dreadful Bat) "" "" _"I'm out of here."}
[message]
speaker=Dreadful Bat
message= _ "I'm out of here."
[/message]
[endlevel]
result=victory

View file

@ -61,8 +61,12 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
There is nothing to do here, just watch or use this scenario as a template or for your own tests."}
There is nothing to do here, just watch or use this scenario as a template or for your own tests."
[/message]
[/event]
[/test]

View file

@ -391,7 +391,11 @@
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -407,14 +411,17 @@
[event]
name=start
#{MESSAGE narrator "wesnoth-icon.png" "" _"Text"}
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
The player controls Side 1. There are right-click context menu options for adding Side 1 units to the map and for taking them off again. This is useful mostly for testing how the Side 3 guardians react.
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -472,10 +479,18 @@ Note: This is a demonstration of how the Goto Micro AI can be used to code guard
name=side 8 turn
{UNIT 8 Ghost 29 1 id=ghost1}
{MESSAGE ghost1 "" "" _"Aaiiieeeeeee !!!"}
{MESSAGE messenger2 "" "" _"O no, a ghost!"}
{MESSAGE messenger1 "" "" _"Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."}
[message]
speaker=ghost1
message= _ "Aaiiieeeeeee !!!"
[/message]
[message]
speaker=messenger2
message= _ "O no, a ghost!"
[/message]
[message]
speaker=messenger1
message= _ "Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."
[/message]
[event]
name=side 8 turn
first_time_only=no

View file

@ -428,7 +428,12 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/dwarves/guard.png" _"Standard WML Guardian" _"This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."}
[message]
speaker=narrator
image=portraits/dwarves/guard.png
caption= _ "Standard WML Guardian"
message= _ "This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -439,12 +444,17 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/trolls/troll.png" _"Return Guardian" _"A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption= _ "Return Guardian"
message= _ "A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
- If at GP with no enemy in reach, do nothing.
- If at GP with enemy in reach, leave attack to default AI (note that this may include not attacking if the enemy is deemed too strong).
- If not at GP, return there, no matter whether an enemy is in reach or not.
- If enemies are blocking your way back, do your best to get there anyway.
- If you end up next to an enemy on the way back, attack after the move."}
- If you end up next to an enemy on the way back, attack after the move."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -455,8 +465,13 @@ separate attack Zone"
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/trolls/troll.png" _"Home Guard" _"A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."}
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption= _ "Home Guard"
message= _ "A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -467,13 +482,18 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/undead/archer.png" _"Stationed Guardian" _"A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
[message]
speaker=narrator
image=portraits/undead/archer.png
caption= _ "Stationed Guardian"
message= _ "A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
- If no enemy is within 'distance' of the guard's current position, do nothing.
- Otherwise: If an enemy is within 'distance' of the guard, but not also within the same distance of the guarded location and the station (all of this simultaneously), move the guard in the direction of the station.
- Otherwise:
- Pick the enemy unit that is closest to the guarded location.
- If we can reach it, pick the adjacent hex with the highest defense rating and attack from there.
- If not in reach, move toward this unit."}
- If not in reach, move toward this unit."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -484,11 +504,16 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "units/monsters/giant-rat.png" _"Coward" _"Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
[message]
speaker=narrator
image=units/monsters/giant-rat.png
caption= _ "Coward"
message= _ "Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
- If neither is given, the coward retreats to the position farthest away from the approaching enemies.
- If 'seek' is given, it preferentially goes toward that location (but getting away from enemies takes priority).
- If 'avoid' is given, it in addition tries to avoid that location (with both maximizing distance from enemies and going toward 'seek' taking priority).
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."}
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -499,9 +524,14 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{VARIABLE_CONDITIONAL scenario_name equals guardians}
[/show_if]
[command]
{MESSAGE narrator "portraits/nagas/fighter.png" _"Zone Guardian" _"A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
[message]
speaker=narrator
image=portraits/nagas/fighter.png
caption= _ "Zone Guardian"
message= _ "A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
- If not specified, the zone guard attacks any enemy coming inside its guard zone.
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."}
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -510,14 +540,25 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
name=start
{STORE_UNIT_VAR id=Kraa profile profile}
{MESSAGE Kraa "$profile~FL()~RIGHT()" "" _"Kraahhh!!!!"}
{MESSAGE (Another Bad Orc) "" "" _"They there! We them get!"}
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message= _ "Kraahhh!!!!"
[/message]
[message]
speaker=Another Bad Orc
message= _ "They there! We them get!"
[/message]
# wmllint: unbalanced-on
{MESSAGE Kraa "$profile~FL()~RIGHT()" "" _"Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message= _ "Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
Note to the player: the right-click context menu provides information about each of the units' behavior.
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
@ -591,7 +632,10 @@ Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be
[event]
name=end_scenario
{MESSAGE Kraa "" "" _"Gryphons of the High Plains, it is time to return to said plains. Follow me."}
[message]
speaker=Kraa
message= _ "Gryphons of the High Plains, it is time to return to said plains. Follow me."
[/message]
[endlevel]
result=victory

View file

@ -113,9 +113,12 @@
name=start
# wmllint: unbalanced-on
{MESSAGE (Good Bandit) "" "" _"That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
[message]
speaker=Good Bandit
message= _ "That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -141,7 +144,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
id=Bad Outlaw
[/filter]
{MESSAGE (Good Bandit) "" "" _"We got him! Now whatever it is we are fighting for is safe."}
[message]
speaker=Good Bandit
message= _ "We got him! Now whatever it is we are fighting for is safe."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -165,7 +171,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
x,y=36,19
[/filter]
{MESSAGE (Bad Outlaw) "" "" _"I made it! Now we can keep fighting for whatever it is that we are fighting for."}
[message]
speaker=Bad Outlaw
message= _ "I made it! Now we can keep fighting for whatever it is that we are fighting for."
[/message]
[endlevel]
result=defeat
[/endlevel]

View file

@ -76,11 +76,14 @@
name=start
# wmllint: unbalanced-on
{MESSAGE Rebels1 "" "" _"In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
[message]
speaker=Rebels1
message= _ "In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
For clarity, each healer announces her upcoming support move. If you don't want to see that each time, just hit 'esc' when it happens the first time.
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -92,7 +95,10 @@ Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and
canrecruit=yes
[/filter]
{MESSAGE $unit.id "" "" _"Argh! They got us..."}
[message]
speaker=$unit.id
message= _ "Argh! They got us..."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -447,12 +447,17 @@
[event]
name=start
{MESSAGE Pekzs "" "" _"In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
[message]
speaker=Pekzs
message= _ "In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."}
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."
[/message]
# wmllint: unbalanced-on
{MESSAGE Pekzs "" "" _"Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
[message]
speaker=Pekzs
message= _ "Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
Side 2 (blue): saurians attacking only from swamp. If no enemy is in range, they do not move.
@ -460,13 +465,19 @@ Side 3 (green): saurians attacking only from swamp. If no enemy is in range, the
Side 4 (purple): nagas wandering only on water terrain, but attacking from both water and swamp.
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."}
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."
[/message]
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You can use the right-click context menu to add additional lurkers.
[message]
speaker=narrator
image="wesnoth-icon.png"
caption= _ "Notes"
message= _ "You can use the right-click context menu to add additional lurkers.
Any unit not adjacent to swamp (and water, for the nagas) is safe from the lurkers, thus it is easy to keep Pekzs from being attacked.
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -530,7 +541,10 @@ The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to
[event]
name=end_scenario
{MESSAGE Pekzs "" "" _"Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."}
[message]
speaker=Pekzs
message= _ "Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."
[/message]
[endlevel]
result=victory

View file

@ -132,17 +132,29 @@
name=start
{STORE_UNIT_VAR id=Vanak profile profile}
{MESSAGE Vanak "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Vanak
image=$profile~FL()~RIGHT()
message= _ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE messenger "" "" _"Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."}
[message]
speaker=messenger
message= _ "Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
Note that the messenger route is set up through a series of waypoints here simply to demonstrate how to use waypoints. On this map, using only a single waypoint at the end of the route would work just as well (or probably even better).
Also note that the messenger does not have to get exactly to each signpost (except for the last one), getting close is good enough.
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -170,7 +182,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
x,y=28,1
[/filter]
{MESSAGE messenger "" "" _"I made it! Now our people will be safe."}
[message]
speaker=messenger
message= _ "I made it! Now our people will be safe."
[/message]
[endlevel]
result=defeat
[/endlevel]
@ -182,7 +197,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
[filter]
id=messenger
[/filter]
{MESSAGE messenger "" "" _"Nooo! All is lost. We will never stop the orcs now!"}
[message]
speaker=messenger
message= _ "Nooo! All is lost. We will never stop the orcs now!"
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -201,20 +201,34 @@
{STORE_UNIT_VAR id=Konrad profile profile}
# wmllint: unbalanced-on
{MESSAGE Konrad "$profile~FL()~RIGHT()" "" _"Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
[message]
speaker=Konrad
image=$profile~FL()~RIGHT()
message= _ "Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
I am heading for the keep east of the central mountain via a couple waypoints in the south. I will stay there once I get there. By contrast, those two fellas in the center are perpetually circling the mountain, one of them always in the same direction, the other changing directions after every lap.
All of this is implemented by use of the Patrol [micro_ai] tag."}
All of this is implemented by use of the Patrol [micro_ai] tag."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
{MESSAGE guard1 "" "" _"By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
{MESSAGE Urudin "" "" _"And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
[message]
speaker=guard1
message= _ "By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
[/message]
[message]
speaker=Urudin
message= _ "And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
This is an AI separate from the Patrols of Side 2."}
This is an AI separate from the Patrols of Side 2."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
Konrad only attacks Gertburt, or any enemy unit that blocks his final waypoint.
@ -224,7 +238,8 @@ The Longbowman attacks any enemy unit he ends up next to at the end of his move.
They all have in common, however, that getting to their next waypoint takes priority over attacking. They will thus prefer to move around enemies rather than straight for them. Also, if a waypoint is occupied by a unit they are not instructed to attack, they will (eventually) abandon that waypoint once they get close enough and move on to the next one.
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -253,7 +268,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
x,y=25,15
[/filter]
{MESSAGE Konrad "" "" _"Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."}
[message]
speaker=Konrad
message= _ "Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."
[/message]
[/event]
# The events finishing the scenario
@ -294,7 +312,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
[event]
name=end_scenario
{MESSAGE Gertburt "" "" _"Let's go home, chaps."}
[message]
speaker=Gertburt
message= _ "Let's go home, chaps."
[/message]
[endlevel]
result=victory

View file

@ -124,11 +124,24 @@
name=start
{STORE_UNIT_VAR id=Koorzhar profile profile}
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"There's that traitor wizard. Let's get him."}
[message]
speaker=Koorzhar
image="$profile~FL()~RIGHT()"
message= _ "There's that traitor wizard. Let's get him."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."}
{MESSAGE Rossauba "" "" _"That's very kind of you, but ..."}
{MESSAGE Langzhar "" "" _"No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."}
[message]
speaker=Langzhar
message= _ "Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."
[/message]
[message]
speaker=Rossauba
message= _ "That's very kind of you, but ..."
[/message]
[message]
speaker=Langzhar
message= _ "No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."
[/message]
[message]
speaker=narrator
@ -213,7 +226,11 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
id=Rossauba
[/filter]
{MESSAGE Rossauba "" "" _"I held out for as long as I could."}
[message]
speaker=Rossauba
message= _ "I held out for as long as I could."
[/message]
[fire_event]
name=end_scenario
[/fire_event]
@ -227,7 +244,10 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
x,y=1,1
[/filter]
{MESSAGE Rossauba "" "" _"I made it"}
[message]
speaker=Rossauba
message= _ "I made it"
[/message]
[fire_event]
name=end_scenario

View file

@ -82,16 +82,28 @@
name=start
{STORE_UNIT_VAR id=Koorzhar profile profile}
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"This is a very simple scenario that can be used to test out different recruiting patterns."}
[message]
speaker=Koorzhar
image=$profile~FL()~RIGHT()
message= _ "This is a very simple scenario that can be used to test out different recruiting patterns."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."}
[message]
speaker=Langzhar
message= _ "Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "Notes" _"If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
[message]
speaker=narrator
image=wesnoth-icon.png
caption= _ "Notes"
message= _ "If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
Side 2 uses the Rush Recruitment Micro AI (which is also used in the Experimental AI).
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -108,7 +120,11 @@ A Micro AI can be added and adapted to the need of a scenario easily using only
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -106,7 +106,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Bottleneck Defense Micro AI Demo" _"In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."}
[message]
speaker=Grnk
caption= _ "Bottleneck Defense Micro AI Demo"
message= _ "In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."
[/message]
[/command]
[/set_menu_item]
@ -121,7 +125,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Swamp Lurker Micro AI demo" _"Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."}
[message]
speaker=Grnk
caption= _ "Swamp Lurker Micro AI demo"
message= _ "Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."
[/message]
[/command]
[/set_menu_item]
@ -136,7 +144,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Guardian Micro AI demo" _"In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."}
[message]
speaker=Grnk
caption= _ "Guardian Micro AI demo"
message= _ "In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."
[/message]
[/command]
[/set_menu_item]
@ -151,7 +163,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Patrol Micro AI demo" _"'Patrols' contains AI modifications for units following patrol routes."}
[message]
speaker=Grnk
caption= _ "Patrol Micro AI demo"
message= _ "'Patrols' contains AI modifications for units following patrol routes."
[/message]
[/command]
[/set_menu_item]
@ -166,7 +182,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Recruiting Tests Micro AI demo" _"A simple scenario set up for the sole purpose of testing different recruiting patterns."}
[message]
speaker=Grnk
caption= _ "Recruiting Tests Micro AI demo"
message= _ "A simple scenario set up for the sole purpose of testing different recruiting patterns."
[/message]
[/command]
[/set_menu_item]
@ -181,7 +201,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Protect Unit Micro AI Demo" _"This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."}
[message]
speaker=Grnk
caption= _ "Protect Unit Micro AI Demo"
message= _ "This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."
[/message]
[/command]
[/set_menu_item]
@ -197,7 +221,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"HttT: The Elves Besieged Micro AI demo" _"This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."}
[message]
speaker=Grnk
caption= _ "HttT: The Elves Besieged Micro AI demo"
message= _ "This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."
[/message]
[/command]
[/set_menu_item]
@ -212,7 +240,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Messenger Escort Micro AI demo" _"'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."}
[message]
speaker=Grnk
caption= _ "Messenger Escort Micro AI demo"
message= _ "'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."
[/message]
[/command]
[/set_menu_item]
@ -227,7 +259,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Animals Micro AI demo" _"This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."}
[message]
speaker=Grnk
caption= _ "Animals Micro AI demo"
message= _ "This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."
[/message]
[/command]
[/set_menu_item]
@ -242,7 +278,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Wolves Micro AI demo" _"Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."}
[message]
speaker=Grnk
caption= _ "Wolves Micro AI demo"
message= _ "Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."
[/message]
[/command]
[/set_menu_item]
@ -257,7 +297,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Swarm Micro AI demo" _"This scenario features bats moving around semi-randomly in a swarm."}
[message]
speaker=Grnk
caption= _ "Swarm Micro AI demo"
message= _ "This scenario features bats moving around semi-randomly in a swarm."
[/message]
[/command]
[/set_menu_item]
@ -272,7 +316,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Dragon Micro AI demo" _"This scenario features a fire dragon displaying a hunt-and-rest behavior."}
[message]
speaker=Grnk
caption= _ "Dragon Micro AI demo"
message= _ "This scenario features a fire dragon displaying a hunt-and-rest behavior."
[/message]
[/command]
[/set_menu_item]
@ -287,7 +335,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Healer Support Micro AI demo" _"This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."}
[message]
speaker=Grnk
caption= _ "Healer Support Micro AI demo"
message= _ "This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."
[/message]
[/command]
[/set_menu_item]
@ -302,7 +354,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Goto Micro AI demo" _"This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."}
[message]
speaker=Grnk
caption= _ "Goto Micro AI demo"
message= _ "This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."
[/message]
[/command]
[/set_menu_item]
@ -317,7 +373,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Combined Hang Out and Messenger Escort Micro AI demo" _"This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."}
[message]
speaker=Grnk
caption= _ "Combined Hang Out and Messenger Escort Micro AI demo"
message= _ "This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."
[/message]
[/command]
[/set_menu_item]
@ -332,7 +392,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Simple Attack Micro AI demo" _"This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."}
[message]
speaker=Grnk
caption= _ "Simple Attack Micro AI demo"
message= _ "This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."
[/message]
[/command]
[/set_menu_item]
@ -347,7 +411,11 @@
{VARIABLE_CONDITIONAL scenario_name equals micro_ai_test}
[/show_if]
[command]
{MESSAGE Grnk "" _"Fast Micro AI demo" _"A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."}
[message]
speaker=Grnk
caption= _ "Fast Micro AI demo"
message= _ "A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -357,9 +425,12 @@
{SCROLL_TO 13 11}
{MESSAGE Grnk "" "" _"Move me to any of the signposts to go to a Micro AI demonstration.
[message]
speaker=Grnk
message= _ "Move me to any of the signposts to go to a Micro AI demonstration.
Information about each demonstration can be accessed by right-clicking on the respective signpost."}
Information about each demonstration can be accessed by right-clicking on the respective signpost."
[/message]
[objectives]
[objective]

View file

@ -120,10 +120,16 @@
{SCROLL_TO 11 9}
{MESSAGE sergeant "" "" _"General Grospur, what do we do? These undead will surely wipe us out."}
{MESSAGE Grospur "" "" _"Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
[message]
speaker=sergeant
message= _ "General Grospur, what do we do? These undead will surely wipe us out."
[/message]
[message]
speaker=Grospur
message= _ "Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"}
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"
[/message]
[objectives]
summary= _ "Watch the undead take care of business"
@ -161,10 +167,16 @@
lua_function = "close_to_advancing"
[/filter_second]
{MESSAGE $second_unit.id "" "" _"What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"}
{MESSAGE Uralt "" "" _"Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
[message]
speaker=$second_unit.id
message= _ "What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"
[/message]
[message]
speaker=Uralt
message= _ "Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"}
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"
[/message]
[/event]
# Put more undead out there when less than 25 left
@ -178,7 +190,10 @@
count=0-24
[/have_unit]
[then]
{MESSAGE Uralt "" "" _"Rise, minions!"}
[message]
speaker=Uralt
message= _ "Rise, minions!"
[/message]
{SCATTER_UNITS 6 "Soulless" 1 (x,y=5-9,1-15) (side=2)}
{SCATTER_UNITS 3 "Skeleton,Skeleton Archer" 1 (x,y=5-9,1-15) (side=2)}
[/then]
@ -221,7 +236,10 @@
controller=human
[/modify_side]
{MESSAGE Uralt "" "" _"And that's how the undead AI executes total annihilation ..."}
[message]
speaker=Uralt
message= _ "And that's how the undead AI executes total annihilation ..."
[/message]
[endlevel]
result=victory

View file

@ -69,7 +69,11 @@
{VARIABLE_CONDITIONAL scenario_name equals swarm}
[/show_if]
[command]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -134,11 +138,15 @@
name=start
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
The player controls a side of gryphons, each of which is given 99 moves so that the reaction of the swarm to enemies can be tested easily. There are also several right-click options, for example for adding bats or gryphons or for taking units off the map.
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -174,7 +182,11 @@ Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted t
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]

View file

@ -98,7 +98,11 @@
{VARIABLE_CONDITIONAL scenario_name equals wolves}
[/show_if]
[command]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -185,11 +189,15 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
Second, wolves do not actively hunt here. For the most part they just wander (often long distance). However, the pack ferociously (and without regard for its own health) attacks any enemy units that come into range, as long as that does not mean separating the pack by more than a few hexes. Staying together, or joining with a new wolf assigned to the pack, is the only thing that takes priority over satisfying the wolves' thirst for blood.
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."}
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."
[/message]
[message]
speaker=narrator
@ -259,7 +267,11 @@ Also note that the wolves AI is coded as a Micro AI. A Micro AI can be added and
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]