Victory objective: defeating all enemy units
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.
- SpookyTree
- Posts: 1
- Joined: June 6th, 2015, 11:21 pm
Victory objective: defeating all enemy units
Hi all, first post
I'm working on a scenario for a campaign where the objective is kill all enemy units (wolves and other critters and such). The enemy has no leader and all of the units that need to be killed are placed on the map in the prestart event. The scenario runs properly but when I run through the scenario and kill all of the units the victory event doesn't fire. My event code is
The enemy (side 2) doesn't have a leader. My side code is
Any assistance is appreciated. Thanks in advance!
I'm working on a scenario for a campaign where the objective is kill all enemy units (wolves and other critters and such). The enemy has no leader and all of the units that need to be killed are placed on the map in the prestart event. The scenario runs properly but when I run through the scenario and kill all of the units the victory event doesn't fire. My event code is
Code: Select all
[event]
name=die
[filter]
side=2
[/filter]
[if]
[not]
[have_unit]
side=2
[/have_unit]
[then]
[endlevel]
result=victory
[/endlevel]
[/then]
[/not]
[/if]
[/event]
Code: Select all
[side]
no_leader=yes
side=2
controller=ai
{GOLD 0 0 0}
income=0
team_name="Wolves"
user_team_name="Wolves"
[/side]
Re: Victory objective: defeating all enemy units
I am just guessing, but may be unit is still alive for filter proposes in event name=die
Try this code if you want, but I am not really sure that is the problem
Try this code if you want, but I am not really sure that is the problem
Code: Select all
[have_unit]
side=2
[not]
x,y=$x1,$y1
[/not]
[/have_unit]
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: Victory objective: defeating all enemy units
This event also needs
However the conditional itself seems strange. [then] needs to be after the condition, not within it.
first_time_only=no
.However the conditional itself seems strange. [then] needs to be after the condition, not within it.
Code: Select all
[event]
name=die
first_time_only=no
[filter]
side=2
[/filter]
[if]
[not]
[have_unit]
side=2
[/have_unit]
[/not]
[then]
[endlevel]
result=victory
[/endlevel]
[/then]
[/if]
[/event]
Re: Victory objective: defeating all enemy units
You can just useSpookyTree wrote:Code: Select all
{GOLD 0 0 0}
gold=0
if the difficulty setting is irrelevant.Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: Victory objective: defeating all enemy units
Adding
to side 2 definition might be a simple alternative for your purpose.
Code: Select all
defeat_condition=no_units_left
Discord: @tamanegi
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel