• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Wtf is this?

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
Simple spell being stupid, works half the time

So this spell:

attachment.php


behaves very odd. It seems to not work most of the time. It ALWAYS works on Berserker units, but the other ones with less HP seem to resist it somehow. I think there is something wrong with my trigger:

**edit** on units that it doesn't work, it still places the buff but doesn't do any damage

  • Lethal Poison 01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ASN-5 Lethal Poison
    • Actions
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 D.ASN-5 Lethal Poison for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of ability being cast)
      • Hashtable - Save ((1.00 x ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))) / (11.00 - (Real((Level of (Ability being cast) for (Triggering unit)))))) as (Key damage) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save (11.00 - (Real((Level of (Ability being cast) for (Triggering unit))))) as (Key duration) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_LethalPoison) Equal to False
        • Then - Actions
          • Unit Group - Add (Target unit of ability being cast) to G_LethalPoison
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Lethal Poison 02 <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Lethal Poison 02 <gen>
        • Else - Actions
  • Lethal Poison 02
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in G_LethalPoison) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in G_LethalPoison and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) Greater than 0.00
                • Then - Actions
                  • Unit - Cause (Load (Key caster) of (Key (Picked unit)) in H_LethalPoison) to damage (Picked unit), dealing ((Load (Key damage) of (Key (Picked unit)) from H_LethalPoison) x R_FRAME_OVERTIME) damage of attack type Hero and damage type Normal
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) - R_FRAME_OVERTIME) as (Key duration) of (Key (Picked unit)) in H_LethalPoison
                • Else - Actions
                  • Unit - Remove ~ASN-5 Lethal Poison (Assassin) buff from (Picked unit)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_LethalPoison
                  • Unit Group - Remove (Picked unit) from G_LethalPoison
        • Else - Actions
          • Trigger - Turn off (This trigger)

*************************

Ok I added debug messages to see when the trigger fucks up and it has me stumped. It isn't considering the unit part of the group, RIGHT AFTER IT ADDS IT!

  • Lethal Poison 01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ASN-5 Lethal Poison
    • Actions
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 D.ASN-5 Lethal Poison for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of ability being cast)
      • Hashtable - Save ((1.00 x ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))) / (11.00 - (Real((Level of (Ability being cast) for (Triggering unit)))))) as (Key damage) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save (11.00 - (Real((Level of (Ability being cast) for (Triggering unit))))) as (Key duration) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_LethalPoison) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: adding
          • Unit Group - Add (Target unit of ability being cast) to G_LethalPoison
        • Else - Actions
          • Game - Display to (All players) the text: in group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Lethal Poison 02 <gen> is on) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: trigger 2 on
          • Trigger - Turn on Lethal Poison 02 <gen>
        • Else - Actions
  • Lethal Poison 02
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in G_LethalPoison) Greater than 0
        • Then - Actions
          • Game - Display to (All players) the text: unit
          • Unit Group - Pick every unit in G_LethalPoison and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) Greater than 0.00
                • Then - Actions
                  • Unit - Cause (Load (Key caster) of (Key (Picked unit)) in H_LethalPoison) to damage (Picked unit), dealing ((Load (Key damage) of (Key (Picked unit)) from H_LethalPoison) x R_FRAME_OVERTIME) damage of attack type Hero and damage type Normal
                  • Game - Display to (All players) the text: dmg
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) - R_FRAME_OVERTIME) as (Key duration) of (Key (Picked unit)) in H_LethalPoison
                • Else - Actions
                  • Game - Display to (All players) the text: 0 duration
                  • Unit - Remove ~ASN-5 Lethal Poison (Assassin) buff from (Picked unit)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_LethalPoison
                  • Unit Group - Remove (Picked unit) from G_LethalPoison
        • Else - Actions
          • Game - Display to (All players) the text: no units
          • Game - Display to (All players) the text: trigger 2 off
          • Trigger - Turn off (This trigger)
attachment.php
 

Attachments

  • lethtip.jpg
    lethtip.jpg
    46.9 KB · Views: 175
  • lethwork.jpg
    lethwork.jpg
    317.1 KB · Views: 83
  • leth2.jpg
    leth2.jpg
    338.3 KB · Views: 75
  • WC3ScrnShot_041510_061204_01.jpg
    WC3ScrnShot_041510_061204_01.jpg
    367.2 KB · Views: 174
Last edited:
The trigger really doesn't seem to have anything wrong with it.
-Side Note: I suggest using a boolean to check if the Unit Group is empty.
  • (G_LethalPoison is empty) Equal to False
I suggest adding debug messages to check if the unit group empties out for some reason.

So, you added debug messages; let me check back.

Hm, something's wrong. Are you sure you don't use the same unit group in some other trigger?
 
Level 8
Joined
Apr 30, 2009
Messages
338
nope, same thing...

it looks like it messes up more often when I cast lethal poison immediately after another ability

-------

nope it's doing it now whenever I cast it on a Summoner hero, works on all others now wtf

-------

Yeah I dunno, sometimes it works and sometimes not.

Map is attached if anyone wants to play test mode, try the Assassin (F3) and combo these skills in a chain:

W - D - Q - X

And Lethal Poison (X) will always fail to damage the unit... I made sure the buffs and everything were unique and it seems like the only part messing up is the unit group

-------

Even looked at the H_LethalPoison and G_LethalPoison in object manager, and they are only used in the relevant triggers
 

Attachments

  • ke.w3x
    384.6 KB · Views: 30
