HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How can I force a building to cancel training a unit?

02-14-2006, 04:37 PM#1
Fulla
Theres an action
Unit - Issue Train/Upgrade Order

With this I can make a barracks train a footman.

But I want to be able to STOP a Barracks training a footman?
How can I do this.

thank you
02-14-2006, 11:10 PM#2
Immoralis
Can you
Trigger:
Player - Make Footman Unavailable for training/construction by Player 1 (Red)
during the training process ?

or possibly
Trigger:
Player - Limit training of Footman to max_limit for Player 1 (Red)
02-15-2006, 12:40 AM#3
johnfn
There is a simpler way.

Just replace it with another barracks
02-15-2006, 12:47 AM#4
Immoralis
what if there are other units of different type in que
02-15-2006, 04:19 AM#5
BBDino
Can you issue a 'cancel' order to the building?
02-15-2006, 10:43 AM#6
johnfn
Quote:
Originally Posted by Immoralis
what if there are other units of different type in que
You could re-order it to make those units, just have a trig detect what units are being created by the barracks.
02-15-2006, 10:45 AM#7
Vexorian
Yes , you can http://www.wc3jass.com/viewtopic.php?t=147
02-15-2006, 10:40 PM#8
Fulla
Ok so just custom script this?

constant function OrderIdCancel takes nothing returns integer
return 851796
endfunction

How would I specify which building?

thank you
02-15-2006, 11:03 PM#9
shadow1500
Collapse JASS:
call IssueImmediateOrderById(building,851796)
02-16-2006, 12:00 AM#10
Fulla
hmm.. would that pick all buildings of a type and order them to cancel?

How bout simply, Order triggering unit to cancelbuildorder?
That way I can setup the triggers easily

Sorry to keep nagging
thank you
02-16-2006, 12:02 AM#11
Anitarf
Collapse Spoonfeed:
call IssueImmediateOrderById(GetTriggerUnit(),851796)
02-16-2006, 01:23 PM#12
Fulla
Ok I couldnt get it working I thought I do it like this?

put this bit in custom script (of map)

Collapse JASS:
 constant function OrderIdCancel takes nothing returns integer
return 851796
endfunction 

put this bit in an action under custom script

Collapse JASS:
call IssueImmediateOrderById(GetTriggerUnit(),851796)

What did I do wrong?

I assumed the first part sets Cancel = 851796
2nd part order triggering unit to 851796 (which is cancel)

It seemed logical to me, but probably got it all wrong
02-16-2006, 02:44 PM#13
shadow1500
u put Custom Script: call IssueImmediateOrderById(GetTriggerUnit(),851796)
in the place where u want the unit to cancel trainning
02-16-2006, 04:46 PM#14
Anitarf
Quote:
Originally Posted by Fulla
I assumed the first part sets Cancel = 851796
2nd part order triggering unit to 851796 (which is cancel)

It seemed logical to me, but probably got it all wrong
Nope, it doesn't go like that. The first function is only optional, all it does is it returns the cancel order id. You would use it like this:
Collapse JASS:
call IssueImmediateOrderById( GetTriggerUnit(), OrderIdCancel() )
It's only meant for convenience, since it's easier to remember a descriptive function name than the number. However, if you use the number directly, there's no need for the first function.
02-24-2006, 10:52 AM#15
Anitarf
I've been trying to use the cancel order myself today and couldn't get it to work either. As it turned out, I had the order id wrong, it's not 851796, but 851976!