• 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] how can i trigger a unit to be replaced and then do an action

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
Unit is issued an order targeting an object
Order == attack or order == smart // or some other conditions you need
Order unit to transform
Order unit to attack target

You might need to use a 0.00 second timer before ordering the transform/attack. Or a longer delay depending on the transformation. You could try catching the end of the transformation with an event.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Action
Unit >> Replace
  • Unit - Replace (Triggering unit) with a Footman using The old unit's relative life and mana
Is that what you want ?? No transformation ability is needed.

Side effect, Correct me if whrong: The replacing unit will not take over the orders of the replaced unit and will just stop. So you'll have to, if you want them to be continued, store them somehow and order the replacing unit to do them in the trigger after the replacement.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Save the order has a string then use Ifs to order the replaced unit.

set tempstring = current order of unit to be replaced
if tempstring = attack
set tempunit = target unit of the issued order
replace unit
Order replaced unit to attack tempunit


Something along these lines I think...
Although Passive Unit Transformation would save the orders I believe so...might be worth looking into (the link GIMLI said)
 
Status
Not open for further replies.
Top