Era-of-InvasionS's ability thread

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
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Era-of-InvasionS's ability thread

Post by francophone »

Is it not possible to have a unit that heals : restores pv, without removing or slow poison?

I did a test, but when a unit is poisoned the healer does not give him pv.
Spoiler:
Last edited by francophone on March 21st, 2012, 11:46 am, edited 1 time in total.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Heals without unpoison ?

Post by Dugi »

Make an event that triggers at the beginning of each turn, with heal_unit, setting as primary unit a unit that is next to a unit with that ability and the adjacent unit with that ability as second_unit and with animate=yes. It will heal without unpoison, and it will look absolutely the same.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

Like that ? :
Spoiler:
But how specify the next units ?
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Heals without unpoison ?

Post by Ceres »

Code: Select all

[filter]
   [filter_adjacent]
      ability="heals +6"
   [/filter_adjacent]
[/filter]
Also note that it's the ability's id you filter for, not the macro definition.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

I put in the unit file.

[event]
name=side turn
first_time_only=no

[heal_unit]
[filter_adjacent]
ability="heals +6"
[/filter_adjacent]
amount=6
animate=yes
[/heal_unit]
[/event]


Nothing happens
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Heals without unpoison ?

Post by Dugi »

Like this:

Code: Select all

#define ABILITY_HEALS_6
[dummy]
id=heals +6
name= _ "heals +6"
female_name= _ "female^heals +6"
description=_ "heals +6:
Allows the unit to heal adjacent allied units at the beginning of our turn.
A unit cared for by this healer may heal up to 6 HP per turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
[/dummy]
[/abilities]
[event]
name=side turn
first_time_only=no

[heal_unit]
[filter]
[filter_adjacent]
ability=heals +6
 [/filter_adjacent]
side=$side_number
[/filter]
[/filter_second]
ability=heals +6
side=$side_number
[/filter_second]
amount=6
animate=yes
[/heal_unit]
[/event]
[+abilities] 
#enddef
I suggest you to make a thread for weapon specials and abilities, and not to ask separately about each of them.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

Effectively, with "side turn" must stipulate the turn of who, to make it work.

I do not understand (language problem). Are you telling me to put the code in a block in a file "abilities" in the macros folder of my era?

In the wiki, I can read including here http://wiki.wesnoth.org/WML_Abilities :
And insert this event to your [scenario], [multiplayer], [unit_type] or [era]:
I was already confirmed that the events only works in these files.
I do not understand where I need to put what.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

Don't work

I think "side turn" is the problem
I will try with "new turn" for test

Edit : Ok, that works with "new turn" notably when a unit is poisoned (heal first)... but for one only unit !!!! :hmm:
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Heals without unpoison ?

Post by Dugi »

francophone wrote: I do not understand (language problem). Are you telling me to put the code in a block in a file "abilities" in the macros folder of my era?
J'ai dit que je pense qu'il serait meilleur si tu créais une discussion á discuter tous les abilities et weapon specials au lieu de créer de multiple discussions pour chaque chose que tu veux - c'est tout, rien d'important. Par example, tu peux changer le nom de cette discussion á 'Francophone's ability thread' ou quelque chose similaire, et discuter tout ce-que tu veux. Maintenir deux discussions pour des choses similaires est aussi énuissant pour toi.

Je ne suis pas sur quelle version de Battle for Wesnoth t'as, car cette ability a marché sans aucunes problémes á mon ordinateur (aprés la correction de cet erreur mineur que j'ais écris le '[/filter_second] au lieu d'écrire [filter_second], qui était facile a retrouver). Le meme avec la 'feu' ability discuté dans l'autre discussion, cela marchait sans aucune probléme pour moi. Si t'as la version 1.10.1, je n'ai vraiement aucue idée qu'est-ce que ce peut etre, autrement, je pense qu'un upgrade sera assez aidant.

I hope you understood this well. And sorry for making a few mistakes in your (probably) native language, I don't have the french keyboard layout.
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Heals without unpoison ?

Post by Elvish_Hunter »

francophone wrote:Edit : Ok, that works with "new turn" notably when a unit is poisoned (heal first)... but for one only unit !!!!
Just to know, what's your Wesnoth version? On the 1.8 series, [heal_unit] was able to heal only the first matching unit. During the 1.9 development cycle, it was changed so [heal_unit] can heal all matching units.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Heals without unpoison ?

