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

[General] Give unit with upagrades

Status
Not open for further replies.
Level 2
Joined
Jun 18, 2013
Messages
16
Hi there, I need a bit help. I making a map where you build something that spawn unit for computer to fight, but I want to these created units keeping their upgrades separately. I mean let say player 1 research melee attack lvl 1 but player 2 not so when their unit spawn for the comp player they have different upgrades. Is it possible?

Sorry if my english is bad. I look forward for any help thank you.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Maybe there's an easier approach but you could give each User their own Computer ally that controls their units.
Then whenever a User researches something you also research it for their Computer ally.

So let's say your map has 4 users:

Player 1's Computer Ally = Player 5
Player 2's Computer Ally = Player 6
Player 3's Computer Ally = Player 7
Player 4's Computer Ally = Player 8

  • Finish Research
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Set Variable ResearchLevel = (Current research level of (Researched tech-type) for (Owner of (Triggering unit)))
      • Player - Set the current research level of (Researched tech-type) to ResearchLevel for Player 5 (Yellow)

A more advanced design with arrays:
  • Setup Computers
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Variable PlayerComputer[1] = Player 5 (Yellow)
      • Set Variable PlayerComputer[2] = Player 6 (Orange)
      • Set Variable PlayerComputer[3] = Player 7 (Green)
      • Set Variable PlayerComputer[4] = Player 8 (Pink)
  • Finish Research
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Set Variable ResearchLevel = (Current research level of (Researched tech-type) for (Owner of (Triggering unit)))
      • Player - Set the current research level of (Researched tech-type) to ResearchLevel for PlayerComputer[(Player number of (Owner of (Triggering unit)))]
 

Attachments

  • Research Triggers.w3m
    16.4 KB · Views: 10
Last edited:
Status
Not open for further replies.
Top