Checking WML for non-dying breath
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.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Checking WML for non-dying breath
I have a buncha work to do before Fate of a Princess is playable again, and my WML is very rusty.
I wanted to check whether the following code is reasonable:
Quite simply, I'm bored with leaders only talking when they die - so this fellow is supposed to say
'you can't kill me' the first time his hit points are dropped below 25 by an incoming attack.
Have I got it right?
Thanks
I wanted to check whether the following code is reasonable:
Quite simply, I'm bored with leaders only talking when they die - so this fellow is supposed to say
'you can't kill me' the first time his hit points are dropped below 25 by an incoming attack.
Have I got it right?
Thanks
Code: Select all
[set_variable]
name=troll_warrior_harmed
value=no
[/set_variable]
...
[event]
name=attack end
first_time_only=no
[filter_second]
id=Troll Warrior
[variable]
name=$second_unit.hitpoints
less_than=25
[/variable]
[variable]
name=troll_warrior_harmed
equals=no
[/variable]
[/filter_second]
[message]
speaker=Troll Warrior
message= _ "Puny damage not kill me!"
[/message]
[set_variable]
name=troll_warrior_harmed
equals=yes
[/set_variable]
[/event]
- Pentarctagon
- Project Manager
- Posts: 5533
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Checking WML for non-dying breath
name=$second_unit.hitpoints
shouldn't have a dollar sign.99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Checking WML for non-dying breath
Some conditions in [filter_second] need to be in [filter_condition] instead. Also, if troll_warrior_harmed is only about the message, you can just use first_time_only=yes.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Re: Checking WML for non-dying breath
Thank you very much. I'll apply the fixes and report back later. Might be a while though
- Celtic_Minstrel
- Developer
- Posts: 2166
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Checking WML for non-dying breath
That's possibly not true. If it's a single scenario, you'd be right, but if the intent is for the message to appear once in the entire campaign, you'll definitely need a variable.
Re: Checking WML for non-dying breath
Possible, but this message sounds like it is intended for specific fight and therefore would be scenario event.