How to create recall list?
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.
- Spannerbag
- Posts: 759
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: How to create recall list?
???ChaosRider wrote: ↑December 13th, 2024, 3:17 pmFrom your code only Grand Marshal show up in recall list. Other two units doesnt show up.Spannerbag wrote: ↑December 13th, 2024, 11:27 am There are many ways to do this but this works for me on 1.18...


Code: Select all
[event]
name=side 1 turn 2
{DEBUG_MSG (_"About to create 3 units on recall")}
{GENERIC_UNIT 1 Mage recall recall}
{LOYAL_UNIT 1 (Elvish Druid) recall recall}
[unit]
name=_"Recallable Leader"
id=recallable_leader
side=1
type=Grand Marshal
x,y=recall,recall
[modifications]
{TRAIT_STRONG}
{TRAIT_FEARLESS}
[/modifications]
canrecruit=yes
[/unit]
[/event]
[unit]
version works, but using standard macros fails for some reason.The store/unstore method uses the variable
test_recall_list
as a container rather than the recall list, but if it works for you then OK. 
Since I can't replicate your experience then if you still want to get the recall logic working all I can suggest is:
- Check the logfile, there may be a hint in there.
- Replace the macros with
[unit]
and see if that works (then the issue is something to do with macros I guess). - Create a test scenario that does nothing except create recall units and see what works and what doesn't.
Edit:
It may be that you need to check out side
If all you want to do is carry over a recall list between leaders and/or scenarios then the store/unstore is probably easier to get working.
Does the recall logic work within the first scenario? If so then the recalls are being lost when the new scenario starts.
Best way to carry over leaders (assuming nothing unusual) would be to simply declare the same leader(s) in subsequent scenarios (recall should work then too with luck). You can store leaders too provided at least one remains on map at scenario end* (the one you declare in your
* Or change your side's
Good luck!I assumed that the leaders were all on the same side, were player controlled and didn't have [filter_recall]s.ChaosRider wrote:Your code doesnt work. I tested it and game see no units from previous scenario at the second scenario. Also as I said if in first scenario leaders are changing in second scenario. They are again picked randomly. How to make game choose leaders from previous scenario?
It may be that you need to check out side
persistent
and save_id
.If all you want to do is carry over a recall list between leaders and/or scenarios then the store/unstore is probably easier to get working.
Does the recall logic work within the first scenario? If so then the recalls are being lost when the new scenario starts.
Best way to carry over leaders (assuming nothing unusual) would be to simply declare the same leader(s) in subsequent scenarios (recall should work then too with luck). You can store leaders too provided at least one remains on map at scenario end* (the one you declare in your
side
would be best I guess).* Or change your side's
defeat_condition
to never
.-- Spannerbag
Re: How to create recall list?
If you use
[side]save_id=some_name_1
, [side]save_id=some_name_2
, etc then the engine should carry over both the recall list and the recruit list for you, automatically storing all units from the map onto the appropriate side's recall list.[unit]id=
will automatically recall instead of creating a new unit if a unit with the same id is on the engine's list for that side, although it won't look in other variables. I don't know if it'll look in other sides' recall lists, but IIRC it does; I've a vague memory of an unexpected result involving that, when using debug to skip back to a scenario after a unit changed sides.