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

Upgrade units of allies, how?

Status
Not open for further replies.
Level 3
Joined
Jan 31, 2017
Messages
12
Hello,

i want to use a building that i own to upgrade the units of another player.

I can get it worked but when i want to have 100 upgrades, i have to write the same IF/THEN/ELSE statement 100 times. This is tedious and i think its not the correct way, and once i have to change something in there, i have to change it 100 times...

I want a "global/general" thing that should work for 100 upgrades... so that once i click on the Research button, it should upgrade the unit once.

I have no experience with variables so far. I assume i need a variable for such global method/loop ?

I am still trying though...

How would you do that?

I click on my blacksmith.
I click on the upgrade.
The allied player's unit gets upgraded by 1.

This is what i want. And it should not give 100 upgrades at once... This is my problem right now...

I use this currently:
For each (Integer A) from 0 to 100, do (Actions)
 
Level 23
Joined
Dec 4, 2007
Messages
1,557
I'd do it like this:

  • TechSync
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Researched tech-type) Equal to (==) Iron Forged Swords
          • (Researched tech-type) Equal to (==) Black Gunpowder
          • (Researched tech-type) Equal to (==) Storm Hammers
          • (Researched tech-type) Equal to (==) Improved Masonry
          • (Researched tech-type) Equal to (==) Animal War Training
    • Actions
      • Player - Set the current research level of (Researched tech-type) to (Current research level of (Researched tech-type) for Player 1 (Red)) for Player 2 (Blue)
 
Status
Not open for further replies.
Top