Era-of-InvasionS's ability thread
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.
Re: Era-of-InvasionS's ability thread
side=$2? That will do nothing. Write side=$second_unit.side instead.
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
side=$2 works. but I replace it with the more formal version.dugi wrote:side=$2? That will do nothing. Write side=$second_unit.side instead.
And so the finish code (if someone want its version of plague):
Spoiler:
Last edited by francophone on May 15th, 2012, 10:38 pm, edited 1 time in total.
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
I try to improve another skill. It works by directly indicating the value that I want to remove to the unit. But I want this value to be a quarter of the damage of its attack. I did some tests but I have trouble with variable operations (and I find nothing about this in the wiki).
The idea is to store the unit for divide by 4 the damage of the attack. Then use the negative of that value as "amount".
How do I do?
I put the code: The first event (in attack) in the original version that works with directly indicating value (-4). The second event (in defense) is an attempt to improve damage with value = / 4. I multiplied the variables to divide operations, but it does not work at all. I think my writing is completely incorrect, right?
The idea is to store the unit for divide by 4 the damage of the attack. Then use the negative of that value as "amount".
How do I do?
I put the code: The first event (in attack) in the original version that works with directly indicating value (-4). The second event (in defense) is an attempt to improve damage with value = / 4. I multiplied the variables to divide operations, but it does not work at all. I think my writing is completely incorrect, right?
Spoiler:
Re: Era-of-InvasionS's ability thread
second_weapon and damage_inflicted are automatically stored variables
Code: Select all
amount="-$($second_weapon.damage / 4)"
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
it works perfectly (it was so simple). Thank you!
In testing I found a problem:
Capacity "arcane feeding" heal 2 X damage to arcane. It seems I have tested but I possibly only tested the equivalent with fire (it works). As "arcane feeding" is a copy of "fire life" (with changed names, type of attack ... ), there is no reason that it does not work at the same. Yet rather than heals damage 2X, it heals 4X !
I recently added another ability that uses "arcane feeding" as filter. But it is precisely because the function does not work in this case. This is an event with "die". It should not be added to another, does not it?
So, I changed the code of "arcane feeding" macro, so that instead of repeating the heal operation, I double the amount. I have not changed elsewhere. I no longer heal 4X the amount of damage but 2X double the amount.
I take an example: Before when a ghost touch a celest it harms 2 damage, "2" appears in red, then "2" appears in green 4 times. Now after "2" in red, I have 2 times "4" in green. It is so in this macro the problem is (otherwise I would have a "4" and two "2").
Unit files have this capacity once time.
Who can tell me what causes this doubling effect?
In testing I found a problem:
Capacity "arcane feeding" heal 2 X damage to arcane. It seems I have tested but I possibly only tested the equivalent with fire (it works). As "arcane feeding" is a copy of "fire life" (with changed names, type of attack ... ), there is no reason that it does not work at the same. Yet rather than heals damage 2X, it heals 4X !
I recently added another ability that uses "arcane feeding" as filter. But it is precisely because the function does not work in this case. This is an event with "die". It should not be added to another, does not it?
So, I changed the code of "arcane feeding" macro, so that instead of repeating the heal operation, I double the amount. I have not changed elsewhere. I no longer heal 4X the amount of damage but 2X double the amount.
I take an example: Before when a ghost touch a celest it harms 2 damage, "2" appears in red, then "2" appears in green 4 times. Now after "2" in red, I have 2 times "4" in green. It is so in this macro the problem is (otherwise I would have a "4" and two "2").
Spoiler:
Who can tell me what causes this doubling effect?
Re: Era-of-InvasionS's ability thread
When events are included in unit_type, it is prudent to use an id to prevent duplication.
http://wiki.wesnoth.org/EventWML#Event_IDs
http://wiki.wesnoth.org/EventWML#Event_IDs
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
It work correctly by adding an id to the events.
Thank you again Sapient
Still a problem:
"final flourish": When the unit die it explodes its energy, which hurts all those around, including allies. But as arcane heal those of the same race, it is often beneficial to the allies.
And thus the amount of arcane damage is variable and depends on the indication in the file unit.
[abilities]
{ABILITY_FINAL_FLOURISH_DAMAGE (6)}
[/abilities]
I tested with 6. No worries. But now that I insert the file in the fife of lvl 2 (9 damage) and lvl 3 (12), all units inflict 12 damage of arcane.
At worst, I can do three different abilities, each with a fixed damage.
But it would be better to get one ability with the amount selected for each unit.
Do you see what's wrong and how to fix it?
Thank you again Sapient
Still a problem:
"final flourish": When the unit die it explodes its energy, which hurts all those around, including allies. But as arcane heal those of the same race, it is often beneficial to the allies.
And thus the amount of arcane damage is variable and depends on the indication in the file unit.
[abilities]
{ABILITY_FINAL_FLOURISH_DAMAGE (6)}
[/abilities]
I tested with 6. No worries. But now that I insert the file in the fife of lvl 2 (9 damage) and lvl 3 (12), all units inflict 12 damage of arcane.
At worst, I can do three different abilities, each with a fixed damage.
But it would be better to get one ability with the amount selected for each unit.
Spoiler:
Re: Era-of-InvasionS's ability thread
Spoiler:
Also, you are using a lot of event-based abilities, so I suggest you to stop using this method to load them into the scenario, and to place the events into the era tag (leaving only the dummy tag in the ability macro). You will not have them together, but the code after that the macros are preprocessed will be shorter, they won't need IDs, and it will be easier to add these abilities with objects or advancements.
Re: Era-of-InvasionS's ability thread
Looks like you're using the samefrancophone wrote:But now that I insert the file in the fife of lvl 2 (9 damage) and lvl 3 (12), all units inflict 12 damage of arcane.
id=
for all the events. Try id=final flourish {DAMAGE}
.Re: Era-of-InvasionS's ability thread
Not only that, but you would need to change the ability id as well...
There is another way to do it using a single event, but it would probably be more complicated for you.
There is another way to do it using a single event, but it would probably be more complicated for you.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
"Acane feeding" depends on the resistence of each unit. Most times it's during an attack. I copy the principle and I can not think in this case avoid damage. But as celests are first damaged before being regenerated twice, I think I will keep the same operating here to be consistent and that the animation remains the same (for the same thing).dugi wrote:How about doing it simply so that you don't damage those who have the ability and heal them instead?Spoiler:
If I avoid hurting those with "arcane feeding" (not "final flourish"), I should have amount = inflicted damage (not X2). But there is no damage done. The inflicted damage alows know how much heal according to the resistance to arcane (higher is resistence, less unit absorbs). And therefore, it would not be easier not to hurt units first.
On the other hand I did not understand "amount = $ ({DAMAGE} / 2}" that you add. (?)
I have now 3 ages (era tag) on my era. Soon unbalanced factions will be playable in other ages (somes with celests).dugi wrote:Also, you are using a lot of event-based abilities, so I suggest you to stop using this method to load them into the scenario, and to place the events into the era tag (leaving only the dummy tag in the ability macro). You will not have them together, but the code after that the macros are preprocessed will be shorter, they won't need IDs, and it will be easier to add these abilities with objects or advancements.
8680 wrote:Looks like you're using the sameid=
for all the events. Tryid=final flourish {DAMAGE}
.
OK ! And names for have amount in the description of unit.Sapient wrote:Not only that, but you would need to change the ability id as well...
There is another way to do it using a single event, but it would probably be more complicated for you.
Now it works good.
I have also remove the sound and put it as die sound of unit (with death animation)
Spoiler:
Re: Era-of-InvasionS's ability thread
Making it depend on their resistances is hard. You will have to store all adjacent units (variable=hit_ones in my further code here; index is i), check if the unit has the arcane feeding ability (would be easier if all celestials had this ability), and then heal the amount of $({DAMAGE}*$hit_ones[$i].resistances.arcane) to the unit at $hit_ones[$i].x,$hit_ones[$i].y coordinates for each unit if it has the ability, and hurt it in the classical way if it does not.
$ ({DAMAGE} / 2} is a formula. {DAMAGE} is first substituted by the amount of damage it deals when exploding (say, 15 in this case), and then it looks like this $(15/2), and that is 15 divided by 2 and round (actually, I wanted to multiply instead, as you said multiplied by 2).
If you have 3 eras, then simply put all the events in a macro and place the macro into all three eras. It is still preprocessed quicker than if it was in all units.
Good luck.
$ ({DAMAGE} / 2} is a formula. {DAMAGE} is first substituted by the amount of damage it deals when exploding (say, 15 in this case), and then it looks like this $(15/2), and that is 15 divided by 2 and round (actually, I wanted to multiply instead, as you said multiplied by 2).
If you have 3 eras, then simply put all the events in a macro and place the macro into all three eras. It is still preprocessed quicker than if it was in all units.
Good luck.
Re: Era-of-InvasionS's ability thread
Never put a macro call inside a translateable string: the translation won't work.name= _ "final flourish {DAMAGE}"
female_name= _ "female^final flourish {DAMAGE}"
Instead you could write something like this:
Code: Select all
name= _ "final flourish ("+{DAMAGE}+")"
female_name= _ "female^final flourish ("+{DAMAGE}+")"
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- francophone
- Posts: 393
- Joined: February 20th, 2010, 2:19 pm
Re: Era-of-InvasionS's ability thread
It is still preprocessed quicker than if it was in all unit files.dugi wrote: If you have 3 eras, then simply put all the events in a macro and place the macro into all three eras. It is still preprocessed quicker than if it was in all units.