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

Upgrade Order?

Status
Not open for further replies.
I have the following trigger. The problem is that it activates when the structure is ordered to upgrade.

How do I stop it activating when a building is ordered to upgrade?

  • Conversion Setup
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Not equal to (Order(upgrade))
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Rift
          • (Unit-type of (Triggering unit)) Equal to Bastion
          • (Unit-type of (Triggering unit)) Equal to Parapet
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(immolation))
          • (Issued order) Equal to (Order(unimmolation))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Mana Conversion (Dummy) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Mana Conversion (Dummy) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Mana Conversion (Dummy) for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Remove Mana Conversion (Dummy) from (Triggering unit)
            • Else - Actions
 
Don't know if it helps, but this is the upgrade function in jass:
JASS:
function IssueTrainOrderByIdBJ takes unit whichUnit, integer unitId returns boolean
    return IssueImmediateOrderById(whichUnit, unitId)
endfunction

What this means is that, I think, when you issue an upgrade, order's id is equal to the id of the unit you're upgrading to, so simply checking if order string is not "upgrade" might not work because of that. Someone correct me if I am wrong, this is just something I've noticed.
 
Every structure is translated as an order.

For example, if you have a Scout Tower and you upgrade it to e.g. Arcane Tower, the order is "humanarcanetower".
Use this trigger:
  • Check
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
To check the order of your unit (most likely it's the name of the structure without spaces).
Then, in your present trigger, use a condition (Issued order) Equal to (order(xxx/yyy)). Xxx/Yyy since there are 2 types of upgrades. If it is, order your unit to unimmolate (when it immolates, you can add it in a unit group and check if it's already in that group. If it is, order it to unimmolate).
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Kam, the OrderString for upgrades is the name of the structure you're upgrading to. If you want to upgrade from Scout Tower to Cannon Tower, the orderstring is "cannontower". If the Upgrade is based on a custom structure, the order is "custom_*raw ID of the custom unit*", e.g. "custom_h0dK".

You would have to manually insert in the conditions that the given order is not *any of the availble upgrades for that building* OR make the trigger work ONLY when the desired order is given, and not a different one.

You can always use a periodic 0.1 sec trigger with a "Game - Display (Current order or <YourUnit>)" to know what's the order the ability does when you order it to upgrade or do anything else, and then play with it to make it do what you want.
 
Status
Not open for further replies.
Top