[event] name=capture,die

The place to post your WML questions and answers.

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.
Post Reply
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

[event] name=capture,die

Post by Helmet »

In Secrets of the Ancients, scenario 8, an event has a name key and two values separated by a comma: name=capture,die.

When I saw it, I thought...wow. TWO values? That's pretty cool.

Have you ever done something like this -- that is, use two or more values in an event? What did your event do? Do you know any other scenarios that have done this?

One of the goals of my campaign is to pack it with nifty examples of code, that way it will be my own personal reference manual. I'm trying to think of a way to utilize this nifty feature in my campaign. Any suggestions?

Thanks.
vghetto
Posts: 398
Joined: November 2nd, 2019, 5:12 pm

Re: [event] name=capture,die

Post by vghetto »

You'll find many examples of it in the mainline campaigns. Another common one is name=recruit,recall or name=sighted,moveto and the ones that trigger at specific turns like name=turn 4,turn 8,turn 12 or on sides turn name=side 2 turn refresh,side 3 turn refresh
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: [event] name=capture,die

Post by Helmet »

vghetto wrote: December 6th, 2020, 5:45 pm You'll find many examples of it in the mainline campaigns. Another common one is name=recruit,recall or name=sighted,moveto and the ones that trigger at specific turns like name=turn 4,turn 8,turn 12 or on sides turn name=side 2 turn refresh,side 3 turn refresh
I guess I've been overlooking that detail when checking-out mainline code, until now.

Those are extremely useful examples, vghetto. Thanks
Shiki
Developer
Posts: 317
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: [event] name=capture,die

Post by Shiki »

On the first sight's it's an easy way to write one event instead of two.

But the special part is that it will fire only once – so it offers a way for dialogues, which should fire in one of the two cases, but not twice.
Try out the dark board theme.
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: [event] name=capture,die

Post by Helmet »

Shiki wrote: December 7th, 2020, 10:12 am On the first sight's it's an easy way to write one event instead of two.

But the special part is that it will fire only once – so it offers a way for dialogues, which should fire in one of the two cases, but not twice.
That sounds extremely useful, but I'm having a difficult time imagining how to do it. Would you post a code snippet?
User avatar
WhiteWolf
Forum Moderator
Posts: 739
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: [event] name=capture,die

Post by WhiteWolf »

Helmet wrote: December 7th, 2020, 1:36 pm Would you post a code snippet?
An orc leader gets mad the first time a miss happens in combat, by either combatant on any side.

Code: Select all

[event]
    name=attacker misses, defender misses
    
    [message]
        speaker=ORC
        message= _ "Ha, you know nothing about combat, neither of you! You don't know how to hit each other? Arr, this is not a fight you're doing! I'll show you how a fight is done once I get there! *incomprehensible orc noises*"
    [/message]
[/event]
For example :D
Author of the Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: [event] name=capture,die

Post by Helmet »

WhiteWolf wrote: December 7th, 2020, 1:56 pm For example :D
Ah! Thank you.
Post Reply