Save characteristics of heroes

The place to post your WML questions and answers.

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.
Post Reply
Cluric
Posts: 16
Joined: October 6th, 2012, 7:57 pm

Save characteristics of heroes

Post by Cluric »

Hi !

First, please excuse me for my mistakes, i'm neither an english or american person. I hope you'll be able to understand me :D

I'm currently creating a campain, and I have the following problem : i know how to create my own heroes with their special characteristics etc... but, I've no idea how to re-use them in the next mission (considering the fact that they may have gain some level (and as a consequence some HP). I'm not speaking about the level up that can change the entire heros (images, attack, armor etc...).

My point is, I intend to make a quite long campaign with a few heroes, and if a player use mostly 1-2 of them to kill the ennemy, i'd wanted to reward him by increasing the HP of theses particular heroes (but NOT the other statistics, I'm trying to avoid the "god-mod phenomena").

In short : how can I "save" the exact statut of a character at the end of a mission, for the next one ?
I've made some research, but wasn't able to find an answer;

Thanks a lot, and please keep going, Wesnoth is an amazing game !
User avatar
Chief_Chasso
Posts: 132
Joined: December 15th, 2012, 2:36 am

Re: Save characteristics of heroes

Post by Chief_Chasso »

Hi Cluric,
Individual units should be saved automatically from scenario to scenario. Units that are not leaders (units that do not have canrecruit=yes) are saved in the leader's recall list in the next scenario.
SP Campaign: Rally For Roanic
Cluric
Posts: 16
Joined: October 6th, 2012, 7:57 pm

Re: Save characteristics of heroes

Post by Cluric »

And.... I feel bad because apparently i've made a mistake while counting the HP and XP during my previous run of the campaign.
Thanks for your answer, it DID works :D
gfgtdf
General Code Maintainer
Posts: 1344
Joined: February 10th, 2013, 2:25 pm

Re: Save characteristics of heroes

Post by gfgtdf »

Chief_Chasso wrote:Hi Cluric,
Individual units should be saved automatically from scenario to scenario. Units that are not leaders (units that do not have canrecruit=yes) are saved in the leader's recall list in the next scenario.
This is not exactly correct, unit carryover works like this:
All unit from the previous scenario are stored in the players recall list (unrelated to canrecruit=yes).
[unit] inside [side] does not always create a unit, instead it only creates a unit if it cannot find such a unit (a unit with that id) in the players recall list. If there is such a unit it just recalls that unit.
unit related keys in [side] (like type=, id= or canrecruit=) behave the same as they were inside a [unit] in the [side] with the exeption that canrecruit= defaults to yes.
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.
User avatar
Chief_Chasso
Posts: 132
Joined: December 15th, 2012, 2:36 am

Re: Save characteristics of heroes

Post by Chief_Chasso »

Thanks gfgtdf for the clarification.
unit related keys in [side] (like type=, id= or canrecruit=) behave the same as they were inside a [unit] in the [side] with the exeption that canrecruit= defaults to yes.
I thought that canrecruit= defaults to no? Unless you use [leader] in [side].
SP Campaign: Rally For Roanic
gfgtdf
General Code Maintainer
Posts: 1344
Joined: February 10th, 2013, 2:25 pm

Re: Save characteristics of heroes

Post by gfgtdf »

Chief_Chasso wrote:Thanks gfgtdf for the clarification.
unit related keys in [side] (like type=, id= or canrecruit=) behave the same as they were inside a [unit] in the [side] with the exeption that canrecruit= defaults to yes.
I thought that canrecruit= defaults to no? Unless you use [leader] in [side].
Ok i didnt know that [leader] was documented. Canrecruit in [unit] defaults to no. What i mean is that attributes inside [side] behave the same as in [unit], or better that same as in [leader]. So this code

Code: Select all

[side]
 type="Speaman"
 id="leader1"
 controller="human"
[/side]
is equivalent to:

Code: Select all

[side]
 id="leader1"
 controller="human"
 no_leader=yes
 [leader]
  type="Speaman"
  id="leader1"
 [leader]
[/side]
And [leader] just like [unit] will do a recall-or-create action, meaning it will 'recall' the unit with id 'leader1' if possible and only create a unit if that failed.
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.
User avatar
Chief_Chasso
Posts: 132
Joined: December 15th, 2012, 2:36 am

Re: Save characteristics of heroes

Post by Chief_Chasso »

gfgtdf wrote:What i mean is that attributes inside [side] behave the same as in [unit]
I know what you mean. ^_^ Thanks for the explanation.

It's just frustrating trying to solve the OP's conundrum when they give you nothing to go on. I was just trying to throw out ideas... like throwing darts in the dark.
SP Campaign: Rally For Roanic
Post Reply