Endlevel Conditions

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Endlevel Conditions

Post by LordAwsomeness »

Hi so I have made a scenario where it is players 1-4 vs player 5 and I am trying to create endlevel conditions that allow for one side to win and for the opposing side to lose and vice versa. Everytime I create code such as the following, it doesn't fire it for both teams, just the first endlevel. so essentially one team either wins or loses and nothing happens to the other team.

Code: Select all

[event]
name=new turn
first_time_only=no
[if]
{VARIABLE_CONDITIONAL la_village.count less_than_equal_to 1}
[then]

[endlevel]
	result=defeat
	side=1,2,3,4
[/endlevel]
[endlevel]
	result=victory
	side=5
[/endlevel]
[/then]
[/if]
[/event]
if you understand how to fix this please let me know!
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
James_The_Invisible
Posts: 519
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces
Contact:

Re: Endlevel Conditions

Post by James_The_Invisible »

LordAwsomeness wrote:
January 30th, 2020, 9:09 pm
Hi so I have made a scenario where it is players 1-4 vs player 5 and I am trying to create endlevel conditions that allow for one side to win and for the opposing side to lose and vice versa. Everytime I create code such as the following, it doesn't fire it for both teams, just the first endlevel. so essentially one team either wins or loses and nothing happens to the other team.

Code: Select all

[event]
name=new turn
first_time_only=no
[if]
{VARIABLE_CONDITIONAL la_village.count less_than_equal_to 1}
[then]

[endlevel]
	result=defeat
	side=1,2,3,4
[/endlevel]
[endlevel]
	result=victory
	side=5
[/endlevel]
[/then]
[/if]
[/event]
if you understand how to fix this please let me know!
It looks like that only the first [endlevel] tag is taken into account. Fortunately, since 1.13.0 we can set different results for different sided with 1 [endlevel]. The wiki says that it is done this way (untested):

Code: Select all

[endlevel]
        [result]
	    result=defeat
	    side=1,2,3,4
	[/result]
	[result]
	    result=victory
	    side=5
	[/result]
[/endlevel]
Last edited by James_The_Invisible on January 31st, 2020, 5:35 pm, edited 1 time in total.

User avatar
Pentarctagon
Forum Administrator
Posts: 4223
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Endlevel Conditions

Post by Pentarctagon »

Moved to the WML Workshop.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Post Reply