Post by Dugi »

I have said him in French that his problems might be related to having an old version, but good to know it for sure. So weird that many of the weapon specials worked for me and not for him...
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

actually I'm on 1.9.5

My era don't works actually on 1.10 (macro "PLAY_SOUND" missing).
So : How does I must modify : "{PLAY_SOUND ("torch.ogg")}" ?

edit : Found! It was the only bug that blocked the launch of the era.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

And so with version 1.10.1 my healers heal well around them, but:
1 They also remove a poison
2 The care + 6 is added to that of a village
3 They heal units of side 1 at the beginning of this round of side 1. Not very practical when they heal the enemies instead of their camp.

For 3, I think it is possible to correct this by doing a code for each side.

For other points, I'm in limbo.
User avatar
francophone
Posts: 393
Joined: February 20th, 2010, 2:19 pm

Re: Heals without unpoison ?

Post by francophone »

Finally, I think it's as good or better to do with slow poison.
Knowing that I have heals +6 lvl1 then +12, then even at lvl 3 +18, I think better to have slow posion healers for greater than +8, so that the poison is crippling for celests. This is the default of celests healers. Instead of adding 12 or 18 hp to units that loses 8 per turn, so let wins in the final 4 or 10 but still poisoned, this unit does not win more than it loses with slow poison.

So I do need a special code.
But nothing prevents us from looking how to operate the first idea, if someone interested in the WML exercise or the result.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Heals without unpoison ?

Post by Dugi »

francophone wrote:And so with version 1.10.1 my healers heal well around them, but:
1 They also remove a poison
2 The care + 6 is added to that of a village
3 They heal units of side 1 at the beginning of this round of side 1. Not very practical when they heal the enemies instead of their camp.

For 3, I think it is possible to correct this by doing a code for each side.

For other points, I'm in limbo.
I forgot to add a few details. This one should fix two out of three problems. What is so bad about not healing also in villages? It would make healing more useful then, and make you still benefit from villages if you have a healer. It is a nice change. If you don't want it, add a terrain filter there to prevent it from affecting units in villages.

Code: Select all

#define ABILITY_HEALS_6
[dummy]
id=heals +6
name= _ "heals +6"
female_name= _ "female^heals +6"
description=_ "heals +6:
Allows the unit to heal adjacent allied units at the beginning of our turn.
A unit cared for by this healer may heal up to 6 HP per turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
[/dummy]
[/abilities]
[event]
name=side turn
first_time_only=no

[heal_unit]
[filter]
 [filter_adjacent]
  ability=heals +6
  side=$side_number       #Forgot to add this
 [/filter_adjacent]
side=$side_number
[/filter]
[/filter_second]
ability=heals +6
side=$side_number
[/filter_second]
amount=6
animate=yes
restore_statuses=no          #This was =no by default before 1.10, but it is now yes by default and I haven't noticed it.
[/heal_unit]
[/event]
[+abilities] 
#enddef
This might be also useful for the thing you wanted to do in the last post (if I understood it correctly, that sentence was hard to understand), the unit will lose 8 hp by poison, but gain some hp due to healing. Did you mean this?
Instead of adding 12 or 18 hp to units that lose 8 per turn, so let it gain in total 4 or 10 hp, but still leave it poisoned, so that this unit does not gain more than it would lose due to slow poison.
Au lieu d'adder 12 ou 18 hp aux units qui perdent 8 hp par tour, fait it obtenir en total 4 ou 10 hp, mais laisser it empoisonné, alors que cette unit ne va pas obtenir plus que serait la perte causé par le slow poison.
Now I think that what you meant by heal without unpoison might be just this:

Code: Select all

#define ABILITY_HEALS
    [heals]
        value=12
        id=healing
        affect_allies=yes
        name= _ "heals +12"
        female_name= _ "female^heals +12"
        description=  _ "Heals +12:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 12 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
        affect_self=no
        poison=slowed
        [affect_adjacent]
            adjacent=n,ne,se,s,sw,nw
        [/affect_adjacent]
    [/heals]
#enddef
If the unit is poisoned, it will not be healed, but will not lose hp due to the poison. In this case, poison is pretty crippling for those celestials.
Post Reply