Merging an ally's recall list into your own
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.
Merging an ally's recall list into your own
In my Dunefolk campaign I'm writing, you fight with an AI ally in Scenario 2. In Scenario 3, at the very beginning, this ally dies. I'd like to merge their recall list from Scenario 2 with the player's own.
How can I do this in WML?
How can I do this in WML?
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die
Re: Merging an ally's recall list into your own
I expect changing side of those recallable units will do that.
Re: Merging an ally's recall list into your own
First a couple of questions:
- What version of Wesnoth are you using?
- Normally an AI side has no recall list. Did you already make the AI side have a recall list by using the MAKE_AI_SIDE_PERSISTENT and RECALL_AI_SIDE macros?
- What version of Wesnoth are you using?
- Normally an AI side has no recall list. Did you already make the AI side have a recall list by using the MAKE_AI_SIDE_PERSISTENT and RECALL_AI_SIDE macros?
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Merging an ally's recall list into your own
you don't need
ftr,
MAKE_AI_SIDE_PERSISTENT
or RECALL_AI_SIDE
just use persistent=yes
in your side definition. In 1.12 this works unless you are writing a multiplayer campaigns where carryover is borken for some if a side is skipped in a certain scenario does not appear in a certain scenario. (have a side with id=Ravana in scenario 1 and 3 but not in scenario 2 will erase the carryover data from that side in scenairo 2 in 1.12 in a multiplayer campaign. the mainline mp campaign LoW also suffers from this bug in 1.12 ). This bug was fixed in 1.13. though where it should also work in multiplayer campaigns.ftr,
RECALL_AI_SIDE
was removed in 1.13Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Merging an ally's recall list into your own
Thanks for the help! I’m using 1.13.10. It sounds like hanging their sides right before the scenario is over would do it. How do I do that in wml? I searched but can’t find it.
Drake Campaign: A Fiery Birth | Knalgan Alliance Campaign: Drunkards, Dwarves, and Doubloons | Dunefolk Campaign: Asheviere's Shadow | Northeners Campaign: Goblin's Glory | Undead Campaign: Shakespeare's Ghost | Rebels Campaign: Santa Must Die
Re: Merging an ally's recall list into your own
a lua implementaion woudlo look like this:
the
Code: Select all
for i,u in ipairs(wesnoth.get_recall_units({ side = old_side})) do
u:extract()
u:to_recall(new_side)
end
u:extract()
might not be needed but i would not rely on that.Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- Celtic_Minstrel
- Developer
- Posts: 2216
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merging an ally's recall list into your own
I distinctly recall that AI sides having recall lists worked even in 1.10, and if I recall correctly, I didn't even need the macro.
Anyway, in order to do this, I think the following WML should work:
That should transfer side 2's recall list over to side 1. (According to StandardUnitFilter, unit filters prefer units on the map but also match them on the recall list.)
Anyway, in order to do this, I think the following WML should work:
Code: Select all
[modify_unit]
[filter]
side=2
[/filter]
side=1
[/modify_unit]