• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Stop treining unit

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,405
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