Controlling unit problem

EoW.chips

New Member
Reaction score
2
Hey,
my question is, if player Red is controlled by an user, and you create a unit for him that should move from area A to B, how can u make that this player can't control his own unit ?
It's for a TD, where player Red can send units, so they spawn at a certain point, and then they have to move to another point. Problem is at mom, he can click on them and order them to move in an other direction.

Hope u you understand my bad english ^^

Thanks for help
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Simply whenever a unit owned by that player is issued an order, and the unit type of the triggering unit is XYZ (whatever unit you dont want to be controllable) order the triggering unit to go to the destination you want it to.
one thing to keep in mind is that if you order the unit via the trigger, it will end up in an infinite loop if you do not turn the trigger off, order the unit to move, and turn it back on again.

Written in pseudo-code it should look like this:

Code:
Event
 Unit is issued an order
Condition
 unit type of triggering unit == TowerD-Creep
Action
 turn off (this trigger)
 order triggering unit to move to udg_ThatPointItHasToGoTo
 turn on (this trigger)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462

This does have plenty of drawbacks though.
But most of them do not matter in this case.
However, one drawback is still viable. You would need plenty of player slots as dummies to put the creeps in.
You might give them all to the same neutral player but you got to keep in mind if a single player has too many units his unit movement will glitch and they will hardly move forward anymore.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top