Patrols MAI scenario: add a second Micro AI type (zone guardian) to Side 2
This demonstrates how to set up several MAIs for the same side.
This commit is contained in:
parent
8dc3bed61f
commit
3b3b16ce55
1 changed files with 37 additions and 3 deletions
|
@ -42,7 +42,20 @@
|
|||
gold=0
|
||||
income=-2
|
||||
|
||||
{MICRO_AI_PATROL}
|
||||
[ai]
|
||||
version=10710
|
||||
[engine]
|
||||
name="lua"
|
||||
code= <<
|
||||
local ai = ...
|
||||
local engine = {}
|
||||
engine = wesnoth.require("ai/micro_ais/ais/mai_patrol_engine.lua").init(ai, engine)
|
||||
engine = wesnoth.require("ai/micro_ais/ais/mai_guardian_engine.lua").init(ai, engine)
|
||||
return engine
|
||||
>>
|
||||
[/engine]
|
||||
{RCA_STAGE}
|
||||
[/ai]
|
||||
[/side]
|
||||
|
||||
# Urudin's side
|
||||
|
@ -152,6 +165,26 @@
|
|||
attack=xxxx # don't attack anybody
|
||||
[/micro_ai]
|
||||
|
||||
[unit]
|
||||
type=Javelineer
|
||||
side=2
|
||||
id=guard1
|
||||
random_traits=no
|
||||
x,y=25,27
|
||||
[/unit]
|
||||
|
||||
[micro_ai]
|
||||
side=2
|
||||
ai_type=guardian_unit
|
||||
action=add
|
||||
|
||||
guardian_type=zone_guardian
|
||||
id=guard1
|
||||
[filter_location]
|
||||
x,y=10-26,26-28
|
||||
[/filter_location]
|
||||
[/micro_ai]
|
||||
|
||||
{PLACE_IMAGE "scenery/signpost.png" 11 4}
|
||||
{SET_LABEL 11 4 _"End Scenario"}
|
||||
|
||||
|
@ -184,15 +217,16 @@
|
|||
|
||||
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 same [micro_ai] tag."}
|
||||
All of this is implemented by use of the Patrol [micro_ai] tag."}
|
||||
# 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.
|
||||
|
||||
This is an AI separate from the Patrols of Side 2."}
|
||||
|
||||
# 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 all instructed to behave differently when facing enemy units:
|
||||
{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:
|
||||
|
||||
Konrad only attacks Gertburt, or any enemy unit that blocks his final waypoint.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue