How to change side leader hitpoints?

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.
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to change side leader hitpoints?

Post by Pentarctagon »

not related to this, but in the future could you make a single thread for your current (and future) WML questions? you have 7 threads on page 1 now, and that's a bit excessive.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
SigurdFireDragon
Developer
Posts: 546
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to change side leader hitpoints?

Post by SigurdFireDragon »

I'm stumped as to why your latest [side] tag doesn't work, but this should work, and since it seems like you want to start your leader off with different HP, place this code in a prestart event

Code: Select all

[modify_unit]
    [filter]
        id=Rhaxiz
    [/filter]
    hitpoints=50
[/modify_unit]
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

Pentarctagon wrote:not related to this, but in the future could you make a single thread for your current (and future) WML questions? you have 7 threads on page 1 now, and that's a bit excessive.
Well i wanna specify my problems. And if i would ask all in same thread should i call it: My all wml problems? :)

edit: altought you guys has been really helpfull.

edit2: sigurd dragon now it is working but it looks kinda stubid cause my leader got 52/38HP should i try max_hitpoints or something like that?
"This game cured me of my real life addiction."
-Flameslash
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: How to change side leader hitpoints?

Post by monochromatic »

Use [object] and set object.effect.increase_total=14 and object.effect.heal_full=yes. EffectWML
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: How to change side leader hitpoints?

Post by Ceres »

Or just use max_hitpoints in modify_unit, as you suggested.
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to change side leader hitpoints?

Post by Pentarctagon »

Alluton wrote:Well i wanna specify my problems. And if i would ask all in same thread should i call it: My all wml problems? :)
you could, though you can edit the thread title as you encounter new problems.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

you could, though you can edit the thread title as you encounter new problems.
That sounds good.
"This game cured me of my real life addiction."
-Flameslash
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: How to change side leader hitpoints?

Post by Flyro »

Just add this inside the event:
{ADD_HP_LEADER SIDE HPADD}

notes:
SIDE=replace with the units side
you can replace side with $side_number if the event triggers during your turn
HPADD=replace with the amount of hp you wish to add
Spoiler:
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

Thanks flyro but i get it working already.(forgot to change thread status..)
"This game cured me of my real life addiction."
-Flameslash
Post Reply