• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Cancelling constructing unit not working

Status
Not open for further replies.
Level 3
Joined
Mar 16, 2008
Messages
46
You are not allow to build farm, any attempt will automatically cancel

Code:
Untitled Trigger 002 Copy
    Events
        Unit - A unit Begins construction
    Conditions
        (Unit-type of (Triggering unit)) Equal to Farm
    Actions
        Game - Display to (All players) the text: bamm
        Custom script:   call IssueImmediateOrderById(GetTriggerUnit(), 851976)

so i dig up old thread and found an order ID that cancel a building when it started to be construct, but is this no longer working.

the above trigger detect when a building is being construct, it check the unit type, than it display a word "bamm" and cancel the construction. everything work until the most important part, it doesnt cancel.

and so i use trigger to detect order

Code:
Untitled Trigger 001
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Game - Display to (All players) for 30.00 seconds the text: (String((Issued order)))

it return (null) when i cancel any building.

please help, how do i trigger cancel building now?
 
Level 3
Joined
Mar 16, 2008
Messages
46
I think the triggering unit for 'Unit - A unit Begins construction' is the worker, not the construction. But might be wrong.

I do a little test before posting, by displaying the name of triggering unit and constructing unit, both the name of the building.


Try this (the condition is an order comparison):
  • Cancel Farm
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(Farm))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop

ok thx it work, but i still dont understand why the order ID no longer working.


edit:
theres a small problem, using this method, unit will be stop at where it stand when the order is given, not when it reach the point to build.
 
Last edited:
Level 3
Joined
Mar 16, 2008
Messages
46
If you add a "Wait 0.00 seconds" before the order it should work, too.

But I believe stopping directly at build-order might be wanted because the worker does not need to walk, the consutrction process does not need even to start. Plus, the player might lose some gold and lumber.

okay, i got a solution, but i still wish to know why the call function for order ID dont work, with similar setting and the exact same order ID, i can stop a building from upgrading into another building.
 
Status
Not open for further replies.
Top