• 🏆 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!

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 63
Joined
Jan 18, 2005
Messages
27,188
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.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Ofcourse you can use a local variable instead... It takes any location value if you read the function definition. You could even do something stupid and pass it a created location like...
call RemoveLocation(Location(0,0))
Which would be entirly pointless, valid and still not leak.
 
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