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

Remove shadow

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2015
Messages
283
I have GetLocal() player which makes a unit invisible to some players
How do you remove shadows from a unit?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
From the Object Editor:
Art - Shadow Image (Unit)
Normal/Flying >>> None


Or if you mean during gameplay... There is no direct way to edit that (or is there?) so replace the unit with a copy of it without a shadow.
 
Level 7
Joined
Nov 19, 2015
Messages
283
Or if you mean during gameplay... There is no direct way to edit that (or is there?) so replace the unit with a copy of it without a shadow.

I have a few units and was hoping not to have to create a copy of each unit.

maybe you could have a dummy aura, which attachs a "shadow" model on origin, then remove/add the ability when you need to
Thats a pretty original idea, I will try that now. Get back to you after I have tested it. What model is the shadow and how do I access it?

EDIT: Still can't find the model for shadow so I can't really test this idea. I can't find anything in search either on how to find shadow
 
Last edited:
There is a very hacky way to hide a shadow of a unit via images.
It requires JASS script, though and also requires you to remove/recreate said unit to hide the shadow.

If you are interested, just search "hide unit shadows".

EDIT: I searched it for you:

JASS:
// Credit to Deaod, edited by Maker
     private function CreateUnitWithoutShadow takes player owner, integer uid, real facing, string shadowfile returns unit
         local image i = CreateImage(shadowfile, 1, 1, 0, 0, 0, 0, 1, 1, 0, 3) // creates a dummy image
         if GetHandleId(i) == -1 then // if the new shadow is invalid, abort, it can screw up the game
             debug call BJDebugMsg("CreateUnitWithShadow: Invalid path for new shadow!") // it could also be caused by an imageType of 0, but thats a less common cause
             return null // since the image is invalid, we dont need to destroy it
         endif
         call DestroyImage(i) // destroy the dummy.
         set u = CreateUnit(owner, uid, CREATE_X, CREATE_Y, facing) // create the unit. this also creates a new image which functions as the shadow of the unit. The shadow will use the ID of the dummy image.
         call DestroyImage(i) // destroy the shadow of the unit
         call CreateImage(shadowfile, 1, 1, 0, 0, 0, 0, 1, 1, 0, 3) // this creates the new shadow for the unit, note that i dont need to overwrite "i" as the id this image will get is predictable
         call SetImageRenderAlways(i, false) // Hides the shadow
         call SetImageColor(i, 0, 0, 0, 0)   // Makes the shadow invisible
         // no need to null "i", as images dont use ref-counting
         return u
     endfunction
 
Last edited:
Level 7
Joined
Nov 19, 2015
Messages
283
There is a very hacky way to hide a shadow of a unit via images.
It requires JASS script, though and also requires you to remove/recreate said unit to hide the shadow.

If you are interested, just search "hide unit shadows".

I don't really want to replace the unit as it can sometimes mess with my other triggers.
 
Last edited:
Level 7
Joined
Nov 19, 2015
Messages
283
This is a bit complex for me atm. Unless you can give me an example of what the trigger might look like, I might just stick to creating another dummy unit copy which has no shadow.

I also would like to know what the shadow model is if anyone knows.
 
Level 7
Joined
Nov 19, 2015
Messages
283
Ok, going to try this out when I have time. Looks like I have to use Jass for all the things I want to get done. Anyone know a good place to learn the basics. Converting GUI into custom text doesn't really tell me much of what is going on.
 
Status
Not open for further replies.
Top