• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Unit upgrades

Status
Not open for further replies.
Level 4
Joined
Jul 10, 2013
Messages
73
I'm wondering if there's a way to make it so when a player upgrades something (a upgrade ranging from level 1-level 50), that the upgrade affects my computer player. I already know how to do this, I'm just wondering if theres a way to create this trigger without having 50 of them.

  • Zombie health1
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Current research level of Zombie Health (Q) for Player 12 (Brown)) Equal to 1
    • Actions
      • Player - Set the current research level of Zombie Health (Q) to 1 for Player 11 (Dark Green)
 
Level 25
Joined
May 11, 2007
Messages
4,651
  • Upgrade Finishes
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Iron Forged Swords
    • Actions
      • -------- Condition is Tech type, just press 'T' and you'll find it --------
      • -------- Current research level is in Player - Current Research level --------
      • Player - Set the current research level of Iron Forged Swords to (Current research level of Iron Forged Swords for (Owner of (Triggering unit))) for Player 11 (Dark Green)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Is there a way to do this where one of 9 players upgrades the same upgrade and that whoever has the highest upgrade at the time goes to the computer?
Iterate through all players and store the largest upgrade level (maximum search), then you set the upgrade level for the computer to this upgrade level.
 
Level 11
Joined
Jun 2, 2004
Messages
849
  • set TempInt = some default number (0?)
  • pick every player in all players and do multiple actions
  • if then else multiple functions
  • conditions
  • level of upgrade for picked player greater than TempInt
  • then
  • set TempInt equal to level of upgrade for player
  • else
  • do nothing
  • (outside of loop) set level of upgrade for player 12 brown to TempInt
too lazy to make it look nice
 
Status
Not open for further replies.
Top