Order replaced unit to train unit being trained by triggering unit?

Dito

New Member
Reaction score
0
Hello!

I want this: When I create a unit, the creating unit will be replaced, and then the replaced unit will then train the unit that was originally trained. This is how I did:

Trigger:
  • Morph Units
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Larva
    • Actions
      • Set Point[1] = (Position of (Triggering unit))
      • Unit - Replace (Triggering unit) with a Zerg Cocoon using The old unit's relative life and mana
      • Unit - Order (Last replaced unit) to build a (Unit-type of (Trained unit)) at Point[1]
      • Selection - Add (Last replaced unit) to selection for (Owner of (Triggering unit))
      • Game - Display to (All players) the text: (Name of (Last replaced unit))
      • Game - Display to (All players) the text: (Name of (Trained unit))


The problem is that only the name of; Name of (Last replaced unit) is being showed. Therefor, the last replaced unit doesn't build a unit type of trained unit. How can fix this?
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
In this case, there is no "trained" unit, as the event is "a unit begins training a unit". You could just make units upgrades, and have the larvae upgrade into said units.
 

Dito

New Member
Reaction score
0
I don't want to make 1 upgrade for each unit, that is A LOT of work. Is there no other way around this?

Edit: Solved it like this:
Trigger:
  • Morph Start
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Larva
    • Actions
      • Unit - Replace (Triggering unit) with a Zerg Cocoon using The old unit's relative life and mana
      • Unit - Set the custom value of (Last replaced unit) to (Custom value of (Triggering unit))
      • Unit - Order (Last replaced unit) to train/upgrade to a (Unit-type((String((Issued order)))))
      • Selection - Add (Last replaced unit) to selection for (Owner of (Triggering unit))
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
By Upgrade, I meant adding each unit it trains to the "Techtree - Upgrades" area. This means when someone clicks it, it turns into that unit.
 

Dyslexia://

New Member
Reaction score
13
Yo!
Was just thinking about something...
Why not just use Metamorphosis to change the larva into those weird Zerg eggs, and then use the Custom Value part to indicate which unit the Egg will train?
So, order of events:
Larva -> Beings to Train a... Zergling lets say.
Trigger -> Give Larva a metamorph ability, assigns unit a custom value [like 1] for Zergling
Trigger -> If a Larva casts this ability, check its custom value and make it build accordingly [since it's 1, its a Zergling]
Trigger -> Unit finishes training w/e, kill the egg.
Done and done.
 

Dito

New Member
Reaction score
0
No, I want to train the units regularly and set the limit of units being trained at the same time to 1. I don't want to change the type of the egg.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top