• 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.

Disabling icons without actually disabling the building/unit/ability?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
I need something to do this so my spell can be MUI compatible.

If it'd help, here's my trigger.

  • Human Build Icons
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to (==) Peasant
    • Actions
      • -------- IF WORKER PRESSED "BUILD" OR "ADVANCED BUILD" --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Multiple ConditionsOr - Any (Conditions) are true
              • Conditions
                • (Issued order) Equal to (==) (Order(manashieldon))
                • (Issued order) Equal to (==) (Order(manashieldoff))
          • Then - Actions
            • -------- Advanced Construction --------
            • Player - Make Town Hall Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Farm Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Barracks Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Altar of Kings Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Lumber Mill Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Blacksmith Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Scout Tower Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Arcane Vault Unavailable for training/construction by (Owner of (Ordered unit))
            • Player - Make Workshop Available for training/construction by (Owner of (Ordered unit))
            • Player - Make Arcane Sanctum Available for training/construction by (Owner of (Ordered unit))
            • Player - Make Gryphon Aviary Available for training/construction by (Owner of (Ordered unit))
            • -------- FORCE "BUILD" KEY --------
            • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851994)
          • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Issued order) Equal to (==) (Order(windwalk))
              • Then - Actions
                • -------- Basic Construction --------
                • Player - Make Workshop Unavailable for training/construction by (Owner of (Ordered unit))
                • Player - Make Arcane Sanctum Unavailable for training/construction by (Owner of (Ordered unit))
                • Player - Make Gryphon Aviary Unavailable for training/construction by (Owner of (Ordered unit))
                • Player - Make Town Hall Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Farm Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Altar of Kings Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Barracks Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Lumber Mill Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Blacksmith Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Scout Tower Available for training/construction by (Owner of (Ordered unit))
                • Player - Make Arcane Vault Available for training/construction by (Owner of (Ordered unit))
                • -------- FORCE "BUILD" KEY --------
                • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851994)
              • Else - Actions
It disables the /icon/, so it performs what I need. But because of this, if a worker is issued an order to build something in the "Advanced" tab, then another worker is issued an order to build something in the "Basic" tab, the worker building something in the Advanced tab will not be able to build.

Maybe there's a work-around to this? Idk.


EDIT:

Alternative -

"Basically...The only way I can see this working is firstly removing the original order to build the structure, then issue the same order using the JASS function, which I think ignores the trigger to set the structure to unavailable...Right? I don't actually know. xD


I had another idea that once the build menu is exited (Figuring it someway to pick up on that, like the build order is issued would definitely do that. Or maybe a different unit is selected would be easier) then re-enable all the buildings. But that wouldn't work if someone is still in a build menu while the order from the opposite build menu is still being issued..."

Anything to even slightly push me along will be GREATLY appreciated.
 
Last edited:
"Basically...The only way I can see this working is firstly removing the original order to build the structure, then issue the same order using the JASS function, which I think ignores the trigger to set the structure to unavailable...Right? I don't actually know. xD

then try it out and see if it works... XD
 
Level 12
Joined
May 20, 2009
Messages
822
then try it out and see if it works... XD

I have no idea how to do that. Not one clue. xD

I'm /trying/ to figure this stuff out, though. So don't try calling me lazy!

Would this work?

JASS:
if ( not ( GetIssuedOrderIdBJ() == 851996 ) )
?

As a condition to figure out which order is going out.

(That ID is Orc Build. Right now, I'm just trying to figure out how to pick up on the build orders in general.)
 
Level 12
Joined
May 20, 2009
Messages
822
JASS:
function Trig_Replace_Buildings_P1_Conditions takes nothing returns boolean
    if ( not ( GetIssuedOrderIdBJ() == 851996 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Replace_Buildings_P1_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_053" )
endfunction

//===========================================================================
function InitTrig_Replace_Buildings_P1 takes nothing returns nothing
    set gg_trg_Replace_Buildings_P1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Replace_Buildings_P1, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_Replace_Buildings_P1, Condition( function Trig_Replace_Buildings_P1_Conditions ) )
    call TriggerAddAction( gg_trg_Replace_Buildings_P1, function Trig_Replace_Buildings_P1_Actions )
endfunction

This doesn't seem to work, though. Am I using the wrong order?

Basically, I wanna pick up when the order goes out so I can fire the trigger off of it, remove that order, then add the new order that is exactly the same.
 
Status
Not open for further replies.
Top