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

Special effects problems

Status
Not open for further replies.
Level 2
Joined
Oct 22, 2010
Messages
19
Ok i have made 2-3 spells that use a dummy unit , but there is a chance that sometimes that i or someone else uses that spell, it bugs and the unit won't get destroyed it just stays there and makes a memory leak.... and ideas on how to fix it...
 
Level 2
Joined
Oct 22, 2010
Messages
19
Thx , but i don't think you understood what i needed help with , here i will upload one off those spells and explain it...
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Curshin Wave [Q]
    • (Triggering unit) Equal to (Casting unit)
  • Actions
    • Unit - Create 1 Dummy Crushing Wave for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Casting unit)) degrees
    • Unit - Set (Last created unit) movement speed to 522.00
    • Unit - Order (Last created unit) to Move To (Target point of ability being cast)
    • Wait 2.20 seconds
    • Unit - Remove (Last created unit) from the game
See now, the dummy that is used as an effect for this spell works fine, but if the spell is cast a lot of times in the game, the dummy get's stuck and doesn't get destroyed just sticks there where it was supposed to be destroyed . This happens at random , some times even on the 1st use and some times not at all. I hope i explain it better now...
 
Level 3
Joined
May 5, 2013
Messages
56
I see the Problem. Never use "Waits", they are inefficient. Use "Add expiration timer to last created unit". Expiration timer is that a Unit kind of vanishes when the timer is over (I guess I dont have to explain an expiration timer further).
Your problem is, that during the wait another unit could be set as "last created unit".

Here is a further example: You spawn 2 units, 1 unit at game-time 5 sec, and one at 10 sec. When you call "Remove last created unit" at sec 7, unit 1 will be removed. BUT:
When you create a unit at sec 5 and 6 and you call "Remove last created unit" at sec 7, unit 2 will be removed.

You understand what I'm trying to tell you?
 
Level 2
Joined
Oct 22, 2010
Messages
19
Yea i did this and it doesn't get destroyed at all now
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Curshin Wave [Q]
    • (Triggering unit) Equal to (Casting unit)
  • Actions
    • Unit - Create 1 Dummy Crushing Wave for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Casting unit)) degrees
    • Unit - Add a 2.40 second Generic expiration timer to (Last created unit)
    • Unit - Set (Last created unit) movement speed to 522.00
    • Unit - Order (Last created unit) to Move To (Target point of ability being cast)
I tried that but now it doesn't go away at all, tried to move the timer to the bottom or top still doesn't work...
 
Level 3
Joined
May 5, 2013
Messages
56
Well, I tested it with the same trigger on a custom map and it worked without problems. You should check your other triggers, maybe something is in conflict with this trigger.
 
Level 11
Joined
Dec 19, 2012
Messages
411
Trigger won't run at same time, so it shouldn't conflict ( I think ) , also you have a leak with (Position of (TriggeringUnit)) . This should store into a variable and remove through :
call RemoveLocation(udg_YourVariableName)

Also your condition is pretty pointless, (Triggering unit) Equal to (Casting unit) . This is totally same, remove it, also use TriggeringUnit all the time cause it proved to be faster than any other event respond of unit (also MUI) unless TriggeringUnit can't refer to the unit you wanted to.
 
Status
Not open for further replies.
Top