• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Mysterious perma stun bug still not solved...

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
856
Well I've been posting this bug before but didn't get some clear help to find out what was wrong with this spell because it seems to for some unknown reason pick a random unit doesn't matter if it's allied, enemy or self it just picks a random unit in the target area and stunning it forever until it's killed. The spell is meant to knockback enemy units in the targeted area and stunning the during the short time they are knocked back and it seems to work fine except the mysterious perma stunning bug which doesn't happening everytime the spell is casted it actually happening only some few times during a gameplay like 15% times the spell is casted but still it's very annoying and ruins the gameplay alot... I just don't get how it can perma stunning the allies and even the casting hero o_O The spell is meant to only pick and target enemy units in the targeted area so why does it for some unknown reason still sometimes like 15% times the spell is casted, picking an allied unit or self if it's in the targeted area of the spell and perma stunning it forever until it's killed?? I haven't made this spell by myself and I'm kinda noobish at triggering :-/ So what could be the cause of this mysterious perma stunning bug? Please someone help! This gotta be solve for once...

This is the triggers of the spell.
  • Invisible Force
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Invisible Force
    • Actions
      • Set TempLoc1 = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 350.00 of TempLoc1) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is dead) Equal to False
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Set TempUnit1 = (Picked unit)
              • Set TempLoc2 = (Position of TempUnit1)
              • Custom script: set udg_TempInt1 = GetHandleId(udg_TempUnit1)
              • -------- Deal Damage --------
              • Unit - Cause (Triggering unit) to damage TempUnit1, dealing (Real(((Level of Invisible Force for (Triggering unit)) x (Intelligence of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Magic
              • -------- Stun Unit --------
              • Set SS_Unit_Target = TempUnit1
              • Set SS_Real_Duration = 1.00
              • Set SS_Boolean_Stack = False
              • Set SS_Real_Distance = (Random real number between 1.00 and 300.00)
              • Custom script: call ExecuteFunc("StunSystem_Run")
              • -------- Add Knockback --------
              • Special Effect - Create a special effect attached to the origin of TempUnit1 using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of TempInt1 in Knockback_Hash
              • Hashtable - Save 0.00 as (Key loop) of TempInt1 in Knockback_Hash
              • Hashtable - Save 0.00 as (Key offset) of TempInt1 in Knockback_Hash
              • Hashtable - Save (Angle from TempLoc1 to TempLoc2) as (Key angle) of TempInt1 in Knockback_Hash
              • Unit Group - Add TempUnit1 to Knockback_Group
              • Custom script: call RemoveLocation(udg_TempLoc2)
              • Trigger - Turn on Knockback <gen>
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc1)
  • Knockback Initialize
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Knockback_Hash = (Last created hashtable)
      • -------- -------------------- --------
      • -------- -------------------- --------
      • -------- How long the knockback lasts in seconds --------
      • -------- -------------------- --------
      • Set Knockback_Time = 1.00
      • -------- -------------------- --------
      • -------- Initial speed of the knockback --------
      • -------- -------------------- --------
      • Set Knockback_Speed = 30.00
      • -------- -------------------- --------
      • -------- Does the spell do damage over time --------
      • -------- -------------------- --------
      • Set Knockback_DoT = False
      • -------- -------------------- --------
      • -------- Does the ability add special effect on the unit --------
      • -------- -------------------- --------
      • Set Knockback_Effect = False
      • -------- -------------------- --------
      • -------- Do units rotate while knocked back --------
      • -------- -------------------- --------
      • Set Knockback_Rotate = True
      • -------- -------------------- --------
      • -------- If this is true, the spell pushes, if false, it pulls --------
      • -------- -------------------- --------
      • Set Knockback_Push = True
      • -------- -------------------- --------
      • -------- -------------------- --------
  • Knockback
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Knockback_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Picked unit)
          • Set Temp_Real_1 = (Load (Key loop) of (Key (Picked unit)) from Knockback_Hash)
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Real_1 Less than or equal to (Knockback_Time x (1.00 / 0.03))
            • Then - Actions
              • Set Temp_Loc_1 = (Position of Temp_Unit_1)
              • -------- -------------------- --------
              • Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from Knockback_Hash)
              • -------- -------------------- --------
              • Set Temp_Real_3 = (Knockback_Speed x (Power(0.90, Temp_Real_1)))
              • -------- -------------------- --------
              • Set Temp_Real_4 = (X of Temp_Loc_1)
              • Set Temp_Real_5 = (Y of Temp_Loc_1)
              • -------- -------------------- --------
              • Set Temp_Real_4 = ((X of Temp_Loc_1) + (Temp_Real_3 x (Cos(Temp_Real_2))))
              • Set Temp_Real_5 = ((Y of Temp_Loc_1) + (Temp_Real_3 x (Sin(Temp_Real_2))))
              • -------- -------------------- --------
              • Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5))
              • -------- -------------------- --------
              • Custom script: set udg_Boolean = IsTerrainWalkable(udg_Temp_Loc_2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boolean Equal to True
                • Then - Actions
                  • Custom script: call SetUnitX(udg_Temp_Unit_1, udg_Temp_Real_4)
                  • Custom script: call SetUnitY(udg_Temp_Unit_1, udg_Temp_Real_5)
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_Rotate Equal to True
                  • (Random integer number between 1 and 4) Equal to 1
                • Then - Actions
                  • Unit - Make Temp_Unit_1 face ((Facing of Temp_Unit_1) - 180.00) over 0.00 seconds
                • Else - Actions
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Knockback_DoT Equal to True
                • Then - Actions
                  • Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Knockback_Hash)
                  • Set Temp_Real_2 = (Load (Key dmg) of (Key (Picked unit)) from Knockback_Hash)
                  • Unit - Cause Temp_Unit_2 to damage Temp_Unit_1, dealing Temp_Real_2 damage of attack type Spells and damage type Normal
                • Else - Actions
              • -------- -------------------- --------
              • Hashtable - Save (Temp_Real_1 + 1.00) as (Key loop) of (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
              • -------- -------------------- --------
              • Special Effect - Destroy (Load (Key effect_1) of (Key (Picked unit)) in Knockback_Hash)
              • -------- -------------------- --------
              • Unit Group - Remove Temp_Unit_1 from Knockback_Group
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Knockback_Hash
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Knockback_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • ST Loop
    • Events
      • Time - Every 0.00 seconds of game time
    • Conditions
      • (Remaining time for ST_Timer) Equal to 0.00
    • Actions
      • For each (Integer ST_Loop) from 1 to ST_IndexMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ST_Unit[ST_Loop] has buff PC_ConfStunBuff) Equal to False
            • Then - Actions
              • Unit - Order ST_Stunner to Human Mountain King - Storm Bolt ST_Unit[ST_Loop]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ST_Duration[ST_Loop] Greater than 0.00
            • Then - Actions
              • Set ST_Duration[ST_Loop] = (ST_Duration[ST_Loop] - 0.03)
            • Else - Actions
              • Unit - Remove PC_ConfStunBuff buff from ST_Unit[ST_Loop]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ST_Loop Not equal to ST_IndexMax
                • Then - Actions
                  • Set ST_Duration[ST_Loop] = ST_Duration[ST_IndexMax]
                  • Set ST_Unit[ST_Loop] = ST_Unit[ST_IndexMax]
                • Else - Actions
              • Set ST_IndexMax = (ST_IndexMax - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ST_IndexMax Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
                  • Set ST_Loop = (ST_Loop - 1)
      • Countdown Timer - Start ST_Timer as a One-shot timer that will expire in 0.03 seconds
 
Level 15
Joined
Jul 19, 2007
Messages
856
Your loop timer for the stun is 0.00 seconds while your counter timer subtracts 0.03 seconds. The way you deindex is also incorrect, though I'm pretty sure it has nothing to do with the constant stunning.

On a side note, this trigger can use some serious improvement. However, we can cross that bridge afterwards.
Yeah maybe but I think the spell works fine besides the perma stun bug... Oh well there is another problem with this spell too. If any enemy Hero dies of this spell and then is revived, the special effects which is created during the knockback time, will not be removed and is on the Hero forever...
 
Yeah maybe but I think the spell works fine besides the perma stun bug...
Well fix that loop timer and see if it still causes any problem. I also never see you index any data for the stun system other than this function:
  • Custom script: call ExecuteFunc("StunSystem_Run")
Where is this StunSystem_Run? Can you post it along with the triggers?


Oh well there is another problem with this spell too. If any enemy Hero dies of this spell and then is revived, the special effects which is created during the knockback time, will not be removed and is on the Hero forever...
Not a big fan of hashtables, especially for an insanely easy spell concept like this, so Im not entirely sure where the problem lies in that. On a side note, Im pretty sure all the problems come from how poorly made this spell is. What is this spell supposed to do exactly?
 
Level 15
Joined
Jul 19, 2007
Messages
856
Well fix that loop timer and see if it still causes any problem. I also never see you index any data for the stun system other than this function:
  • Custom script: call ExecuteFunc("StunSystem_Run")
Where is this StunSystem_Run? Can you post it along with the triggers?
Oh sorry I forget to post the triggers of the Stun System :( Here it is...
  • Stun System by KhaosMachine
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- The unit-type that cast the stun ability --------
      • Set SS_UnitType_Dummy = Spell Cast Dummy (Clouds of the Sea)
      • Set SS_Ability_Stun = Stun
      • Set SS_String_Order = stomp
      • Set SS_Buff_Stun = Stunned (Pause)
      • Set SS_Real_Interval = 0.05
      • -------- |||||||||||||||||||||||||||||||||||||||||||||||||END OF CONFIGURATION||||||||||||||||||||||||||||||||||||||||||||||||| --------
      • Set SS_Region_Map = (Playable map area)
      • Set SS_Player_NeutralPassive = Neutral Passive
      • Set SS_Player_Temp = Player 1 (Red)
      • Set SS_Point_Temp = (Center of (Playable map area))
      • Unit - Create 1 SS_UnitType_Dummy for SS_Player_Temp at SS_Point_Temp facing 0.00 degrees
      • Set SS_Unit_Temp = (Last created unit)
      • Unit - Add SS_Ability_Stun to SS_Unit_Temp
      • Unit - Remove SS_Unit_Temp from the game
      • Custom script: call RemoveLocation(udg_SS_Point_Temp)
      • Custom script: endfunction
      • Custom script: function StunSystem_Running takes nothing returns nothing
      • Unit Group - Pick every unit in SS_UnitGroup_Group and do (Actions)
        • Loop - Actions
          • Set SS_Unit_Temp = (Picked unit)
          • Set ID = (Custom value of SS_Unit_Temp)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_Real_Time[ID] Greater than or equal to 0.00
            • Then - Actions
              • Set SS_Real_Time[ID] = (SS_Real_Time[ID] - 0.05)
            • Else - Actions
              • Unit - Remove SS_Buff_Stun buff from SS_Unit_Temp
              • Unit Group - Remove SS_Unit_Temp from SS_UnitGroup_Group
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (SS_UnitGroup_Group is empty) Equal to True
                • Then - Actions
                  • Countdown Timer - Pause SS_Timer_Running
                • Else - Actions
      • Custom script: endfunction
      • Custom script: function StunSystem_Run takes nothing returns nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Unit_Target Not equal to No unit
          • (SS_Unit_Target is alive) Equal to True
        • Then - Actions
          • Set SS_Point_Temp2 = (Position of SS_Unit_Target)
          • Set ID = (Custom value of SS_Unit_Target)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_Boolean_Stack Equal to True
            • Then - Actions
              • Set SS_Real_Time[ID] = (SS_Real_Time[ID] + SS_Real_Duration)
            • Else - Actions
              • Set SS_Real_Time[ID] = SS_Real_Duration
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SS_Unit_Target has buff SS_Buff_Stun) Equal to False
            • Then - Actions
              • Set SS_Point_Temp = (SS_Point_Temp2 offset by SS_Real_Distance towards (Random angle) degrees)
              • Unit - Move SS_Unit_Target instantly to SS_Point_Temp
              • Unit - Create 1 SS_UnitType_Dummy for Neutral Passive at SS_Point_Temp facing 0.00 degrees
              • Set SS_Unit_Temp = (Last created unit)
              • Unit - Add SS_Ability_Stun to SS_Unit_Temp
              • Unit - Order SS_Unit_Temp to Orc Tauren Chieftain - War Stomp
              • Custom script: call IssueImmediateOrder(udg_SS_Unit_Temp, udg_SS_String_Order)
              • Unit - Add a 0.40 second Generic expiration timer to SS_Unit_Temp
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (SS_UnitGroup_Group is empty) Equal to True
                • Then - Actions
                  • Custom script: call TimerStart(udg_SS_Timer_Running, udg_SS_Real_Interval, true, function StunSystem_Running)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (SS_Unit_Target is in SS_UnitGroup_Group) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add SS_Unit_Target to SS_UnitGroup_Group
              • Unit - Move SS_Unit_Target instantly to SS_Point_Temp2
              • Custom script: call RemoveLocation(udg_SS_Point_Temp)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_SS_Point_Temp2)
        • Else - Actions


