How do i cancel construction of a unit with a trigger???

Evote

New Member
Reaction score
4
How do i cancel construction of a unit with a trigger???

PHP:
aura power
    Events
        Unit - A unit Begins an upgrade
    Conditions
        (Unit-type of (Constructing structure)) Equal to Sim Aura.
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Power[(Player number of (Owner of (Constructing structure)))] Less than 30
            Then - Actions
                Selection - Add (Constructing structure) to selection for (Owner of (Constructing structure))
                Wait 0.10 seconds
                Game - Force (Owner of (Constructing structure)) to press the key esc
                Player - Add 150 to (Owner of (Constructing structure)) Current gold
            Else - Actions
                Do nothing
 

Evote

New Member
Reaction score
4
ooh dw i found a way. um like this:
stop construction
Events
Unit - A unit Begins construction
Conditions
((Unit-type of (Constructing structure)) Equal to Sim Aura.) and (Power[(Player number of (Owner of (Constructing structure)))] Less than or equal to 29)
Actions
Player - Add 600 to (Owner of (Constructing structure)) Current gold
Unit - Remove (Constructing structure) from the game
Game - Display to (Player group((Owner of (Constructing structure)))) the text: That unit requires ...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Custom script: call IssueImmediateOrderById( GetTriggerUnit(), 851976 )

Cancel is cancel.


It's also about time you read the forum rules.
 

Evote

New Member
Reaction score
4
that doesn't work and this different to other 1

that stops upgrades
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
"It doesn't work" is not a very good problem description.

That said, cancel is cancel. Doesn't matter what you cancel.
The custom action above is like clicking the cancel button by hand.
 
Z

Zell

Guest
Make your builder a Wisp (because when they stop building it dies... I think -_-) and just "Unit - Order (Constructing Unit) to Stop" if your power or whatever is insuficient? Or you could use food as power, stop them before they start...
 

Evote

New Member
Reaction score
4
that smart i will use that and ace i have used that be4 thats for it.
genius
 
Q

Que

Guest
If this is what I think you are doing then this solution will work perfectly...

All you have to do to cancel a construction/upgrade/ whatever
is transfer control of that building that is doing the upgrading to another player (eg: Com player) then straight away transfer the control back to you and the upgrade will have been stopped
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top