Spell not working...

RedSword

New Member
Reaction score
4
Hi, I made an ability based of Command Aura (but the ability isn't an aura anymore) that makes that everytime a unit hit something, friendly unit beside the hero (which have the command aura buff named "Divine Hammer") get healed, but I tryed my trigger and it isn't working. Here it is :

JASS:
Divine Hammer
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) has buff Divine Hammer ) Equal to True
        ((Attacked unit) is A ground unit) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Divine Hammer  for (Attacking unit)) Equal to 1
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 100
                    Then - Actions
                        Set Temp_Point = (Position of (Attacking unit))
                        Set Temp_Group = (Units within 200.00 of Temp_Point matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True))
                        Unit Group - Pick every unit in Temp_Group and do (Actions)
                            Loop - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 50.00)
                                Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
                                Set Temp_Point2 = (Position of (Picked unit))
                                Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation(udg_Temp_Point2)
                        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - 60.00)
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                        Custom script:   call RemoveLocation(udg_Temp_Point)
                    Else - Actions
                        Do nothing
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 100
                    Then - Actions
                        Set Temp_Point = (Position of (Attacking unit))
                        Set Temp_Group = (Units within ((Real((Level of Divine Hammer  for (Attacking unit)))) + 125.00) of Temp_Point matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True))
                        Unit Group - Pick every unit in Temp_Group and do (Actions)
                            Loop - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((Real((Level of Divine Hammer  for (Attacking unit)))) x 50.00) - 50.00))
                                Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
                                Set Temp_Point2 = (Position of (Picked unit))
                                Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation(udg_Temp_Point2)
                        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - (((Real((Level of Divine Hammer  for (Attacking unit)))) x 50.00) - 40.00))
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                        Custom script:   call RemoveLocation(udg_Temp_Point)
                    Else - Actions
                        Do nothing


I'd appreciate if you could tell me what's wrong and if there is any leak,

RedSword
 

ArmedCitizen

Kisses Cats
Reaction score
198
Code:
Set Temp_Group = (Units within ((Real((Level of Divine Hammer  for (Attacking unit)))) + 125.00) of Temp_Point matching (([B][I][U](Picked unit)[/U][/I][/B] belongs to an ally of (Owner of (Attacking unit))) Equal to True))

Set Temp_Group = (Units within 200.00 of Temp_Point matching (([B][I][U](Picked unit) [/U][/I][/B]belongs to an ally of (Owner of (Attacking unit))) Equal to True))

Huh try changing those to Matching unit. Might work then.
 

RedSword

New Member
Reaction score
4
Ewww lol big mistake, thanks, it work now.

EDIT : Since my paladin has a big slow hammer, is it possible to detect the "on-hit" attack, and not the "right click" when beside the target ?

Re-EDIT : And in that case, does the triggering unit is the attacker or the attacked ?, And why Am I seeing no effect (special effect) when my ability is triggered (I tryed 2 different, none shown), and why sometimes, when no allies unit are beside im still getting healed ? (I put trigger to remove heal healed, but the amount given by allied unit beside the Paladin is buggy)
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
It's hard for me to understand you, but the question that I got is

>Since my paladin has a big slow hammer, is it possible to detect the "on-hit" attack, and not the "right click" when beside the target ?

Yes, it is called "unit takes damage" and it is in the "specific unit event" Event. Since it is a specific unit event, you are going to have to add it to the trigger with another trigger which would look something like this

Code:
Trigger 1
    Events
          Time elapsed is 1 second
    Conditions
    Actions
         Set TempUnitGroup = all units in playable map area
         Pick every unit in TempUnitGroup and do:
              Trigger - add event ((picked unit) takes damage to <your trigger>)
         custom script: call DestroyGroup (udg_TempUnitGroup)
 

RedSword

New Member
Reaction score
4
Should I use this ? :
JASS:
Divine Hammer Inititation
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Paladin
        ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    Actions
        Trigger - Add to Divine Hammer &lt;gen&gt; the event (Unit - (Attacked unit) Takes damage)


Because it's look more simplier, and I don't need to take all a group.

Thx btw Knock for giving me consciousness of "add event" trigger, but shouldn't adding the event give unlimited one if repeted ? Like the death unit attacked would leak ?
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
I made a similar mistake

if your trigger causes the damage source to damage another unit, then you get an infinite loop

so you have to do something like this

(turn off this trigger)
Damage Source Damages Target
(turn on this trigger)
 

RedSword

New Member
Reaction score
4
But if I do "every sec..." ... add event ... picked unit, wouldn't the fact that the trigger have more and more events, would makes some lag at a given time ?
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
I'm not quite sure what you mean, could you post your trigger?
The periodic one
 

RedSword

New Member
Reaction score
4
It is just, I'm wondering if that if I do ur trigger :

JASS:
Trigger 1
    Events
          Time elapsed is 1 second //<b> HERE !!</b>
    Conditions
    Actions
         Set TempUnitGroup = all units in playable map area
         Pick every unit in TempUnitGroup and do:
              Trigger - add event ((picked unit) takes damage to &lt;your trigger&gt;)
         custom script: call DestroyGroup (udg_TempUnitGroup)


