• 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.

[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,650
  • 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,285
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