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

How to create an image of a unit?

Status
Not open for further replies.
Level 7
Joined
May 18, 2010
Messages
264
  • Broodmother Memory Egg
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Memory Egg
    • Actions
      • Set HeroBroodmotherMemoryEggCaster = (Triggering unit)
      • Unit - Create 1 Memory Egg Sack for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by -150.00 towards (Facing of (Triggering unit)) degrees) facing Default building facing (270.0) degrees
      • Set HeroBroodmotherMemoryEggPoint = ((Position of (Triggering unit)) offset by -150.00 towards (Facing of (Triggering unit)) degrees)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Dummy Unit Memory Egg for (Owner of (Triggering unit)) at (Center of Dummy units <gen>) facing Default building facing (270.0) degrees
      • Set HeroBroodmotherMemoryEggDummy = (Last created unit)
      • Hero - Give (Last created unit) a Memory Egg in slot 1
      • Set HeroBroodmotherMemoryEggItem = (Last created item)
      • Wait 5.00 seconds
      • Hero - Order HeroBroodmotherMemoryEggDummy to use HeroBroodmotherMemoryEggItem on HeroBroodmotherMemoryEggCaster
      • Wait 0.90 seconds
      • Unit - Remove HeroBroodmotherMemoryEggDummy from the game
let me easy it for you
MemoryEggDummy gets MemoryEggItem
its based on Item Ilusion now when the ilusion is created i need to Move it to MemoryEgg position...
And i got memory eeg position alredy just how to get image and move it there?
Cast range on item is 999999 and cooldown nothing etc.
EDIT: how to make that udg_removelocation(that point of eeg i set)its name i know but not shure how it goes
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you're making a local variable, just do this:
  • Custom script: set Point = null
Point is your early set up point-type variable
Put that at the end of your trigger, this is to clean leak of local variable
For udg_*Variable*, it is global variable, therefore you can use the call RemoveLocation(udg_*YourPointVariableName*)
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
If you're making a local variable, just do this:
  • Custom script: set Point = null
Point is your early set up point-type variable
Put that at the end of your trigger, this is to clean leak of local variable
For udg_*Variable*, it is global variable, therefore you can use the call RemoveLocation(udg_*YourPointVariableName*)
You need to remove locations (and other handles that can leak) for locals too. The null part clears the pointer afaik. (Which would also leak if it wouldn't be nulled.)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
defskull, you need to destroy the location before losing all pointers to it otherwise it will leak. This is because WC3 has no location garbage collection. The null is to stop a handle index recycling bug where the pointed to counter has an incriment of 1 leak in it unless you null a local handle which means it can never reach 0 (and thus be recycled).

In SC2 you do not even need to null the local and it will automatically destroy the point (SC2's type of location) because it does have garbage collection.
 
Level 19
Joined
Oct 15, 2008
Messages
3,231
I usually use the wand of illusion for that, though.
But right now I'm not too sure what you meant so I'll try to find out a better way:)
 
Status
Not open for further replies.
Top