Custom Chain Heal not working

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

I created a custom Chain Heal (I triggered the whole ability). This is how I did it:

Trigger:
  • Chain Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Chain Heal
          • (Ability being cast) Equal to Chain Heal (Instant)
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Point[1] = (Position of Caster)
      • Set Point[2] = (Position of Target)
      • Unit Group - Add Target to UnitGroup[1]
      • Lightning - Create a Healing Wave - Primary lightning effect from source Point[1] to target Point[2]
      • Lightning - Destroy (Last created lightning effect)
      • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
      • Set Healing = (Random real number between 250.00 and 275.00)
      • Set SpellPower_Percent = 0.33
      • Trigger - Run Spell Power <gen> (checking conditions)
      • Trigger - Run Critical Strike <gen> (checking conditions)
      • Unit - Set life of Target to ((Life of Target) + Healing)
      • Trigger - Run Healing Text <gen> (checking conditions)
      • Set UnitGroup[2] = (Units within 600.00 of Point[2] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True)) and ((((Matching unit) is in UnitGroup[1]) Equal to False) and ((Life of (Matching unit)) Les
      • Set UnitGroup[3] = (Random 1 units from UnitGroup[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (UnitGroup[3] is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in UnitGroup[3] and do (Actions)
            • Loop - Actions
              • Set Target = (Picked unit)
              • Set Point[3] = (Position of Target)
              • Unit Group - Add Target to UnitGroup[1]
              • Lightning - Create a Healing Wave - Primary lightning effect from source Point[2] to target Point[3]
              • Lightning - Destroy (Last created lightning effect)
              • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Set Healing = (Random real number between 250.00 and 275.00)
              • Set SpellPower_Percent = 0.33
              • Trigger - Run Spell Power <gen> (checking conditions)
              • Trigger - Run Critical Strike <gen> (checking conditions)
              • Set Healing = (Healing x 0.60)
              • Unit - Set life of Target to ((Life of Target) + Healing)
              • Trigger - Run Healing Text <gen> (checking conditions)
          • Set UnitGroup[4] = (Units within 600.00 of Point[3] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True)) and ((((Matching unit) is in UnitGroup[1]) Equal to False) and ((Life of (Matching unit)) Les
          • Set UnitGroup[5] = (Random 1 units from UnitGroup[4])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UnitGroup[5] is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in UnitGroup[5] and do (Actions)
                • Loop - Actions
                  • Set Target = (Picked unit)
                  • Set Point[4] = (Position of Target)
                  • Unit Group - Add Target to UnitGroup[1]
                  • Lightning - Create a Healing Wave - Primary lightning effect from source Point[3] to target Point[4]
                  • Lightning - Destroy (Last created lightning effect)
                  • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
                  • Set Healing = (Random real number between 250.00 and 275.00)
                  • Set SpellPower_Percent = 0.33
                  • Trigger - Run Spell Power <gen> (checking conditions)
                  • Trigger - Run Critical Strike <gen> (checking conditions)
                  • Set Healing = (Healing x 0.36)
                  • Unit - Set life of Target to ((Life of Target) + Healing)
                  • Trigger - Run Healing Text <gen> (checking conditions)
            • Else - Actions
        • Else - Actions


My problems are:
1 - Same target are some times healed twice.
2 - The lightning effects doesn't show up.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Leak central man! All those groups you use need to be removed like this:
Trigger:
  • Custom Script: call DestroyGroup(udg_UnitGroup[1])

You also need to destroy your special effect immediately after you create it, it will still play the death animation (or if it only has one animation, then that one) and then destroy itself so no memory is leaked.

Your lightning won't show if you destroy it immediately after creating it, set each one to a variable and at the end of the trigger, add a wait and then destroy all your lightning effects.

Also, instead of using "Random 1 units from unit group", create a unit variable and then do this: "Set Unit = Random Unit from Unit Group" and then just use that variable when referring to that unit. Then instead of "Is Unit Group Empty = false", check if "Unit not equal to No Unit".

Finally, why are you running all those other triggers in the meantime? If any of them have waits in them, it will only cause trouble!
 

Leazy

You can change this now in User CP.
Reaction score
50
Thanks for the help, I was a bit lazy but have now fixed all leaks (except for the special effects, some funky yellow glow appears after destroying the Healing Wave effect). The same target is still healed twice some times. None of the triggers running in the meantime have waits.

Trigger:
  • Chain Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Chain Heal
          • (Ability being cast) Equal to Chain Heal (Instant)
    • Actions
      • Custom script: local lightning array Beam
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Point[1] = (Position of Caster)
      • Set Point[2] = (Position of Target)
      • Unit Group - Add Target to UnitGroup[1]
      • Lightning - Create a Healing Wave - Primary lightning effect from source Point[1] to target Point[2]
      • Custom script: set Beam[1] = GetLastCreatedLightningBJ()
      • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
      • Set Healing = (Random real number between 250.00 and 275.00)
      • Set SpellPower_Percent = 0.33
      • Trigger - Run Spell Power <gen> (checking conditions)
      • Trigger - Run Critical Strike <gen> (checking conditions)
      • Trigger - Run Riptide Chain Heal <gen> (checking conditions)
      • Unit - Set life of Target to ((Life of Target) + Healing)
      • Trigger - Run Healing Text <gen> (checking conditions)
      • Trigger - Run Natures Swiftness Remove <gen> (checking conditions)
      • Set UnitGroup[2] = (Units within 600.00 of Point[2] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True)) and ((((Matching unit) is in UnitGroup[1]) Equal to False) and ((Life of (Matching unit)) Les
      • Set Target = No unit
      • Set Target = (Random unit from UnitGroup[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Target Not equal to No unit
        • Then - Actions
          • Set Point[3] = (Position of Target)
          • Unit Group - Add Target to UnitGroup[1]
          • Lightning - Create a Healing Wave - Primary lightning effect from source Point[2] to target Point[3]
          • Custom script: set Beam[2] = GetLastCreatedLightningBJ()
          • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
          • Set Healing = (Random real number between 250.00 and 275.00)
          • Set SpellPower_Percent = 0.33
          • Trigger - Run Spell Power <gen> (checking conditions)
          • Trigger - Run Critical Strike <gen> (checking conditions)
          • Set Healing = (Healing x 0.60)
          • Unit - Set life of Target to ((Life of Target) + Healing)
          • Trigger - Run Healing Text <gen> (checking conditions)
          • Set UnitGroup[3] = (Units within 600.00 of Point[3] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True)) and ((((Matching unit) is in UnitGroup[1]) Equal to False) and ((Life of (Matching unit)) Les
          • Set Target = No unit
          • Set Target = (Random unit from UnitGroup[3])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Target Not equal to No unit
            • Then - Actions
              • Set Point[4] = (Position of Target)
              • Unit Group - Add Target to UnitGroup[1]
              • Lightning - Create a Healing Wave - Primary lightning effect from source Point[3] to target Point[4]
              • Custom script: set Beam[3] = GetLastCreatedLightningBJ()
              • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Set Healing = (Random real number between 250.00 and 275.00)
              • Set SpellPower_Percent = 0.33
              • Trigger - Run Spell Power <gen> (checking conditions)
              • Trigger - Run Critical Strike <gen> (checking conditions)
              • Set Healing = (Healing x 0.36)
              • Unit - Set life of Target to ((Life of Target) + Healing)
              • Trigger - Run Healing Text <gen> (checking conditions)
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation (udg_Point[1])
      • Custom script: call RemoveLocation (udg_Point[2])
      • Custom script: call RemoveLocation (udg_Point[3])
      • Custom script: call RemoveLocation (udg_Point[4])
      • Custom script: call DestroyGroup (udg_UnitGroup[1])
      • Custom script: call DestroyGroup (udg_UnitGroup[2])
      • Custom script: call DestroyGroup (udg_UnitGroup[3])
      • Wait 1.00 seconds
      • Custom script: call DestroyLightning( Beam[1] )
      • Custom script: call DestroyLightning( Beam[2] )
      • Custom script: call DestroyLightning( Beam[3] )
 

hopy

Active Member
Reaction score
64
1 - Same target are some times healed twice.
This can be prevented by something like adding the units that have been healed to a unit group and preventing the trigger from healing people in that unit group. Also make sure you prevent the trigger from looping more times than there are units in the area to be healed.

2 - The lightning effects doesn't show up.
That's because the lightning effect gets removed instantly, it gets created and destroyed in about 0.01 seconds. :p

3 - My game lags afther about 5 casts of this spell.
It leaks. :D :D :D

Right, the spell (heal) bounces to two more targets right? So heals a total of 3 people?
Trigger:
  • Chain Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Chain Heal
          • (Ability being cast) Equal to Chain Heal (Instant)
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Point[1] = (Position of Caster)
      • Set Point[2] = (Position of Target)
      • Lightning - Create a Healing Wave - Primary lightning effect from source Point[1] to target Point[2]
      • Set Lightning Effect[1] = (Last created lightning effect)
      • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set Healing = (Random real number between 250.00 and 275.00)
      • Set SpellPower_Percent = 0.33
      • Trigger - Run Spell Power <gen> (checking conditions)
      • Trigger - Run Critical Strike <gen> (checking conditions)
      • Unit - Set life of Target to ((Life of Target) + Healing)
      • Trigger - Run Healing Text <gen> (checking conditions)
      • Set UnitGroup[1] = (Units within 600.00 of Point[2] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True)) and ((((Matching unit) is equal to Target) Equal to False) and ((Life of (Matching unit)) Les
      • If ((Number of units in Unit_Group[1]) Greater than 2) then do (Set Interger = 2) else do (Set Interger = (Number of units in Unit_Group[1]))
      • For each (Integer A) from 1 to Interger, do (Actions)
        • Loop - Actions
          • Set UnitGroup[2] = (Random 1 units from UnitGroup[1])
          • Unit Group - Pick every unit in UnitGroup[2] and do (Actions)
            • Loop - Actions
              • Set Target = (Picked unit)
              • Set Point[3] = (Position of Target)
              • Unit Group - Remove (Picked unit) from Unit_Group[1]
              • Lightning - Create a Healing Wave - Primary lightning effect from source Point[2] to target Point[3]
              • Set Lightning Effect[(Intreger A) + 1] = (Last created lightning effect)
              • Special Effect - Create a special effect attached to the origin of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set Healing = (Random real number between 250.00 and 275.00)
              • Set SpellPower_Percent = 0.33
              • Trigger - Run Spell Power <gen> (checking conditions)
              • Trigger - Run Critical Strike <gen> (checking conditions)
              • For each (Integer B) from 1 to (Integer A), do (Actions)
                • Loop - Actions
                  • Set Healing = (Healing x 0.60)
              • Unit - Set life of Target to ((Life of Target) + Healing)
              • Trigger - Run Healing Text <gen> (checking conditions)
              • Custom script: call RemoveLocation (udg_Point[3])
          • Custom script: call DestroyGroup (udg_Unit_Group[2])
      • Countdown Timer - Start Lightning Effects as a One-shot timer that will expire in 1.00 seconds
      • Custom script: call DestroyGroup (udg_Unit_Group[1])
      • Custom script: call RemoveLocation (udg_Point[2])
      • Custom script: call RemoveLocation (udg_Point[1])

There we go, Shorter, leakless and should be working 100% fine. :)

As for the timer/lightning effects:
Trigger:
  • Destroy Lightning
    • Events
      • Time - Lightning expires
    • Conditions
    • Actions
      • Lightning - Destroy Lightning Effect[1]
      • Lightning - Destroy Lightning Effect[2]
      • Lightning - Destroy Lightning Effect[3]


Something like that... Please keep in mind that this is hand typed for most part. Hope it helped, and please let me know if there's anything that doesn't work or you don't understand.

=======EDIT=======
I've found the reason why it healed the same targets more than once:
You added all units into Unit_Group[2] and than picked a unit from Unit_Group[2], since the picked unit didn't get removed from Unit_Group[2] and Unit_Group[2] didn't get set again without the already picked unit it was posible for it to be picked again in the 2nd or 3rd wave.
*Points at trigger* "Unit Group - Remove (Picked unit) from Unit_Group[1]" "(Matching unit) is equal to Target Equal to False".

=======/EDIT=======
 

Leazy

You can change this now in User CP.
Reaction score
50
How can that be the problem? I make a new unitgroup both times, and add all units healed to unit group 1, no units in unit group 1 should be healed? =O
 

hopy

Active Member
Reaction score
64
How can that be the problem? I make a new unitgroup both times, and add all units healed to unit group 1, no units in unit group 1 should be healed? =O

No, you're right I'm sorry... I didn't notice the "Set UnitGroup[3] = Blahblah" part of the trigger. I'll take another look and see if I can find out why.
I'm pretty sure it doesn't do that with my trigger though... shouldn't anyways... <,<
 

Leazy

You can change this now in User CP.
Reaction score
50
Thank you DARKGANDALF, but I would very much want to know what's wrong with my trigger :)
 

Whoareyou.

New Member
Reaction score
24
Would looking at his custom chain heal trigger help? Cuz he even said for you if needed to look at it.
 

Leazy

You can change this now in User CP.
Reaction score
50
Of course I looked at it, but he used such a different way of doing this than I did, but still used the same key elements I did, so it didn't really help me out.
 

Leazy

You can change this now in User CP.
Reaction score
50
@ Spartan:

Of course! Great idea :) I actually tried something similar to start with, I used Chain Lightning and did what you said, but chain lightning couldn't probably target allies disregarding of targets allowed. I didn't ever think of Healing Wave.

Thanks m8! :) +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top