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

How do you Unpossess a unit?

Status
Not open for further replies.
Level 1
Joined
Feb 26, 2009
Messages
3
Hi, I am trying to make a map were you can have a hero that uses possession to fight, but I want to know how do you get it so that when you possess a unit it becomes a hero and when that unit dies, you get your hero back as the same level as the unit you possessed.
 
Unit casts possession on a unit, store casting unit in a variable, store possessed unit in a variable, store owner of possessed unit in a variable, move casting unit somewhere he can't be found, add unpossess ability to possessed unit, change owner of possessed unit to owner of casting unit.

Possessed unit casts unpossess, move caster of possession (stored in a variable) to position of possessed unit, change owner of possessed unit back to what it was before (stored in a variable), remove unpossess ability from possessed unit.

If you want it to be MUI, use an indexing system.
 
Level 4
Joined
May 6, 2007
Messages
87
Hint: Variables store data. You want to store the unit that is doing the possessing into a variable, the unit that is being possessed, etc. Create some variables.
 
Level 9
Joined
Oct 28, 2007
Messages
435
The most optimal way of doing this would be storing the player number of the converted unit in its custom value. This would require no variables or systems at all...but since a unit can only have one custom value....the drawback of this would be you can have no other system that also uses custom values...
 
Status
Not open for further replies.
Top