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

Do hidden units decay?

Status
Not open for further replies.
Level 20
Joined
Aug 13, 2013
Messages
1,696
Yes they do.

It just renders their physical existence in-game.
They can move, attack, cast, just like a normal unit does.
Except, they're treated as 'hidden' and retrievable via:
IsUnitHidden function.

What about locust units? Same answer.

What are the relevant things we should note about?

Hidden units != Locust units
- Hidden units hide their model.
- Locust units don't hide their model.
- Hidden units are vulnerable to code damage.
- Locust units are invulnerable to any kind of damage.
- Hidden units only retrievable via: IsUnitHidden function.
- Locust units only retrievable via: UnitAddAbility() or GetUnitAbilityLevel() functions.

- Both can execute an order.
- Both retain order.
- Both unselectable and untargetable.
- Both killable and removable.
- Both die and decay.
- Both can only be enumerated via: GroupEnumUnitsOfPlayer function.

- You can't order unit to target hidden or locust unit.
- Hiding/Unhiding a locust unit breaks locust form. (makes them untargetable but selectable)
- Bear form trick on locust unit breaks locust form. (makes them unselectable but targetable)
- Hiding/Unhiding a locust unit with bear form trick removes locust form completely.

Yeah, I've decided to give this thread a shot before my inactivity strikes. I hope this is bold and clear. ;)
 
The answers seem to be going too far from what I asked but I appreciate the extra information lol.

Here's what going on in my map.
- In the previous version of my map when the unit dies they get removed from the game instantly and play from gory blood effects at the position of dying unit. (This saves alot of FPS instead of leaving corpses + gory explosions are better than leaving corpses). Unfortunately I have a new batch of triggers (quest triggers) added in my map from my test map where the hero have to kill enemies and the problem is the triggers can't credit the killing unit (my hero) from the dying unit because another trigger is removing the dying unit. So what I had to do to fix this is to hide the unit instead of removing it instantly although I fear than maybe hiding the dying unit may not get removed in the game when the dead unit finished decaying which can cause some lag.
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
So what I had to do to fix this is to hide the unit instead of removing it instantly although I fear than maybe hiding the dying unit may not get removed in the game when the dead unit finished decaying which can cause some lag.
It's fine, you shouldn't be afraid from it.

In fact, you may also consider lowering down their decay time via gameplay constants
if you don't care about bones/corpses. In this way, you have control on their time removal properly.

I just wonder what kind of credit you're about to reward the hero? gold bounty, experience, or something?
It's strange that you're having that kind of problem considering a removed unit
doesn't lose its reference instantly except some 'get' functions would return empty (if not the same time)
I'm also sure gold bounty and experience would execute before a unit removal if there's an actual source.

Just to rule out confusions;
you can get any units using GroupEnumUnitsInRect / OfPlayer which dont care about unit being hidden/locust/dead
GroupEnumUnitsInRect doesn't enumerate them. How come you considered it?
Or, you're pointing about unit events? such as enters/leaves region? which is obviously true.
locusts can be attacked (when ordered with triggers) by units that have "invulnerable" in allowed targets. it won't do damage, though.
You shouldn't be confused, locust and hidden units are rendered to be 'untargetable'.
They don't fire EVENT_UNIT_ISSUED_TARGET_ORDER or EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER
For invulnerable units, this is definitely true because they're targetable,
which is also the reason why they're included in the 'Targets' field.

It's a misconception that you can order a unit to target locust or hidden unit.
You'll see the unit moves in their exact position and do nothing doesn't mean the order
is executed via 'target' but in reality it's just replaced as 'target-point'.

For attacks, it's replaced as 'attack-move' instead. Just like how you can 'left-click'
their position as target in-game. As it features two target types: 'unit or point target'.
However, your statement is contrary to locust units but true to invulnerable units.
 
Level 23
Joined
Oct 18, 2008
Messages
937
upload_2020-6-10_1-12-16.png


it definitely works for me m8
interesting note though units with attack type magic will not attack locusts even with the trick
 
Status
Not open for further replies.
Top