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

[Trigger] Make a unit owned by a player behave like an ally

Status
Not open for further replies.
Level 6
Joined
Mar 17, 2012
Messages
105
I'm trying to make a specific unit, say a Footman, behave like an ally (the owning player cannot control him).

This has been frustrating me for a while! The idea is that the player casts an ability, and a unit is created that the casting player owns, but cannot control.

Does anyone know how I can use triggers to make this?
 
Level 6
Joined
Mar 17, 2012
Messages
105
You can add locust to that unit so it will be unclickable if you want it to be clickable then you may change its team to not behave only but to be a real ally.

How do I add a locust to a unit?

Edit: the unit cannot be an actual ally for the triggering I'm doing, it needs to be owned by the designated player (the owner of the unit that casts the spell)
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
Triggers -> Unit Category -> Add Ability -> Locust

Also I think that when you remove the ability, it will be attackable but not clickable, to remove this you need to morph the unit into itself. Not sure if I am remembering this correctly though.

This will not work. Not only is it impossible to add locust by "Add Ability" but also makes the unit untargetable.

To solve your problem, simply let a player be allied with the caster (either with or without shared vision) and then change the owner of the spawned unit to this player. If you want the spawned unit to have the same colour of the caster, use Unit ---> Change Color
 
Level 6
Joined
Mar 17, 2012
Messages
105
This will not work. Not only is it impossible to add locust by "Add Ability" but also makes the unit untargetable.

To solve your problem, simply let a player be allied with the caster (either with or without shared vision) and then change the owner of the spawned unit to this player. If you want the spawned unit to have the same colour of the caster, use Unit ---> Change Color

EDIT: Sorry! Misread.

My map requires that a minimum of eight players have this functionality, and the eight players are all unallied to each other. I cannot have a separate colored ally for each player (as there is a max of 12 players). The player needs to technically own the unit, but be unable to control it.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
The simple answer is what you are asking is not possible in WC3. This feature was added in SC2 however that does not help you make your map. However there are "imperfect" work around approaches.

The most common is the allied player suggestion above. If players are on teams then you can have 1 player per team handling the uncontrollable units which saves on slots. If it is FFA or needs a lot of slots then this is not possible.

Another less perfect approach is to not make the unit uncontrollable, but to simply make it ignore all orders it is sent. By giving the unit type ward capabilities most ability icons are hidden preventing it from being issued advanced orders outside of third party hacks. Basic smart and attack orders can still be issued however. To prevent players from meaningfully controlling the unit you then use triggers to cancel out manual orders by issuing the unit with a new "autonomic" order. To do this you need a 0 timeout delay between the issue order event and the cancelation order as the event will fire before the actual order is issued (so any immediately issued orders get cancelled by the event response issued order). Not perfect but at least the player cannot manipulate it well.

By third party hacks I am referring to tools that allow injection of arbitrary orders into the game in a deterministic way (as if the player ordered it). This allows orders to be sent that target hidden abilities (eg in a hidden spell book) or when issuing such an order is technically impossible (locust units). Such tools are commonly used to cheat in melee (well before the exploits were patched) however can theoretically be used in custom maps. I have never seen one personally so the threat is minimal but still possible.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can also use a locust bug.
This option is 100% configuration so you cannot apply it to all units.

Create an ability based on Bear form and reverse the units.
(Alternate unit is a dummy unit which you will place on the map.)
(Normal unit is a footman, rifleman, etc which you want to see on the map.)

Create the dummy, give the dummy locust, give the dummy the bear form ability and remove it immediately.

This will result in a Locust classified unit without locust.
- Unit is uncontrollable.
- Unit is unselectable (might be a con in this situation).
- Unit is targetable.
- Unit does not change owning player.
 
Level 12
Joined
Nov 3, 2013
Messages
989
You can also use a locust bug.
This option is 100% configuration so you cannot apply it to all units.

Create an ability based on Bear form and reverse the units.
(Alternate unit is a dummy unit which you will place on the map.)
(Normal unit is a footman, rifleman, etc which you want to see on the map.)

Create the dummy, give the dummy locust, give the dummy the bear form ability and remove it immediately.

This will result in a Locust classified unit without locust.
- Unit is uncontrollable.
- Unit is unselectable (might be a con in this situation).
- Unit is targetable.
- Unit does not change owning player.

I think this works by just hiding and then unhide the unit after removing locust, no need to use any ability for this. (though I don't perfectly remember in which order you do it)
 
Status
Not open for further replies.
Top