• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Stop treining unit

Status
Not open for further replies.
Level 28
Joined
Sep 26, 2009
Messages
2,520
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
 
Level 5
Joined
May 15, 2008
Messages
105
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:
Level 25
Joined
Jul 10, 2006
Messages
3,315
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.
Top