• 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.

[Spell] Why is this spell causing so much lag when casted and sometimes damages enemies twice?

Status
Not open for further replies.
Level 15
Joined
Jul 19, 2007
Messages
857
Yes that's my question and how can I solve it? I imported this spell from a spellpack and it seemed to work perfectly on the spellpack but when imported it to my map, it seemed to cause lag almost everytime it is casted and I also notice the spell sometimes damages enemies twice. Why is this happening!?

This is how the spell works like.
The caster summons a powerful wind to attack it's enemy targets in the target point it causes damage to land units in a line and stunning them for 2 seconds and slowing their movement speed and attack rate for 5 seconds.

The triggers of the spell.
  • Preload
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set BYB_HASH = (Last created hashtable)
  • Iceexplosion Copy Copy 3
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Winds of the South
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BYB_group[0] is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on Iceexplosion Copy Copy Copy 2 <gen>
        • Else - Actions
      • Set BYB_POINT[0] = (Position of (Triggering unit))
      • Set BYB_POINT[1] = (Target point of ability being cast)
      • Unit - Create 1 Big Yellow Blast for (Owner of (Triggering unit)) at BYB_POINT[0] facing (Angle from BYB_POINT[0] to BYB_POINT[1]) degrees
      • Unit - Turn collision for (Last created unit) Off
      • Hashtable - Save Handle OfBYB_POINT[1] as 0 of (Key (Last created unit)) in BYB_HASH
      • Custom script: call RemoveLocation(udg_BYB_POINT[0])
      • Unit Group - Add (Last created unit) to BYB_group[0]
  • Iceexplosion Copy Copy Copy 2
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BYB_group[0] is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in BYB_group[0] and do (Actions)
        • Loop - Actions
          • Set BYB_POINT[0] = (Position of (Picked unit))
          • Set BYB_POINT[1] = (Load 0 of (Key (Picked unit)) in BYB_HASH)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between BYB_POINT[0] and BYB_POINT[1]) Greater than or equal to 10.00
            • Then - Actions
              • Set BYB_unit = (Picked unit)
              • Set BYB_POINT[2] = (BYB_POINT[0] offset by 10.00 towards (Angle from BYB_POINT[0] to BYB_POINT[1]) degrees)
              • Unit - Move (Picked unit) instantly to BYB_POINT[2], facing BYB_POINT[1]
              • Set BYB_group[1] = (Units within 150.00 of BYB_POINT[0] matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) has buff Winds of the South ) Equal to False)))
              • Custom script: call RemoveLocation(udg_BYB_POINT[0])
              • Unit Group - Pick every unit in BYB_group[1] and do (Actions)
                • Loop - Actions
                  • Set BYB_POINT[0] = (Position of (Picked unit))
                  • Unit - Create 1 BYB EFFECTS for (Owner of BYB_unit) at BYB_POINT[0] facing BYB_POINT[0]
                  • Unit - Set level of Winds of the South (Slow) for (Last created unit) to (Level of Winds of the South for Lord of Khand 0225 <gen>)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Create 1 BYB EFFECTS for (Owner of BYB_unit) at BYB_POINT[0] facing BYB_POINT[0]
                  • Unit - Set level of Winds of the South (Damage/Stun) for (Last created unit) to (Level of Winds of the South for Lord of Khand 0225 <gen>)
                  • Unit - Order (Last created unit) to Neutral - Firebolt (Picked unit)
                  • Custom script: call RemoveLocation(udg_BYB_POINT[0])
              • Custom script: call RemoveLocation(udg_BYB_POINT[2])
              • Custom script: call DestroyGroup(udg_BYB_group[1])
            • Else - Actions
              • Custom script: call RemoveLocation(udg_BYB_POINT[2])
              • Custom script: call RemoveLocation(udg_BYB_POINT[0])
              • Custom script: call RemoveLocation(udg_BYB_POINT[1])
              • Unit Group - Remove (Picked unit) from BYB_group[0]
              • Unit - Kill (Picked unit)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,886
I cleaned up the triggers and re-did some stuff. There were some Point leaks and other issues that were causing the lag. Also, the way it was designed before, a unit could only be hit by the ability if it DIDN'T have the Slow debuff. I changed it so that now each enemy unit can only be hit once by per cast of the ability. This makes it so that multiple casts of the ability (if you wanted the ability to have a short cooldown or have multiple units use it) will work now.

I attached 2 different versions below.

The 1.31 version uses the new 1.31 natives to change the damage, slow amount, and duration inside of the main trigger. You can configure these values to your liking.

Or you can use the old compatible version which uses the abilities data in the Object Editor like you were doing already.

All you need to import from either map is the Triggers plus the stuff inside the Object Editor. I use a different Dummy unit than the one from the Spellpack.
 

Attachments

  • BYB Old Compatible.w3x
    29.9 KB · Views: 22
  • BYB 1.31.w3x
    31.4 KB · Views: 23
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,886
8qB3G9e

Make sure to have "File -> Preferences -> Automatically create unknown variables while pasting trigger data" checked on before doing this.

Imgur
^^^Click the link above. Follow the picture's instructions. Copy and paste the "Dummy" unit, "Big Yellow Blast" unit, the BYB Abilities, and the "BYB Folder old compatible" Folder into your map.

Then you can adjust these two variables in the "BYB Cast" trigger:
BYB_Speed
BYB_TotalDistance

You don't have to worry about ANYTHING else in the triggers. It's all done for you. Think of those 2 variables as the same fields you'd find on the Shockwave ability in the Object Editor. Speed is how fast the missile moves, TotalDistance is how far it travels.

If you want to change the Slow/Stun then simply edit BYB SLOW and BYB STUN in the Object Editor.

I attached a second version of the map that I want you to try and import using the instructions above.
 

Attachments

  • BYB Old Compatible v.2.w3x
    30.4 KB · Views: 29
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,886
It doesn't use the Shockwave ability. It's based off of Channel and is simply triggered to look like Shockwave. I fixed his problem but he's just having trouble importing it. Also that trigger above is full of leaks.
 
Status
Not open for further replies.
Top