• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Tiny Building Order ID work-around (Is there a better way?)

Status
Not open for further replies.
Level 2
Joined
Nov 3, 2021
Messages
11
Since all the tiny building spells use the same order ID they can't be used on the same unit. I've found a work-around by making each spell contained in its own spellbook, but the extra steps make it really jank. Is there a way to make it so once the spellbook dummy ability is activated for it to automatically cast the ability and force the player into the building placement screen?
Or maybe there's a better way to do this and I'm not seeing it?
 
Level 2
Joined
Nov 3, 2021
Messages
11
Thanks, it did help and I manged to make it work but it did take some time sadly because the links in Pyrogasm's post are dead so I had to scrach my head for a while in some instances.
Even so, the jury-rigging you have to go through though is kind of atrocious, and the repeated sound of click spam might get on people's nerves.
Here are the triggers I used, maybe people will find them useful.
You'll need to have at least 3 dummy abilities like Pyrogasm said. The actual tiny build ability, the channel-based ummy ability the player clicks on to start the trigger (I put it as order ID purge), and the "Cancel Detector" channel-based ability (I put it as order ID rainofchaos - Also don't forget to give it a hotkey!).
I used hashtables to store my timer handles, they don't have to be array hashtables, but I need it as such in my map.
  • BuildingTinyCycle
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(purge))
    • Actions
      • Set TempUnit = (Ordered unit)
      • Set TempPlayer = (Owner of TempUnit)
      • Set TempPlayerNr = (Player number of TempPlayer)
      • Unit - Order TempUnit to Stop
      • Unit - Add Build War Mill (Orc) to TempUnit
      • Unit - Add Cancel Detector (Cancel Detector) to TempUnit
      • Set TinyBuildLastUnit[TempPlayerNr] = TempUnit
      • Countdown Timer - Start TinyBuildTimer[TempPlayerNr] as a One-shot timer that will expire in 0.03 seconds
      • Hashtable - Save Handle Of(Last started timer) as TimerTinyBuildKey of TimerBuildKey in DatabaseTimers[TempPlayerNr]
      • Trigger - Add to BuildingTinyWait <gen> the event (Time - (Load TimerTinyBuildKey of TimerBuildKey in DatabaseTimers[TempPlayerNr]) expires)
  • BuildingTinyWait
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set TempPlayer = (Player((Integer A)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • TinyBuildCheck[(Integer A)] Equal to 0
                  • (Key (Expiring timer)) Equal to (Key (Load TimerTinyBuildKey of TimerBuildKey in DatabaseTimers[(Integer A)]))
            • Then - Actions
              • Game - Force TempPlayer to press the key F
              • Set TinyBuildCheck[(Integer A)] = 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • TinyBuildCheck[(Integer A)] Equal to 1
                  • (Key (Expiring timer)) Equal to (Key (Load TimerTinyBuildKey of TimerBuildKey in DatabaseTimers[(Integer A)]))
            • Then - Actions
              • Game - Force TempPlayer to press the key D
              • Countdown Timer - Start TinyBuildTimer[TempPlayerNr] as a One-shot timer that will expire in 0.01 seconds
              • Hashtable - Save Handle Of(Last started timer) as TimerTinyBuildKey of TimerBuildKey in DatabaseTimers[TempPlayerNr]
            • Else - Actions
  • BuildingTinyCheck
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(rainofchaos))
    • Actions
      • Set TempUnit = (Ordered unit)
      • Set TempPlayer = (Owner of TempUnit)
      • Set TempPlayerNr = (Player number of TempPlayer)
      • Unit - Remove Cancel Detector (Cancel Detector) from TempUnit
      • Unit - Remove Build War Mill (Orc) from TempUnit
      • Set TinyBuildCheck[TempPlayerNr] = 0
      • Custom script: call RemoveSavedHandle( udg_DatabaseTimers[udg_TempPlayerNr], udg_TimerBuildKey, udg_TimerTinyBuildKey )
 
Status
Not open for further replies.
Top