[Solved] Stop treining unit

Status
Not open for further replies.
You could try
  • Unit - Order YourBuilding to Stop
although I'm not really sure this will work.
(it's a Unit - Issue Order with no target action)

If what you want is to limit how many units a player can train, then there is an easier way
  • Player - Limit training of Footman to 1 for Player 1 (Red)
it's Player - Limit Trianing of Unit type
That will allow only a number of units you set in here to be trained for selected player

---
Other options you could try could be
Hiding and immediately unhiding the building
or
Remove and immediately create new building with same health in same spot
 
Thanks for the will of help but it's not so simple.

although I'm not really sure this will work.
It doesn't. That's why I'm asking.

If what you want is to limit how many units a player can train, then there is an easier way
I have to do something much more complexed.

Hiding and immediately unhiding the building
Doesn't work.

Remove and immediately create new building with same health in same spot
This solution is unacceptable because of too many other triggers referring to the building.
 
Last edited:
You'll need a loop.

Make a unit group variable, let's call it StopTraining

When you want the unit to stop training, add the barracks to StopTraining.

Make a new trigger.

Event: every 0.03 seconds
Conds: none
Actions:
Unit group - pick every unit in StopTraining and do actions:
Unit group - remove picked unit from StopTraining
Custom script: call IssueImmediateOrderById( GetTriggerUnit(), 851976 )

EDIT: You need to use
  • Custom script: call IssueImmediateOrderById( GetTriggerUnit(), 851976 )
That is the order for cancel.
 
Status
Not open for further replies.
Back
Top