• 🏆 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!

[Solved] build tiny order string?

Status
Not open for further replies.
Level 5
Joined
May 12, 2008
Messages
77
I got a problem with the build tiny ability. I use it as a hero spell to construct a building. The spell itself works fine. However, i want to limit the number of buildings per hero.
I already tried and used pocket factory and sentry ward. Each time the regarding hero is ordered 'summonfactory' / 'ward' and the number of buildings already placed exceeds the limit, I issue the hero to stop.

The main problem is i dont know the order string of the build tiny ability and i don't want to use pocket factory or sentry ward in this case as the exact placement of the building is way harder to control.

I already tried to detect the casting of build tiny and issue the hero to stop. Doesnt work as the ability is on cooldown even though no building is constructed...

Any ideas how to solve this?
 
Level 13
Joined
May 10, 2009
Messages
868
It doesn't have an order string; You'll have to use its id instead, which is 852619. Here are 2 ways of comparing them:
Custom scripts:
JASS:
    if GetIssuedOrderId() == 852619 then
        call IssueImmediateOrderById(GetTriggerUnit(), 851972)
    endif

Or create a new variable, its data type should be order (of course). Then, as soon as your map initializes, you assign this value to it:

upload_2018-3-30_13-13-45.png


  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Order_BuildTiny = 852619
Then:
  • Prevent Building Tiny
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to Order_BuildTiny
    • Actions
      • Unit - Order (Triggering unit) to Stop
Additional notes:
- If you want to know the order id for abilities that don't have an order string, use this:

  • GetOrderId
    • 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
      • Custom script: call BJDebugMsg(GetUnitName(GetTriggerUnit())+": "+GetIssuedOrderId()+" ("+OrderId2String(GetIssuedOrderId())+")")
It should print something like this:
Code:
 Peasant: 851972 (stop)
 Paladin: 852619 ()

- Be careful with abilities within items, it displays the order id for using an item in a specific slot.
 
Last edited:
Status
Not open for further replies.
Top