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

Re-Add Last Replaced Unit back to Selection

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well then, take this situation as an example;
1. A Footman is trained from the Barracks
2. There is an upgrade at that Barracks, Upgrades your Footman into Knights
3. When you have finished that upgrade...

  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to KnightsUpgrade
    • Actions
      • Set ResearchBoolean[(Player number of (Triggering player))] = True
This will set a Boolean (array) for that Player, so that the game can "recognize" that player has went through that research/upgrade

4. You should do this next;
  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • ResearchBoolean[(Player number of (Triggering player))] Equal to True
    • Actions
      • Unit - Replace (Triggering unit) with a Knight using The old unit's relative life and mana
This will assure you that if you have already research the upgrade, it will replace newly trained units (namely Footman) to a Knight.
 
Status
Not open for further replies.
Top