• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Equalize an upgrade.

Level 19
Joined
May 25, 2004
Messages
1,481
I’ve been working on a Warcraft III map that includes Blood Elves, and I’m trying to make their upgrades match the standard Human upgrades (so both tech trees stay balanced and equivalent).

Right now, I’m using triggers to sync the upgrade levels between the Blood Elf upgrades and the regular ones. However, I’m not sure if I’m doing this the right way or if there’s a more efficient approach.

Here’s what I have so far:
  • Blood Elf Upgrades
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Steel Arrowheads (Blood Elf) for (Triggering player)) Equal to 1
        • Then - Actions
          • Player - Set the current research level of Black Gunpowder to 1 for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Steel Arrowheads (Blood Elf) for (Triggering player)) Equal to 2
        • Then - Actions
          • Player - Set the current research level of Black Gunpowder to 2 for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Steel Arrowheads (Blood Elf) for (Triggering player)) Equal to 3
        • Then - Actions
          • Player - Set the current research level of Black Gunpowder to 3 for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Studded Leather Armor (Blood Elf) for (Triggering player)) Equal to 1
        • Then - Actions
          • Player - Set the current research level of Studded Leather Armor to 1 for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Studded Leather Armor (Blood Elf) for (Triggering player)) Equal to 2
        • Then - Actions
          • Player - Set the current research level of Studded Leather Armor to 2 for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Studded Leather Armor (Blood Elf) for (Triggering player)) Equal to 3
        • Then - Actions
          • Player - Set the current research level of Studded Leather Armor to 3 for (Triggering player)
        • Else - Actions
          • Do nothing
Does this look like a good way to handle upgrade syncing, or is there a better / more efficient method I should be using?
 
Last edited:
You don’t need to check each level manually xd. When an upgrade finishes, you can just read its current level and apply that directly to the matching upgrade.

So instead of multiple Ifs simply do:

Code:
set lvl = current research level of Blood Elf upgrade
set Human upgrade level = lvl

If you plan to sync multiple upgrades, it’s cleaner to map them (array/hashtable) and just apply the same level to the corresponding one.

Your current approach works, but it won’t scale well as you add more upgrades I guess.
 
You don’t need to check each level manually xd. When an upgrade finishes, you can just read its current level and apply that directly to the matching upgrade.

So instead of multiple Ifs simply do:

Code:
set lvl = current research level of Blood Elf upgrade
set Human upgrade level = lvl

If you plan to sync multiple upgrades, it’s cleaner to map them (array/hashtable) and just apply the same level to the corresponding one.

Your current approach works, but it won’t scale well as you add more upgrades I guess.

  • Blood Elf Upgrades
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to Steel Arrowheads (Blood Elf)
        • Then - Actions
          • Player - Set the current research level of Black Gunpowder to (Current research level of Steel Arrowheads (Blood Elf) for (Triggering player)) for (Triggering player)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to Studded Leather Armor (Blood Elf)
        • Then - Actions
          • Player - Set the current research level of Studded Leather Armor to (Current research level of Studded Leather Armor (Blood Elf) for (Triggering player)) for (Triggering player)
        • Else - Actions
 
Last edited:
Back
Top