Not a big fan of hashtables, especially for an insanely easy spell concept like this, so Im not entirely sure where the problem lies in that. On a side note, Im pretty sure all the problems come from how poorly made this spell is. What is this spell supposed to do exactly?
Projects a powerful magical blast in a targeted area, dealing damage based on Saruman's intelligence and knocks back enemy land units with the distance of 250. |n|n|cffffcc00Level 1|r - 1x intelligence damage. |n|n|cffffcc00Level 2|r - 2x intelligence damage. |n|n|cffffcc00Level 3|r - 3x intelligence damage. |n|n|cffffcc00Level 4|r - 4x intelligence damage.|n|n|cffFF0000AOE: |r 350|n|cffFFFF00Cast Range: |r 600|n|cff0000FFMana Cost: |r 110/120/130/140|n|cff99ccffCooldown: |r 16/15/14/13 seconds.

Well maybe there is something wrong with the "destroy special-effect" trigger?
 
Well maybe there is something wrong with the "destroy special-effect" trigger?

Well the problem could be because you don't have a deindex condition of "knockbacked unit is dead", you only check if the duration is over. Again, not entirely sure since youre using hashtables. It looks fine though from what I can see. Did someone make this for you?
 
Level 15
Joined
Jul 19, 2007
Messages
856
Well the problem could be because you don't have a deindex condition of "knockbacked unit is dead", you only check if the duration is over. Again, not entirely sure since youre using hashtables. It looks fine though from what I can see. Did someone make this for you?
Yes someone made this for me a long time ago but I don't remembering his name :( I'm so noobish about triggering so it would be nice someone could solve this problem to me...
 
