Recalling a Side
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.
Recalling a Side
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:
Scenario 2:
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]
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]
Re: Recalling a Side
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.
My campaign: Swamplings - Four centuries before the founding of Wesnoth, the first wolf rider emerges from a tribe of lowly swamp goblins.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Recalling a Side
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.
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 starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Recalling a Side
After much procrastination and mild despair I got it to work.
Thanks everybody.
Thanks everybody.