recall lists or modifying "persistent"
Moderator: Forum Moderators
recall lists or modifying "persistent"
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.]
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.]
Re: recall lists or modifying "persistent"
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.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: recall lists or modifying "persistent"
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).
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 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