Skip to content

Commit

Permalink
NR S2: fix filters for Micor AIs
Browse files Browse the repository at this point in the history
and allows L2 recruits if the dwarves are under attack in late game.

[ci skip]
  • Loading branch information
sevu committed May 15, 2018
1 parent 2667cc2 commit f4f6f5b
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions data/campaigns/Northern_Rebirth/scenarios/02_01_Infested_Caves.cfg
Expand Up @@ -768,14 +768,30 @@

[gold]
side=4
amount=200
amount=220
[/gold]
[modify_side]
[filter_side]
side=4
[/filter_side]
income=12
[/modify_side]
[if]
[variable]
name=turn_unmer
greater_than=30
[/variable]
[then]
[allow_recruit]
side=4
type=Dwarvish Steelclad,Dwarvish Stalwart,Dwarvish Pathfinder
[/allow_recruit]
[disallow_recruit]
side=4
type=Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Scout
[/disallow_recruit]
[/then]
[/if]
[/event]

# This unit should only defend this location and not join the counterattack
Expand All @@ -800,7 +816,9 @@
ai_type=return_guardian
action=add
[filter]
upkeep=loyal
[filter_wml]
upkeep=loyal
[/filter_wml]
type=Dwarvish Fighter
[/filter]
return_x,return_y=27,28
Expand All @@ -817,7 +835,9 @@
ai_type=return_guardian
action=add
[filter]
upkeep=loyal
[filter_wml]
upkeep=loyal
[/filter_wml]
type=Skeleton Archer
[/filter]
return_x,return_y=24,2
Expand Down

7 comments on commit f4f6f5b

@CelticMinstrel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If upkeep=loyal doesn't work, that's probably a bug; but why not trait=loyal instead of using [filter_wml]?

@sevu
Copy link
Member Author

@sevu sevu commented on f4f6f5b May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a better filter.
upkeep itself does not work because it's not a SUF.

@sevu
Copy link
Member Author

@sevu sevu commented on f4f6f5b May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, the units are created with the {NO_UPKEEP} macro and don't get the loyal trait.
https://github.com/wesnoth/wesnoth/blob/1.14/data/core/macros/unit-utils.cfg#L175

@CelticMinstrel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, oh well. (But it clearly is a SUF?)

@sevu
Copy link
Member Author

@sevu sevu commented on f4f6f5b May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not listed here: https://wiki.wesnoth.org/StandardUnitFilter (Yes, I thought first it would work too) Basically one can filter everything which :inspect shows if using [filter_wml] inside.

@CelticMinstrel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess no-one thought of adding support for it, that's all. We should add it on 1.15 then.

@sevu
Copy link
Member Author

@sevu sevu commented on f4f6f5b Oct 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.