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.
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

How to change side leader hitpoints?

Post by alluton »

I did try my own consepts but ended up to code that crashed wesnoth witout an error message :(
Last edited by alluton on May 6th, 2011, 11:35 am, edited 1 time in total.
"This game cured me of my real life addiction."
-Flameslash
SigurdFireDragon
Developer
Posts: 546
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to change side leader hitpoints?

Post by SigurdFireDragon »

Should be doable with the [modify_unit] tag in 1.9, otherwise, there's the {MODIFY_UNIT} macro.
http://wiki.wesnoth.org/DirectActionsWM ... fy_unit.5D
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.
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: How to change side leader hitpoints?

Post by monochromatic »

side.hitpoints=
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: How to change side leader hitpoints?

Post by Anonymissimus »

alluton wrote:I did try my own consepts but ended up to code that crashed wesnoth witout an error message :(
If you find some wml and/or another extension language used in the wesnoth environment which crashes wesnoth report that at gna as a bug.
http://gna.org/bugs/?group=wesnoth
A wesnoth crash is if the apllication window shuts down and you are on the desktop again. Also if the application window freezes. It is not a wesnoth crash if you are taken to the mainscreen (you should get an ideally informative error message in that case).
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
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

Well application window freezes and then it completly shuts down..but propably that kind of code is terrible wrong:D

edit: [modifyunit]
[filter]
type=I8_DB_Shaman
[/filter]
hitpoints=50
[/modifyunit]

should that work?


cause this was the code in link: example usage (see also the test scenario):

Code: Select all

[modify_unit]
    [filter]
        type=Troll Rocklobber
    [/filter]
    hitpoints=10
    [modifications]
        [trait]
            # first trait is unmodified
        [/trait]
        {TRAIT_HEALTHY}# second trait is replaced with the healthy trait
    [/modifications]
[/modify_unit]
"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 »

:doh:
Isn't the problem obvious?
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

NO IT ISNT! i woudent ask otherwise
Last edited by Gambit on May 4th, 2011, 4:26 pm, edited 1 time in total.
Reason: Removed shouting, which is against posting guidelines 1A.
"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 »

alluton wrote:

Code: Select all

[modifyunit]
    [filter]
  type=I8_DB_Shaman
  [/filter]
hitpoints=50
[/modifyunit]
the wiki wrote:

Code: Select all

[modify_unit]
    [filter]
        type=Troll Rocklobber
    [/filter]
    hitpoints=10
    [modifications]
        [trait]
            # first trait is unmodified
        [/trait]
        {TRAIT_HEALTHY}# second trait is replaced with the healthy trait
    [/modifications]
[/modify_unit]
Does that look similar to you? No.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: How to change side leader hitpoints?

Post by Anonymissimus »

alluton wrote:[modifyunit]
A wml editor with syntax highlite makes it easy to spot such things.

EDIT
alluton wrote:Well application window freezes and then it completly shuts down..but propably that kind of code is terrible wrong:D
Not your problem then. The engine is supposed to take care for all kinds of evil it may receive so to say. Wrong code is uncommon and thus likely to trigger bugs.
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
SigurdFireDragon
Developer
Posts: 546
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to change side leader hitpoints?

Post by SigurdFireDragon »

Also, you can change leader hitpoints in the [side] tag if you create the leader there, just add a 'hitpoints=50'.
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.
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: How to change side leader hitpoints?

Post by monochromatic »

SigurdTheDragon wrote:Also, you can change leader hitpoints in the [side] tag if you create the leader there, just add a 'hitpoints=50'.
monochromatic wrote:side.hitpoints=
SigurdFireDragon
Developer
Posts: 546
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to change side leader hitpoints?

Post by SigurdFireDragon »

Ooops, had seen that, but it didn't click right away that that was equivalant.
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 »

thanks for your answers. I'll tryt that solution mby thye help.

something like this? [side]

Code: Select all

        side=1
        controller=human
        team_name=darkblood
        user_team_name= _ "team_name^Darkblood"
        color=green
        type=I8_DB_Shaman
        id=Rhaxiz
        name= _ "Rhaxiz"
        hitpoints=50
        canrecruit=yes
        recruit=I8_DB_Lancer,I8_DB_ShamanAdept,I8_DB_Shooter,I8_DB_ZSalamander
        {GOLD 70 70 70}
        {INCOME 6 6 6}
    [/side]
this dont cause bugs or errors but dont modify leaders hitpoints...
"This game cured me of my real life addiction."
-Flameslash
User avatar
Dixie
Posts: 1757
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Re: How to change side leader hitpoints?

Post by Dixie »

monochromatic wrote:
alluton wrote:

Code: Select all

[modifyunit]
    [filter]
  type=I8_DB_Shaman
  [/filter]
hitpoints=50
[/modifyunit]
the wiki wrote:

Code: Select all

[modify_unit]
    [filter]
        type=Troll Rocklobber
    [/filter]
    hitpoints=10
    [modifications]
        [trait]
            # first trait is unmodified
        [/trait]
        {TRAIT_HEALTHY}# second trait is replaced with the healthy trait
    [/modifications]
[/modify_unit]
Does that look similar to you? No.
In case it wasn't clear (not meant to insult you, but you don't seem like you understood): in your code, you wrote [modifyunit], while the wiki uses [modify_unit]. Note the underscore ( _ ) between "[modify" and "unit]".
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: How to change side leader hitpoints?

Post by alluton »

i try.
"This game cured me of my real life addiction."
-Flameslash
Post Reply