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

Locust + Invisibility = Unrevealable unit :(

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
Greetings,

So, directly to the problem, I want to make Unit A (Creature) leave tracks which are visible only if Unit B (Hunter) sees them.

My initial plan was to create a dummy unit (Track) which has Permanent Invisibility + Locust. The problem is that apparently locust-ed units can not be revealed by true sight. I tested with some other non-locust-ed units around and they were properly revealed, also I can see the Tracks if I own them.

So what I want to achieve for the Track is:
[check] - No health bar (No funny effects )
[check] - Un-destroyable (Can not be attacked or damaged)
[check] - Expireable (Will naturally die after some time, expiration timer)
[check] - Rotatable (Faces the facing of parent unit upon creation)
[check] - Invisible
[damn] - Revealable

Any suggestions ? I do remember about reading a thread about some ways of removing locust but keeping the "No health bar" effect but I can't find it now :(

In the worst case I will settle with permanent invulnerability instead of locust, as the "Revealable" is much, much more important than "No health bar".
 
Level 10
Joined
Feb 22, 2008
Messages
619
To make the unit invisible but still revealable, you could use a dummy unit model. This will also prevent the health bar from showing up when mousing over the unit, right clicks won't do anything around it, etc., but you will still be able to select it with a drag select. You can kind of 'fix' that by creating a trigger to instantly de-select it when selected, if necessary.

To make the tracks show up with True Sight you'll have to attach a Special Effect to them that has the model of whatever you want the tracks to look like. (It won't be visible while the unit isn't). If you attach the Special Effect to the origin of the dummy unit it should turn with the unit, too.

What I do when I want the unit to expire is to set the max and initial mana to the number of seconds you want it to last for, and set the regen to -1. Create a trigger that checks if the mana of all of these units is 0, and if it is, remove the unit. You could also make the health degenerate but having the units die this way would probably cause leaks(?).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Meh, as far as I know is hiding a unit set as behavior.
You can make it invisible using animation - set vertex color.
When your hunter is close, you can unhide the unit.

At least, that works when you have only specific unit(types) as hunters.

If not, then indeed what DeadZero said.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
To make the unit invisible but still revealable, you could use a dummy unit model. This will also prevent the health bar from showing up when mousing over the unit, right clicks won't do anything around it, etc., but you will still be able to select it with a drag select. You can kind of 'fix' that by creating a trigger to instantly de-select it when selected, if necessary.

To make the tracks show up with True Sight you'll have to attach a Special Effect to them that has the model of whatever you want the tracks to look like. (It won't be visible while the unit isn't). If you attach the Special Effect to the origin of the dummy unit it should turn with the unit, too.

What I do when I want the unit to expire is to set the max and initial mana to the number of seconds you want it to last for, and set the regen to -1. Create a trigger that checks if the mana of all of these units is 0, and if it is, remove the unit. You could also make the health degenerate but having the units die this way would probably cause leaks(?).

Worked pretty nice. Thank you.

Aaaaand follow-up questions:
Q1: Can you tell me is there anything special about this model or it is just a pyramid(or single vertex or just "empty" model if this is even possible) with no texture, animations etc. ?

Q2: Why bother triggering the expiration instead of making it die naturaly:
Unit - Add a 60.00 second Generic expiration timer to Last created unit
I do remember someone stating that a dead unit leaks, but that is un-avoidable. Also the mana would get effected by briliance aura, no ?
 
Last edited:
Level 25
Joined
Jul 10, 2006
Messages
3,315
1. It's a single point, but it has a neat feature: animations corresponding with changing the unit's pitch angle. Set this using SetUnitAnimationByIndex(unit, id), goes from 0 to 180.

2. For most cases an expiration timer like you mention would be better, but if you're using health it's much easier to have other abilities or units interact with the timer to decrease/increase it.
 
Level 10
Joined
Feb 22, 2008
Messages
619
Q2: Why bother triggering the expiration instead of making it die naturaly:
Unit - Add a 60.00 second Generic expiration timer to Last created unit
I do remember someone stating that a dead unit leaks, but that is un-avoidable. Also the mana would get effected by briliance aura, no ?
I wasn't sure if removing a unit from all groups and from the game still allowed it to leak. (Does it?)
Also, wasn't aware of the timer action... :thumbs_up:
You could probably figure out a way to make all of your auras not target this unit by messing around with targets allowed and stuff.
 
Status
Not open for further replies.
Top