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

Make unit uncontrollable

Status
Not open for further replies.
Level 3
Joined
Mar 26, 2019
Messages
54
II want to make a unit that can be trained from production building, but they only attack toward certain point and also ignore all other order from player. They also give bonus gold when kill enemy normally. I know that we can simply de-select the unit when player select it, but in that case player cannot see it health. Is there anyway to make unit that are selectable, but do not receive order from player?/nThank you.
 
Level 39
Joined
Feb 27, 2007
Messages
5,024
Try giving them the "ward" classification; that removes the command card but unsure if it will prevent right-click orders. Another option would be to change the owner of the unit (upon training) to some computer-owned allied player and order it to do what you want. If there's no AI present in that slot it should only attack move as ordered.
 
Level 3
Joined
Mar 26, 2019
Messages
54
Try giving them the "ward" classification; that removes the command card but unsure if it will prevent right-click orders. Another option would be to change the owner of the unit (upon training) to some computer-owned allied player and order it to do what you want. If there's no AI present in that slot it should only attack move as ordered.
I've tried ward one. It do not prevent unit from moving around with right-click.
The second option will cut down the number of player available to 6.
Seem like I have to bear with deselect option. Unit explanation will be hell long though (almost all of them have active/passive skill, and if u cannot select then u cannot see how their skill work.)
Anyway, thank you for your option.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,576
I think I made a trigger a while back to make a unit somewhat "uncontrollable". I believe you combine the "Ward" classification like Pyrogasm said with a trigger that overwrites any given order to the unit. So when you first create the unit you want to store where it needs to attack as a Point variable. Then whenever that unit is issued an order, order it to attack towards it's stored Point instead. Make sure to turn off the Order trigger before issuing the attack order otherwise it will crash the game (infinite loop).

  • Order
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to Grunt 0030 <gen>
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order Grunt 0030 <gen> to Attack-Move To (Center of (Playable map area))
      • Trigger - Turn on (This trigger)
Here's an example. It leaks a point.
 
Last edited:
Seem like I have to bear with deselect option. Unit explanation will be hell long though (almost all of them have active/passive skill, and if u cannot select then u cannot see how their skill work.)
Make a duplicate dummy unit somewhere and select that unit instead of deselecting the other one. That way you can read the abilities and you get the right portrait. Sure if you click its portrait you will be taken to a different place than the actual unit but I guess it's better than deselecting it.

With some extra work you can also make the dummy unit have the same health, and periodically instantly move it to the location of the unit you initially selected. That way you have the selection circle, same health, abilities, camera panning to the right location when you click the portrait etc etc.
 
Level 3
Joined
Mar 26, 2019
Messages
54
24 player slots are available now so at the least it should allow 12 players. Your map is a FFA? If it's teamed you can use one player slot for all units on a team.
Well, I use a cracked version, so i cannot update to the newest version. I don't even know that 24 player is possible. Thank you.
My map is like a typical RTS, that you can control only a commander and an indestructible production building. You lose when you lost the commander. The rest of the army can only be controlled by the ability set of the commander, so that you can fully focus on macro.
I suck at micro, so I create this...
Well, of course I want it to be able to FFA. And if I simply send all unit to other player, then the gold bonus on kill will no longer be possible (i also need custom value for another purpose)
 
Last edited:
Level 3
Joined
Mar 26, 2019
Messages
54
Make a duplicate dummy unit somewhere and select that unit instead of deselecting the other one. That way you can read the abilities and you get the right portrait. Sure if you click its portrait you will be taken to a different place than the actual unit but I guess it's better than deselecting it.

With some extra work you can also make the dummy unit have the same health, and periodically instantly move it to the location of the unit you initially selected. That way you have the selection circle, same health, abilities, camera panning to the right location when you click the portrait etc etc.
So good! Thank you about this!
 
Level 3
Joined
Mar 26, 2019
Messages
54
I think I made a trigger a while back to make a unit somewhat "uncontrollable". I believe you combine the "Ward" classification like Pyrogasm said with a trigger that overwrites any given order to the unit. So when you first create the unit you want to store where it needs to attack as a Point variable. Then whenever that unit is issued an order, order it to attack towards it's stored Point instead. Make sure to turn off the Order trigger before issuing the attack order otherwise it will crash the game (infinite loop).

  • Order
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to Grunt 0030 <gen>
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order Grunt 0030 <gen> to Attack-Move To (Center of (Playable map area))
      • Trigger - Turn on (This trigger)
Here's an example. It leaks a point.
Well, it is good. Thank you.
 
Level 8
Joined
May 21, 2019
Messages
435
The standard option is to use a player slot for each team that's allied with the player, and then swap unit control to that player slot. You can easily transfer bounty gold to the main player slot using triggers.
 
Status
Not open for further replies.
Top