Maybe you could atleast give it a try then? Alot of users that wants to help me want to remake the spells I need help with but they often turns out worse than they were before...
I'd rather not work on a buggy and inefficient spell/possible system. If you really want to keep that original spell, then I guess you'd have to wait for someone else who'd be willing to do it.
 
Level 15
Joined
Jul 19, 2007
Messages
856
I'd rather not work on a buggy and inefficient spell/possible system. If you really want to keep that original spell, then I guess you'd have to wait for someone else who'd be willing to do it.
Yes I probably have to wait for someone else then :-/ I don't think it should be that hard to fix it if you just could find the cause of the 2 bugs, they can't just be happening by themself without any reason...
 
Yes I probably have to wait for someone else then :-/ I don't think it should be that hard to fix it if you just could find the cause of the 2 bugs, they can't just be happening by themself without any reason...

Well like I said, what you have is an extremely inefficient spell using a system I haven't seen before. For all I know, the system could be extremely buggy, which is why I'd rather remake it. I'm not sure what your attachment to this spell is.
 
Level 11
Joined
Dec 19, 2012
Messages
411
As KILLCIDE said, recoding the spell would be the best choice. Since you mentioned you're not that good in triggering, so recoding the spell would be too hard for you.

Regarding to your question, I've look through the triggers, and seem fine. The 2 things bother me would be ST Loop with the event of every 0.00 second game time, and this :
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • (ST_Unit[ST_Loop] has buff PC_ConfStunBuff) Equal to False
  • Then - Actions
    • Unit - Order ST_Stunner to Human Mountain King - Storm Bolt ST_Unit[ST_Loop]
  • Else - Actions