I was just wondering, that if I put in the event (alias HERE !!) something periodic (let's say every second) , then the periodic time would add event of all the picked unit... and the second time the trigger would execute itself when there gonna be more unit, the other trigger would have more event, so let's say after 1 hour of gaming (and every 20 sec a bunch of units spawn), my others triggers should have thousand of events.... would that lag ?
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
THAT will

what you could do instead, with spawns, you could make the add event another trigger where the event for that is Unit enters playable map area

Code:
E - unit enters playable map area
C - 
A - add (entering unit) takes damage to <your trigger>
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> But does "add event" trigger leak or create leak ?

Well, not really.
But kind of.
It does take space to store all of those events....

However, unless you have an absolute TON of units, it won't make a difference.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> how could I remove these leak ?

Actually, I'm not too sure. I'm not an expert here....

However, if you destroyed the trigger, that should theoretically get rid of the space being taken up in memory.
 

RedSword

New Member
Reaction score
4
Does this would work ?

JASS:
Divine Hammer Inititation
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Paladin
        ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    Actions
        Trigger - Remove (This trigger) from the trigger queue
        Trigger - Add to Divine Hammer &lt;gen&gt; the event (Unit - (Attacked unit) Takes damage)


I mean by this that all event would be cleared.

EDIT : Hey I guess this would work ?

JASS:
Divine Hammer Inititation
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Paladin
        ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    Actions
        Set Temp_Trigger = Divine Hammer &lt;gen&gt;
        Trigger - Add to Temp_Trigger the event (Unit - (Attacked unit) Takes damage)
        Custom script:   call DestroyTrigger(udg_Temp_Trigger)


Does stored trigger-variable can be call by normal event ?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
No. Removing it from the queue doesn't work.
If you wanted to destroy it, you would have to use Custom Scripts at least.
And then you would have to re-create the trigger and all its events, conditions, and actions. In-game.
It wouldn't be a piece of cake.

My suggestion:

Try it the way it is first.
If it's REALLY a problem, you can go to more drastic measures.
 

RedSword

New Member
Reaction score
4
Tested and work =D

JASS:
Divine Hammer Inititation
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Paladin
        ((Attacking unit) has buff Divine Hammer ) Equal to True
        ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
        ((Attacked unit) is A structure) Equal to False
    Actions
        Set Temp_Trigger = Divine Hammer &lt;gen&gt;
        Trigger - Add to Temp_Trigger the event (Unit - (Attacked unit) Takes damage)
        Trigger - Run Temp_Trigger (checking conditions)


And since the Variable is the trigger and it is reset there shouldn't be anyleak =D, thx to helper (Knock and Ghan).
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> since the Variable is the trigger and it is reset there shouldn't be anyleak

Well, no. I don't think that's technically correct. The problem will still be there.
Because the trigger will still be gaining more and more events.
However, I doubt it will be an issue.
 

RedSword

New Member
Reaction score
4
Yes but the trigger is the variable, and the variable is reset to the base trigger...

Other "wonderation" in my spell, is this :

JASS:
Divine Hammer
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Divine Hammer  for (Attacking unit)) Equal to 1
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 100
                    Then - Actions
                        Set Temp_Point = (Position of (Attacking unit))
                        Set Temp_Group = (Units within 200.00 of Temp_Point matching ((((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
                        <b>Unit Group - Pick every unit in Temp_Group and do (Actions)
                            Loop - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 50.00)
                                Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
                                Set Temp_Point2 = (Position of (Picked unit))
                                Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
                                Wait for (Last played sound) to be 0.00 seconds from finished playing
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation(udg_Temp_Point2)</b>
                        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - 60.00)
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                        Custom script:   call RemoveLocation(udg_Temp_Point)
                    Else - Actions
                        Do nothing
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Less than or equal to 100
                    Then - Actions
                        Set Temp_Point = (Position of (Attacking unit))
                        Set Temp_Group = (Units within ((Real((Level of Divine Hammer  for (Attacking unit)))) + 125.00) of Temp_Point matching ((((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
                        <b>Unit Group - Pick every unit in Temp_Group and do (Actions)
                            Loop - Actions
                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((Real((Level of Divine Hammer  for (Attacking unit)))) x 50.00) - 50.00))
                                Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
                                Set Temp_Point2 = (Position of (Picked unit))
                                Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
                                Wait for (Last played sound) to be 0.00 seconds from finished playing
                                Special Effect - Destroy (Last created special effect)
                                Custom script:   call RemoveLocation(udg_Temp_Point2)</b>
                        Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - (((Real((Level of Divine Hammer  for (Attacking unit)))) x 50.00) - 40.00))
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                        Custom script:   call RemoveLocation(udg_Temp_Point)
                    Else - Actions
                        Do nothing

Leakless ? (I'm mostly talking about the "Last created special effect"), because I had a trouble about making them work correctly. (SFX are in the Loop, the farter on the right)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Yes but the trigger is the variable, and the variable is reset to the base trigger...

Doesn't matter. Nothing happens to the trigger itself.

> Leakless ?

Looks pretty good.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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