• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Channel Ability that has damage&heal over time

Status
Not open for further replies.
Level 1
Joined
Apr 15, 2010
Messages
3
Hello im new here and just started trigger stuff by myself. Im currently struggling with my custom ability that deals damage over time to enemies and heals allies over time.

The ability is a point target and it heals ally units within range and deals damage to enemies within range for 8 seconds.



HZ4ASSv.png


C04uQUC.png


nOmPuwm.png


ThankyouinAdvance !
P.S Dont mind my join date i just use my friend account.
 
Level 9
Joined
Feb 15, 2013
Messages
372
For the Casting Trigger, BubbleVoiceHeal all is index as [1]? change to [1][2][3][4]

For the 2nd trigger, change to periodic timer (Every (x) second)

EDIT: Don't heal them by %, heal them by Hp of Unit + Hp Amount without the (%)
EDIT2: Is this skill simillar to HoN's one? the music thing xD
 
Level 25
Joined
Sep 26, 2009
Messages
2,387
Hello.
First of all, you should wait 48 hours before bumping your thread - not a few minutes.
Second: while it's not bad to post pictures, you can easily post the entire trigger using [TRIGGER]*trigger code[/TRIGGER] tags. Check this thread: http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/

The spell looks relatively correct, although there is a lot of space for improvement.

Let's take a look at what can be done with the triggers you posted:
Improvements
1) BubbleVoiceCaster - instead of using (Casting unit) use (Triggering unit) only. It's better and more efficient in many ways.
2) BubbleVoiceDamage and BubbleVoiceHeal - these don't have to be used at all. First of all, the BubbleVoiceHeal saves everything under index 1, so level one heals 60 hp per second while levels 2, 3 and 4 would heal 0 hp. That aside, you don't even need those arrays, because you can easily calculate the amount of damage and heal. In your case, the formula for damage is: [20 * (level of ability)]; and for heal: [15 * (level of ability)].
No need to save those values.
3)** I can't really comment on this one since I don't know what it does - the Bubble Voice Damage ability add to the Bubble Voice dummy: is it an active or passive ability? If active, you need to order the dummy to cast the spell.

4) In the second trigger change the event from "Elapsed game time" to periodic event "Every... seconds"
5) In second trigger where you heal allies, you set life to %, not life to value. So basically if unit had 50 hp out of 500, then the one tick of level 2 heal would set its life to 50+30 as percent... so 80% out of 500 is 400. Instead of healing 30 health, the unit would heal 350 hp.

6) In third trigger change (Dying unit) for (Triggering unit). The reasoning is the same like for (Casting unit)
7) It's better efficiency-wise if you also save the dummy unit you created in first trigger into a variable. For example a variable called BubbleVoiceDummy and use that variable for all actions related to the dummy in first trigger and for the condition in third trigger.

Memory leaks
Currently your triggers have 3 memory leaks:
1) BubbleVoicePoint - you never destroy this location after you're done using it. Destroying this point should be the last action in the first trigger.
2) BubbleVoiceGroup = (Units within 500.00 of (Position of (Last created unit)... - the red part is a memory leak as well. Use here the BubbleVoicePoint you set up earlier.
3) BubbleVoiceGroup - you never destroy this group after you're done using it. You should destroy it in the third trigger, when the spell ends.

Check this thread: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/ to see how to destroy unit groups and locations.

Possible bug
Since the spell's duration is dependent on the life of the dummy unit, the caster can move and do other stuff once he casts the spell.
If this is not an intended behaviour, another trigger should be created that checks if the caster stops casting the ability and if so, kill the dummy unit.


-----------
Now there's one more thing concerning the unit group: I don't know which way you want your spell to work, here are two concepts:
1) When unit casts the spell, all allies and enemies within range are selected and add into unit group. These units will be then periodically damaged (enemies) and healed (allies). For example an enemy picked into this group could teleport to his home base and thus be on the other side of the map, yet he would still take damage from this ability because he was add to the unit group. On the other hand, if the caster casts the spell and some time later an enemy (who was far away) comes close to the caster, he won't suffer any damage at all, since he wasn't close by when the caster initiated the spell.

2) When unit casts the spell, then every time the spell ticks for damage and heal, all units withing certain radius of the target point of the ability will be picked and damage and healed. So basically if units stand close to the point, they will be healed/damaged, but if they move away, the spell won't have any effect on them.

Currently, your spell supports the option 1), but imo it would make a lot more sense if it supported option 2) instead.

-------
Last thing: Currently, the spell can be used by one unit at a time in the entire game. If another unit casts the spell while some unit is already in the process of casting it, the spell will bug.

There are three ways to code the spell:
1) non-MUI/non-MPI: That's what you have right now. Only a single unit at a time can cast this spell. If the caster can be only one hero in the entire map, then it's ok to have the spell coded this way.
2) MPI (multi player instancibility): This means that only one unit per player can cast the spell at the same time. E.g. if player blue's, player red's and player yellow's heroes cast the spell at same time then everything works fine. However if two player blue's units cast the spell at same time, the splell will bug.
3) MUI (multi unit instancibility): This means that any ammount of units, no matter the player, can cast the spell at the same time. If coded correctly, the spell should never bug out.