I see no point for this condition exist.

For the spell would target self, allies, I see nothing wrong with the trigger conditions for filtering units, I couldn't found out anything wrong there.

If you really can't solve it, you could send me the map for further investigation (If you believe me), though I couldn't guarantee that your problem could be fixed.
 
Level 15
Joined
Jul 19, 2007
Messages
856
As KILLCIDE said, recoding the spell would be the best choice. Since you mentioned you're not that good in triggering, so recoding the spell would be too hard for you.

Regarding to your question, I've look through the triggers, and seem fine. The 2 things bother me would be ST Loop with the event of every 0.00 second game time, and this :
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • (ST_Unit[ST_Loop] has buff PC_ConfStunBuff) Equal to False
  • Then - Actions
    • Unit - Order ST_Stunner to Human Mountain King - Storm Bolt ST_Unit[ST_Loop]
  • Else - Actions
I see no point for this condition exist.

For the spell would target self, allies, I see nothing wrong with the trigger conditions for filtering units, I couldn't found out anything wrong there.

If you really can't solve it, you could send me the map for further investigation (If you believe me), though I couldn't guarantee that your problem could be fixed.
Ofc I can send u the map, it's always worth a try.. But well what do say about the second bug of this spell which doesn't remove the special "tornado" effect which is added on the enemy units during the knockback-effect if any enemy unit dies of this spell!? I mean if an enemy Hero dies of this spell and then is revived, the special "tornado" effect is still on the Hero and will never be removed and just creates more and more of this effect if it dies once again of this spell... So it has to be something wrong about the "destroy" special-effect trigger, it seems to ignore dead units or something :-/
 
Status
Not open for further replies.
Top