recall lists or modifying "persistent"

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
DranKof
Posts: 34
Joined: May 30th, 2013, 6:35 am
Location: Beijing, China

recall lists or modifying "persistent"

Post by DranKof »

This is my goal:
After a multiplayer game starts, the AI has its recall list enabled (via a MP Mod), to which certain generated units can be placed in the list for the AI to recall.

This is my obstacle:
For any side to have a recall list, the side's "persistent" variable must be set to "yes"/true, but the variable only seems to be alterable via the side tag which I wouldn't be using in a MP Mod, rather only in a scenario file, which I don't want to do (again, because it'd be for a MP Mod).

So I'm looking to do one of two things:
1) modify the persistent variable using any WML or LUA that I haven't yet uncovered; or
2) find another way to enable the AI's recall list (this would frankly be even more ideal as I might not necessarily want the AI's forces to be persistent).

I've been looking around the WML wikis (modify_side (persistent is not a modifiable variable for this); store_side => modify_variable => unstore_side (no such tag)) and through the LUA:side (again, doesn't seem to be a modifiable variable) information as well as the forum but I can't find any solutions. Does anyone know of any? Or would I have to submit it as a "requested feature"?

[EDIT: In retrospect, this might be better in multiplayer development as there might not be a LUA solution as I was thinking, at first. Sorry if it's misplaced.]
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: recall lists or modifying "persistent"

Post by AI »

There is currently no way to set persistent from WML (or even C++, it's a read-only variable). I did something similar in 1.4 by switching out the controller at scenario start and end, but that requires starting the side as human, as that's when persistent is set using the controller-based default.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: recall lists or modifying "persistent"

Post by Anonymissimus »

Instead of modifying persistent= I suppose you could have a persistent side and a non-persistent one and switch all units and gold between them. However, such dummy sides would need to be provided by the scenario, MP modifications can't do that as they only should contain [event]s (and wesnoth doesn't support adding sides other than in [scenario]/[multiplayer]).

EDIT
You could implement "manual carryover". That is, just don't use the engine's carryover functionality, but use (un)store_unit and (un)store_side to put units/gold/whatever into wml variables at scenario end and unstore it at the start of the next. It's complicated but a player should rather be unable to distinguish. This is what needs to be done whenever persistent=yes is/was buggy (previously to 1.8 in particular it was like this when switching sides).
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
Post Reply