How many persistent side I can use in a single campaign?
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.
How many persistent side I can use in a single campaign?
Hi!
I need to know if there is a limit of the number of persistent side I can use in a campaign; I'm building a campaign where I actually use 20 persistent side (it's a bit complicated story ) and testing one of the last scenarios I have discovered that I 'lost' the data of the first and the second sides created (the older ones).
I'm using the version 1.14.5 of the game with windows 7.
Thank for every help you can give me!
I need to know if there is a limit of the number of persistent side I can use in a campaign; I'm building a campaign where I actually use 20 persistent side (it's a bit complicated story ) and testing one of the last scenarios I have discovered that I 'lost' the data of the first and the second sides created (the older ones).
I'm using the version 1.14.5 of the game with windows 7.
Thank for every help you can give me!
Re: How many persistent side I can use in a single campaign?
If you happen to run into limits, you can save their info to variables.
Re: How many persistent side I can use in a single campaign?
He shouldn't have lost data for older sides, though, should he? We can't know if the bug is in wesnoth or in his WML code of course.
Re: How many persistent side I can use in a single campaign?
Well, I have no idea
what happened was: I used a side until a certain scenario A, I did not use it in the scenarios B e C, and I used it again in the scenario D; but it turned out to be an empty side; I have not used the side in any way in scenarios B and C, but I had created some new persistent side, that's why I supposed a problem with the number of the persistent side, also because I have never used so many persistent side in the past.
Fortunately, not all the persistent sides used in the campaign are absolutely necessary, so I can reduce their number; I'll do it and I'll see what happen (all those scenarios to re-tested )
However, it would have been useful to know if there was a limit of the persistent side, even for future work.
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: How many persistent side I can use in a single campaign?
I'm pretty sure there's no hard limit on how many persistent sides you can have, and it's definitely possible for a persistent side to go unused for a few scenarios and then come back. For starters, I'd suggest making sure all your
Without seeing actual code there's not much more I can say.
[side]
tags have a save_id
that specifies which persistent side they should use (non-persistent sides won't need it of course). If that doesn't work, maybe you have some code somewhere that actually unintentionally deletes the side's info?Without seeing actual code there's not much more I can say.
Re: How many persistent side I can use in a single campaign?
there was once a bug that made persistent sides disappear but it only effected online multiplayer and was i think fixed during 1.13
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.
Re: How many persistent side I can use in a single campaign?
I found something very suspicious in a scenarioCeltic_Minstrel wrote: ↑October 28th, 2018, 11:54 pm If that doesn't work, maybe you have some code somewhere that actually unintentionally deletes the side's info?
I wanted to recall all the units of a side used in a previous scenario (not one of the emptied sides) and put them in the map, so I used this code:
Code: Select all
[store_unit]
[filter]
side=5
x,y=recall,recall
[/filter]
variable=stored_units
kill=yes
[/store_unit]
{FOREACH stored_units i}
[unstore_unit]
variable=stored_units[$i]
find_vacant=yes
x,y=6,3
[/unstore_unit]
{NEXT i}
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: How many persistent side I can use in a single campaign?
Logically I'd expect the use of a nonexistent side to match nothing... so if that code is deleting a side's saved data, I would classify it as a bug.
Re: How many persistent side I can use in a single campaign?
The problem wasn't in the code in my previous post.
To find out exactly where the persistent side lost its data, I inserted a check in the code of the last scenario where the data of the side appear; this check displayed a message, at the start of the side turn, where it said the number of the unit in the recall list of the side (the side is used only in the start event of the scenario and only to recall a single unit and to pass the unit to another side). In this scenario (A) the check always return the correct value.
Then I inserted the same check in the following scenario (A+1), but in the prestart event the side it's already empty (In the scenario (A+1) I redefine the side only to can to do the check, but I didn't use it in the gameplay), so I presumed the data are lost just after the beginning of the last played turn of the scenario (A).
So I insert the check just before the endlevel event, and I'll tried to play again the scenario (A); the check returned the corrected value; the side data are lost in the endlevel event
I attached the file of the scenario (A), the 05_02 where the side's data are present, and of the scenario (A+1), the 05_03 where the data are lost.
Probably it's something of very stupid, but I don't find it
To find out exactly where the persistent side lost its data, I inserted a check in the code of the last scenario where the data of the side appear; this check displayed a message, at the start of the side turn, where it said the number of the unit in the recall list of the side (the side is used only in the start event of the scenario and only to recall a single unit and to pass the unit to another side). In this scenario (A) the check always return the correct value.
Then I inserted the same check in the following scenario (A+1), but in the prestart event the side it's already empty (In the scenario (A+1) I redefine the side only to can to do the check, but I didn't use it in the gameplay), so I presumed the data are lost just after the beginning of the last played turn of the scenario (A).
So I insert the check just before the endlevel event, and I'll tried to play again the scenario (A); the check returned the corrected value; the side data are lost in the endlevel event
I attached the file of the scenario (A), the 05_02 where the side's data are present, and of the scenario (A+1), the 05_03 where the data are lost.
Probably it's something of very stupid, but I don't find it
- Attachments
-
- checking.cfg
- (241 Bytes) Downloaded 234 times
-
- 05_02_In_the_Heat_of_the_Night.cfg
- (18.74 KiB) Downloaded 244 times
-
- 05_03_Walking_in_the_Underground.cfg
- (11.37 KiB) Downloaded 243 times
Re: How many persistent side I can use in a single campaign?
I did some little experiments:
In the scenario 05_02, in the persistent side 1, I changed the controller=human with controller=ai;
the result was that in the next scenario, the 05_03, the persistent side 3, which was previously emptied, is now intact.
Then, always in the scenario 05_02, I restored the old definition of the side, with controller=human, but I deleted the save_id:
I got the same result as the previous attempt, the other persistent side that was emptied is no longer emptied.
Now, I always used persistent side with different save_id, so I have no idea how they can be this problem's origin.
In the scenario 05_02, in the persistent side 1, I changed the controller=human with controller=ai;
Code: Select all
# former definition of the side
side=1
controller=human
no_leader=yes
save_id=Lamis
side_name= _ "Lamis' Gang"
color=teal
{FLAG_VARIANT ragged}
team_name=Heroes
user_team_name= _ "Lamis' gang"
# new definition of the side
side=1
controller=ai
no_leader=yes
save_id=Lamis
side_name= _ "Lamis' Gang"
color=teal
{FLAG_VARIANT ragged}
team_name=Heroes
user_team_name= _ "Lamis' gang"
Then, always in the scenario 05_02, I restored the old definition of the side, with controller=human, but I deleted the save_id:
Code: Select all
# new definition of the side
side=1
controller=ai
no_leader=yes
# save_id=Lamis <----- deleted
side_name= _ "Lamis' Gang"
color=teal
{FLAG_VARIANT ragged}
team_name=Heroes
user_team_name= _ "Lamis' gang"
Now, I always used persistent side with different save_id, so I have no idea how they can be this problem's origin.
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: How many persistent side I can use in a single campaign?
I'm not entirely sure what you're getting at with that, but the
save_id
is supposed to uniquely represent a persistent side (if there's no save_id
it defaults to the value of id
). If you use a different save_id
in the two scenarios it shouldn't restore the side. Or do you mean you used persistent sides with different controllers? I know of no reason why it wouldn't work to switch a persistent side from human to ai or vice versa, though. Or maybe I just misunderstood you entirely?Re: How many persistent side I can use in a single campaign?
also note that for ai sides re bydefault nopersistent for them to be persitent you need explcitily need write
persistent=yes
in that [side]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.
Re: How many persistent side I can use in a single campaign?
During the whole campaign every side has always the sameCeltic_Minstrel wrote: ↑November 2nd, 2018, 12:08 am I'm not entirely sure what you're getting at with that, but thesave_id
is supposed to uniquely represent a persistent side (if there's nosave_id
it defaults to the value ofid
). If you use a differentsave_id
in the two scenarios it shouldn't restore the side. Or do you mean you used persistent sides with different controllers? I know of no reason why it wouldn't work to switch a persistent side from human to ai or vice versa, though. Or maybe I just misunderstood you entirely?
save_id
and the same controller
; I'm sure because I use a predefined macros to define the persistent sides.I changed the controller of the lamis side only temporarily to do an experiment; I wanted to see what happened when I have a persistent side less.
Ouch! A little lapse.also note that for ai sides re bydefault nopersistent for them to be persitent you need explcitily need write persistent=yes in that [side]