[SOLVED] Multi-condition event: units alive x and after turn x
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
[SOLVED] Multi-condition event: units alive x and after turn x
my question is pretty simple probably but i found no solutions in wesnoth wiki so i'll ask here.
i want have a event that check 2 conditions at same time to give to side 2 gold if both is true at any turn after 11 in game, because i want a side that keep pressuring the player after the first wave is about to be defeated:
If side 2 amount of units alife is aquals/less than 6 only if turn is aquals/more than 12 give side 2, 100 gold amount (first_time_only=yes).
Note: it'll count the leader as unit too? just to know.
i want have a event that check 2 conditions at same time to give to side 2 gold if both is true at any turn after 11 in game, because i want a side that keep pressuring the player after the first wave is about to be defeated:
If side 2 amount of units alife is aquals/less than 6 only if turn is aquals/more than 12 give side 2, 100 gold amount (first_time_only=yes).
Note: it'll count the leader as unit too? just to know.
Last edited by Xindage on September 23rd, 2018, 5:51 pm, edited 1 time in total.
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Multi-condition event: units alive x and after turn x
The wiki is the wrong place to look. If you check, you'll probably find examples similar to what you need someplace the mainline scenario. What I see you asking for is how to encourage the player to win in 10 turns or less because, at 11 turns a new wave will arrive. And, yes, I'm pretty sure I've seen that. Just not sure where ATM. Basically, you want an event on turn 12 which checks the number of units on the map and, if fewer than 7, gives a gold boost to allow a couple more units to be recruited.
I forked real life and now I'm getting merge conflicts.
Re: Multi-condition event: units alive x and after turn x
That can be best done with [event] first_time_only=yes [filter_condtion]. Turn number is found in autostored variable and for unit count you can use [have_unit].
Re: Multi-condition event: units alive x and after turn x
Code: Select all
[event]
name=new turn
first_time_only=yes
[filter_condition]
[variable]
name=turn_number
greater_than=11
[/variable]
[have_unit]
side=2
count=0-6
# leader is also counted here
[/have_unit]
[/filter_condition]
[gold]
amount=100
side=2
[/gold]
[/event]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Multi-condition event: units alive x and after turn x
If you don't want to include the leader for counting you can add canrecruit=no to the filter above.
Try out the dark board theme.
Re: Multi-condition event: units alive x and after turn x
i have used a variable to make action to not repeat but something is not working, this tigger is working aways at the start of turn 1, what's happening?
Note: he's starting gold is 130 but he has 195 at starting of game... (130 + 65 from normal skill)
Edit: I noticed the "{VARIABLE reinforcements yes}" is in wrong place too.
Note: he's starting gold is 130 but he has 195 at starting of game... (130 + 65 from normal skill)
Code: Select all
# Make Ragan keep recruiting after the first wave is about to be defeat.
[event]
name = new turn
first_time_only = no
[if]
[variable]
name = reinforcements
equals = no
[/variable]
[then]
{VARIABLE reinforcements yes}
[filter_condition]
[variable]
name = turn_number
greater_than = 11
[/variable]
[have_unit]
side = 2
count = 0-7
# leader is also counted here
[/have_unit]
[/filter_condition]
[gold]
#ifdef EASY
amount = 40
#endif
#ifdef NORMAL
amount = 65
#endif
#ifdef HARD
amount = 80
#endif
side = 2
[/gold]
[/then]
[/if]
[/event]
Re: Multi-condition event: units alive x and after turn x
[filter_condition] shouldn't be a child of [then] but of [event], as Sapient showed. That's also why he didn't need an auxiliary variable. Didn't his example work for you?
Also you can use {QUANTITY amount 40 65 80} instead of ifdefs.
Also you can use {QUANTITY amount 40 65 80} instead of ifdefs.
Re: Multi-condition event: units alive x and after turn x
thanks josteph, and yes this time the event worked perfectly, thanks everyone for the support.