Trigger message on attack during certain range of turns
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.
Trigger message on attack during certain range of turns
I mentioned in another thread that I had a scenario where every time someone attacks the character they insult a campaign.
I've been trying to get it to work, but I'm having difficulty. I have a variety of insults, and want them to fire in different ranges of turns.
I have this code:
If I get rid of the condition on the turn number, it works just fine:
Any suggestions on how to incorporate the turn condition?
I've been trying to get it to work, but I'm having difficulty. I have a variety of insults, and want them to fire in different ranges of turns.
I have this code:
Code: Select all
[event]
name=attack
[filter]
side=2
[/filter]
[if]
[variable]
name=turn_number
greater_than=3
[/variable]
[then]
[message]
speaker=unit
message = _ "I hated A Fiery Birth. Boring, so boring. Boring characters, boring battles, boring maps. Why did you even bother making this? I just wasted five hours of my life on it."
[/message]
[/then]
[/if]
[/event]
Code: Select all
[event]
name=attack
[filter]
side=2
[/filter]
[message]
speaker=unit
message = _ "I hated A Fiery Birth. Boring, so boring. Boring characters, boring battles, boring maps. Why did you even bother making this? I just wasted five hours of my life on it."
[/message]
[/event]
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die | Loyalist Campaign: Wesnoth Creepypasta
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Trigger message on attack during certain range of turns
Where's your first_time_only?
Speak softly, and carry Doombringer.
Re: Trigger message on attack during certain range of turns
I was under the impression that 'first_time_only' was set to 'yes' by default, which is what I want here. My issue is that it's not firing at all.
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die | Loyalist Campaign: Wesnoth Creepypasta
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Trigger message on attack during certain range of turns
turn_number is not a filter, so it runs once on turn 1 and then never again.
Speak softly, and carry Doombringer.
Re: Trigger message on attack during certain range of turns
Thank you, that explains everything. Thanks for your help! I may ask again if I can't figure out how to get it to only fire once later on.
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die | Loyalist Campaign: Wesnoth Creepypasta
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Trigger message on attack during certain range of turns
You could
Spoiler:
Speak softly, and carry Doombringer.
Re: Trigger message on attack during certain range of turns
Thanks! This is working great now, thanks to you.
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die | Loyalist Campaign: Wesnoth Creepypasta