In terms of complexity to code the spell it's in the order I presented the three types: the easiest is non-MUI/non-MPI -> more complex: MPI -> most complex: MUI.
 
Level 1
Joined
Apr 15, 2010
Messages
3
for the casting trigger, bubblevoiceheal all is index as [1]? Change to [1][2][3][4]

for the 2nd trigger, change to periodic timer (every (x) second)

edit: Don't heal them by %, heal them by hp of unit + hp amount without the (%)
edit2: Is this skill simillar to hon's one? The music thing xd

heyyy !! How come u know xd

Hello.
First of all, you should wait 48 hours before bumping your thread - not a few minutes.
Second: while it's not bad to post pictures, you can easily post the entire trigger using [TRIGGER]*trigger code[/TRIGGER] tags. Check this thread: http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/

The spell looks relatively correct, although there is a lot of space for improvement.

Let's take a look at what can be done with the triggers you posted:
Improvements
1) BubbleVoiceCaster - instead of using (Casting unit) use (Triggering unit) only. It's better and more efficient in many ways.
2) BubbleVoiceDamage and BubbleVoiceHeal - these don't have to be used at all. First of all, the BubbleVoiceHeal saves everything under index 1, so level one heals 60 hp per second while levels 2, 3 and 4 would heal 0 hp. That aside, you don't even need those arrays, because you can easily calculate the amount of damage and heal. In your case, the formula for damage is: [20 * (level of ability)]; and for heal: [15 * (level of ability)].
No need to save those values.
3)** I can't really comment on this one since I don't know what it does - the Bubble Voice Damage ability add to the Bubble Voice dummy: is it an active or passive ability? If active, you need to order the dummy to cast the spell.

4) In the second trigger change the event from "Elapsed game time" to periodic event "Every... seconds"
5) In second trigger where you heal allies, you set life to %, not life to value. So basically if unit had 50 hp out of 500, then the one tick of level 2 heal would set its life to 50+30 as percent... so 80% out of 500 is 400. Instead of healing 30 health, the unit would heal 350 hp.

6) In third trigger change (Dying unit) for (Triggering unit). The reasoning is the same like for (Casting unit)
7) It's better efficiency-wise if you also save the dummy unit you created in first trigger into a variable. For example a variable called BubbleVoiceDummy and use that variable for all actions related to the dummy in first trigger and for the condition in third trigger.

Memory leaks
Currently your triggers have 3 memory leaks:
1) BubbleVoicePoint - you never destroy this location after you're done using it. Destroying this point should be the last action in the first trigger.
2) BubbleVoiceGroup = (Units within 500.00 of (Position of (Last created unit)... - the red part is a memory leak as well. Use here the BubbleVoicePoint you set up earlier.
3) BubbleVoiceGroup - you never destroy this group after you're done using it. You should destroy it in the third trigger, when the spell ends.

Check this thread: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/ to see how to destroy unit groups and locations.

Possible bug
Since the spell's duration is dependent on the life of the dummy unit, the caster can move and do other stuff once he casts the spell.
If this is not an intended behaviour, another trigger should be created that checks if the caster stops casting the ability and if so, kill the dummy unit.


-----------
Now there's one more thing concerning the unit group: I don't know which way you want your spell to work, here are two concepts:
1) When unit casts the spell, all allies and enemies within range are selected and add into unit group. These units will be then periodically damaged (enemies) and healed (allies). For example an enemy picked into this group could teleport to his home base and thus be on the other side of the map, yet he would still take damage from this ability because he was add to the unit group. On the other hand, if the caster casts the spell and some time later an enemy (who was far away) comes close to the caster, he won't suffer any damage at all, since he wasn't close by when the caster initiated the spell.

2) When unit casts the spell, then every time the spell ticks for damage and heal, all units withing certain radius of the target point of the ability will be picked and damage and healed. So basically if units stand close to the point, they will be healed/damaged, but if they move away, the spell won't have any effect on them.

Currently, your spell supports the option 1), but imo it would make a lot more sense if it supported option 2) instead.

-------
Last thing: Currently, the spell can be used by one unit at a time in the entire game. If another unit casts the spell while some unit is already in the process of casting it, the spell will bug.

There are three ways to code the spell:
1) non-MUI/non-MPI: That's what you have right now. Only a single unit at a time can cast this spell. If the caster can be only one hero in the entire map, then it's ok to have the spell coded this way.
2) MPI (multi player instancibility): This means that only one unit per player can cast the spell at the same time. E.g. if player blue's, player red's and player yellow's heroes cast the spell at same time then everything works fine. However if two player blue's units cast the spell at same time, the splell will bug.
3) MUI (multi unit instancibility): This means that any ammount of units, no matter the player, can cast the spell at the same time. If coded correctly, the spell should never bug out.

In terms of complexity to code the spell it's in the order I presented the three types: the easiest is non-MUI/non-MPI -> more complex: MPI -> most complex: MUI.

The MUI advice looks complicated but ill try to look at it thanks for the advice sir :)
 
Last edited by a moderator:
Status
Not open for further replies.
Top