Setting multiple objectives
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.
- malthaussen
- Posts: 37
- Joined: April 6th, 2024, 11:05 pm
Setting multiple objectives
I'd like to set multiple objectives which all must be met for a side's victory. eg, take cities a AND b, AND kill the enemy leader. It appears from what I've been looking at that all objectives are mutually exclusive, eg take city a OR b, OR kill the enemy leader. I want victory to happen when all three are true.
-- Mal
-- Mal
"Of two choices, I always take the third."
Re: Setting multiple objectives
Check all of these conditions before using [endlevel].
- malthaussen
- Posts: 37
- Joined: April 6th, 2024, 11:05 pm
Re: Setting multiple objectives
I don't suppose you'd care to unpack that a little. How do I perform these checks? Inside what event?
-- Mal
-- Mal
"Of two choices, I always take the third."
-
- Posts: 1285
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Setting multiple objectives
You can use die or last breath for when the enemy leader dies and capture for when a village is captured as triggers. Then when one of those things happens you just need to check if the other two conditions are met and if so [endlevel]. [have_unit] can test if the enemy leader is alive/dead. Checking for ownership of a village is left as an exercise for the reader (aka I don't know how to do that, but I'd start https://wiki.wesnoth.org/StandardLocationFilter and search for "owner")
Hint: https://wiki.wesnoth.org/InternalAction ... cations.5D
Hint: https://wiki.wesnoth.org/InternalAction ... cations.5D
Speak softly, and carry Doombringer.
- beetlenaut
- Developer
- Posts: 2829
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Setting multiple objectives
There is also [have_location]. Used with owner_side and x,y coordinates, that would check for village ownership.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- lhybrideur
- Posts: 377
- Joined: July 9th, 2019, 1:46 pm
Re: Setting multiple objectives
You can also use a variable and increment it each time one of the objective is completed or one for each objective, and check the value of the variable(s) to trigger [end_level]