• 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] Replacing existing units on the map

Status
Not open for further replies.
Level 2
Joined
Oct 11, 2009
Messages
5
Here's my problem:

I'm making a similar upgrade to that of Trollheadhunter-->Berserker, and I'm not sure if I completely understood the mechanic in which the upgrade works but I thought it was sort of built in the game and I'd have to work with triggers.

Okay so I went and gave the unit production building the initial unit and the upgraded version of that unit, then made a trigger that removes the availability of the upgraded unit on map initialization, created the upgrade from the same base of the troll berserker upgrade and so far so good. The building in question can train the initial unit at start and the upgraded unit after the upgrade is researched.

Now if you remember my topic, you can prolly already guess what my problem is. I also want the existing old units on the map to become upgraded units when the research is completed. I already came up with a trigger, but apparently the one I made doesn't work. No surprise really, as I'm still fairly new with the world editor and triggering.

Below is what I've made, if you could tell me if it's something minor or if I've done everything wrong right from the start it'd be greatly appreciated. And sorry cos I'm new and I don't know how to put the trigger into that box where it'd be easier to read. It's short and simple though so I hope you won't have much trouble reading it.

Events
-Unit - A unit Finishes an upgrade

Conditions
-(Researched tech-type) Equal to (have the specific research here)

Actions
-Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit))) and do (Actions)
Loop - Actions
- If ((Unit-type of (Picked unit)) Equal to (the specific unit I want)) then do (Unit - Replace (Picked unit) with a (improved version of the unit) using The old unit's relative life and mana) else do (Do nothing)

Thanks beforehand!
 
Last edited:
Level 2
Joined
Oct 11, 2009
Messages
5
A shame no one replied to my problem, perhaps I gave a too lengthy description and no one could bother to read it. The good news is that I spotted my silly mistake: my trigger read "Unit - A unit finishes and upgrade" when it should've been finishes a research. Careless... Fixed and works like clockwork!
 
Status
Not open for further replies.
Top