Quantcast
Channel: The Battle for Wesnoth Forums
Viewing all articles
Browse latest Browse all 1984

WML Workshop • Re: How do I bring AI factions to recruit only every 3rd turn?

$
0
0
There is something a bit like this in Son of the Black Eye: Saving Inarix.
The AI stops recruiting once the gold falls below a certain amount (until turn 8).
Here is the code for the event:

Code:

    [event]        name=recruit        first_time_only=no        [filter]            side=2,3        [/filter]        [store_side]            side=$unit.side        [/store_side]        [if]            [variable]                name=side.gold                {QUANTITY less_than 300 350 400}  # Starting gold is +100 per difficulty level, so this is correct in this order            [/variable]            [variable]                name=turn_number                less_than=8            [/variable]            [then]                [disallow_recruit]                    side=$unit.side                    type=$side.recruit                [/disallow_recruit]            [/then]        [/if]        {CLEAR_VARIABLE side}    [/event]    
For turn 8 there is a "re-allow recruit" event:

Code:

    [event]        name=side 2 turn 8        [message]            speaker=Thelarion            message= _ "This isn’t working. Mobilize all our troops and send these creatures back to hell."        [/message]        [message]            speaker=Darstang            message= _ "It won’t be said that Elves were braver than us, everyone attack!"        [/message]        [allow_recruit]            side=2            type=Elvish Fighter, Elvish Archer, Elvish Shaman, Elvish Scout        [/allow_recruit]        [allow_recruit]            side=3            type=Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Scout, Footpad, Bandit        [/allow_recruit]    [/event]
If you slightly edit these events, then you can make the AI recruit only on certain turns, or once it has stockpiled a certain amount of gold.

-

Statistics: Posted by tsunami_ — Today, 10:07 am



Viewing all articles
Browse latest Browse all 1984

Trending Articles