Recalling a Side

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
Deusite
Translator
Posts: 110
Joined: May 31st, 2009, 1:38 am
Location: Oxford

Recalling a Side

Post by Deusite »

So I'm trying to recall two whole sides from one scenario to the other. Side 1 works perfectly, but side 5 either doesn't get recalled or if I define a leader in the second scenario it says side 5 has a unit definition error. Any ideas? The only real difference I see between the sides is the lack of a leader in side 5.

Scenario 1:

Code: Select all

[side]
	side=1
	type=Horseman Commander 
	name="Deoran"
	id=Deoran
	unrenamable=yes
	profile=portraits/deoran_knight.png

	team_name=North_Wind
	user_team_name=Deoran
	controller=human
	{CUSTOM_NW_FLAG}

	{GOLD 60 60 60}
	{INCOME 0 0 0}
	
	canrecruit=yes
[/side]

# Remnants of the Bright Spears
[side]
	side=5
	no_leader=yes

	team_name=North_Wind
	user_team_name=Bright Spears
	controller=ai

	{GOLD 0 0 0}
	{INCOME 0 0 0}
[/side]

[event]
	name=die
	[filter]
		id=Gofbak
	[/filter]
		[kill]
			side=4
			animate=no
		[/kill]

	[store_unit]
		variable=recalls
		[filter]
			side=1
      			[not]
          			canrecruit=yes
         		[/not]
		[/filter]
		x,y=recall,recall
	[/store_unit]

	[store_unit]
		variable=recalls_2
		[filter]
			side=5
		[/filter]
		x,y=recall,recall
	[/store_unit]

	[endlevel]
		result=victory
		bonus=no
	[/endlevel]
	[/else]
	[/if]
[/event]
Scenario 2:

Code: Select all

# The North Wind Riders
[side]
	side=1
	type=Horseman Commander 
	name="Deoran"
	id=Deoran
	unrenamable=yes
	profile=portraits/deoran_knight.png

	team_name=North_Wind
	user_team_name=Deoran
	controller=human
	{CUSTOM_NW_FLAG}

	{GOLD 60 60 60}
	{INCOME 0 0 0}
	
	canrecruit=yes
[/side]

# Remnants of the Bright Spears
[side]
	side=5
	no_leader=yes

	team_name=North_Wind
	user_team_name=Bright Spears
	controller=human

	{GOLD 0 0 0}
	{INCOME 0 0 0}
[/side]

# Scenario Pre-start
[event]
	name=prestart

	{FOREACH recalls i}
		[recall]
			id=$recalls[$i].id
		[/recall]
	{NEXT i}
	{CLEAR_VARIABLE recalls}

	{FOREACH recalls_2 j}
		[recall]
			id=$recalls_2[$j].id
		[/recall]
	{NEXT j}
	{CLEAR_VARIABLE recalls_2}
[/event]
AKA Marz
Two profiles are better than one
Latin Translator
User avatar
boru
Posts: 788
Joined: November 19th, 2009, 11:02 pm

Re: Recalling a Side

Post by boru »

Since controller for that side is ai in the first scenario, the side won't be persistent unless you place this in your side tag:

Code: Select all

[side]
side=5
persistent=1
save_id=whatever_name_you_want_to_give_them
[/side]
“It is written in my life-blood, such as that is, thick or thin; and I can no other.” - J.R.R. Tolkien

My campaign: Swamplings - Four centuries before the founding of Wesnoth, the first wolf rider emerges from a tribe of lowly swamp goblins.
Anonymissimus
Inactive Developer
Posts: 2460
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Recalling a Side

Post by Anonymissimus »

I'd try boru's suggestion.
But if you want it wml-driven you need to [unstore_unit]x,y=recall,recall in that loop too. [store_unit]x,y= is meaningless.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Deusite
Translator
Posts: 110
Joined: May 31st, 2009, 1:38 am
Location: Oxford

Re: Recalling a Side

Post by Deusite »

After much procrastination and mild despair I got it to work. :Awesome:

Thanks everybody.
AKA Marz
Two profiles are better than one
Latin Translator
Post Reply