Level 8
Joined
Apr 30, 2009
Messages
338
try going onto the ledge and do it to the summoner, it always fails

---

do you think it has anything to do with the assassin having passive invisibility?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Did you consider armor / armor types or something like that? (The poison includes armor damage reduction and recudes additional damage for anything that resist hero attacks).
The trigger looks fine and shouldn't pick out which units to damage and which not :/

I've never tested triggered damage with passive invis, although it sounds strange (can't really see the problem why it doesn't work on a passive invis unit), try removing the invis and test it again :S

Edit: might want to test Pharao's version first xD
 
Level 8
Joined
Apr 30, 2009
Messages
338
nope it still fails when I attack certain units

---

and the units being attacked have between 0-4 armor, meaning about 17% max reduction. all the armor types are hero and all the damage types are hero for now so it should be 1:1

---

looks like we need maker

batsignal.jpg
 
Level 8
Joined
Apr 30, 2009
Messages
338
yeah and if you notice the berserker spell "bleed out" works the same way and it also fucks up now
 
Tried it with the Unit has buff, didn't work. Seriously, I tried everything. :p
The only thing I can think of and didn't test is setting a Unit Group that picks every unit globally, but not with the action Unit Group - Add (Target unit of ability being cast) to Group, but
  • Trigger
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Set Temp_Group = (Units in (Playable Map Area) matching ((Key(damage) is stored as a Real of (Key(Matching unit)) in LethalHash) Equal to True)
    • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Set Duration = (Load (Key(duration)) of (Key(Picked unit)) from LethalHash
        • Hashtable - Save (Duration - 1.00) as (Key(duration)) of (Key(Picked unit)) in LethalHash
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Duration) Equal to 0.00
          • Then - Actions
            • Hashtable - Clear all child hashtables of (Key(Picked unit)) in LethalHash
          • Else - Actions
    • Custom script: call DestroyGroup (udg_Temp_Group)
 
Level 8
Joined
Apr 30, 2009
Messages
338
I changed the trigger to have trigger 1 the same, except it starts a 0.00-second timer, trigger 2 is just "timer expires - turn on trigger 3." tirgger 3 is old trigger 2. It worked, then I changed it back to the old 2-trigger setup, and now it works.

Do you think it has anything to do with me copying-pasting Bleed Out (a DoT on the Berserker thats is triggered the same) and just changing the fields?
 
Level 8
Joined
Apr 30, 2009
Messages
338
Trigger 1
sets all the values on cast, no change except:
If trigger 3 is not on, then:
-start timer t, expires in 0.00 seconds

Trigger 2
Timer t expires
Then turn on Trigger 3

Trigger 3
the part that was messing up
 
Level 8
Joined
Apr 30, 2009
Messages
338
To be safe I just deleted the hashtables and unit group variables related to both spells and rewrote them without copy/paste. So far it works, and I changed it to be a little more efficient:

  • Bleed Out 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BRS-2 Bleed Out
    • Actions
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 25.00 damage of attack type Hero and damage type Normal
      • Special Effect - Create a special effect at temp_point using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
      • Special Effect - Destroy (Last created special effect)
      • Hashtable - Save 5.00 as (Key duration) of (Key (Target unit of ability being cast)) in H_BRS_BleedOut
      • Hashtable - Save 5.00 as (Key damage) of (Key (Target unit of ability being cast)) in H_BRS_BleedOut
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in H_BRS_BleedOut
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_BRS_BleedOut) Equal to False
        • Then - Actions
          • Unit Group - Add (Target unit of ability being cast) to G_BRS_BleedOut
          • Unit - Create 1 D.BRS-2 Bleed Out for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bleed Out 002 <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on Bleed Out 002 <gen>
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation(udg_temp_point)
  • Bleed Out 002
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (G_BRS_BleedOut is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in G_BRS_BleedOut and do (Actions)
            • Loop - Actions
              • Set temp_real = (Load (Key duration) of (Key (Picked unit)) from H_BRS_BleedOut)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • temp_real Greater than 0.00
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Unit - Cause (Load (Key caster) of (Key (Picked unit)) in H_BRS_BleedOut) to damage (Picked unit), dealing ((Load (Key damage) of (Key (Picked unit)) from H_BRS_BleedOut) x R_FRAME_OVERTIME) damage of attack type Hero and damage type Normal
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\HydraliskImpact\HydraliskImpact.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Hashtable - Save (temp_real - R_FRAME_OVERTIME) as (Key duration) of (Key (Picked unit)) in H_BRS_BleedOut
                • Else - Actions
                  • Unit - Remove ~BRS-2 Bleed Out (Berserker) buff from (Picked unit)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_BRS_BleedOut
                  • Unit Group - Remove (Picked unit) from G_BRS_BleedOut
        • Else - Actions
          • Trigger - Turn off (This trigger)
And I finally rigged the player heroes to have extra regeneration for testing

That was a weird problem, but I guess my theory on (if its right) the copy/paste thing messing them up is like the same problem with spell order IDs and buffs not stacking - maybe the whole GUI editor (including triggering) is coded with stupid handles that aren't really unique?
 
Level 8
Joined
Apr 30, 2009
Messages
338
OMG I FIGURED IT OUT!!!

I had rigged a cheap damage detect to test certain spells with just the "add all units" trick to an eventless trigger, and I used temp_real as the damage. Well guess what - when that happens I guess it saves temp_real as the damage amount OVER the temp_real being used for the duration in these hashtables. Now I am using GDD damage detect system, and it doesn't overwrite.
 
Status
Not open for further replies.
Top