• 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] Clone a hero after it dies?

Status
Not open for further replies.
Level 1
Joined
Mar 19, 2008
Messages
6
This would be like a revival trigger except I need the unit to be a completely different unit instead of reviving it.

The only way I can think of is:
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) is A Hero) Equal to True
  • Actions
    • Unit - Remove (Triggering unit) from the game
    • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Center of RECT <gen>) facing Default building facing (270.0) degrees
    • Hero - Set (Last created unit) Hero-level to (Hero level of (Triggering unit)), Hide level-up graphics
Then check the abilities of the dying unit and add them one at a time:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of ABILITY for (Triggering unit)) Greater than 0
    • Then - Actions
      • Unit - Add ABILITY to (Last created unit)
    • Else - Actions
Stats aren't an issue for me as the created unit will have the same stats in my map.

Is there an easier way?

Thanks.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
May I wonder what you are going to use it for? (it helps me to help you)

As I can see, I see no point in creating a completely new unit, with same stats, same abilities as the older one when it looks exacly the same.

At least your trigger shows that
 
Level 1
Joined
Mar 19, 2008
Messages
6
The BX-TRS 2 inventory system I am using functions based on the unit. I need it to forget that it is working on that unit when it dies in order to simulate the effect of the unit dropping items and having an empty inventory. Basically, I don't know how to manipulate the system to drop items so I need to find some other way about it. The end result would be a hero with no items but otherwise identical and then I would use triggers to create some random items at the place where the unit died.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
The end result would be a hero with no items but otherwise identical
Well couldn't you just change the Item property on the item, in the Item section in Object Editor?
There is a field there called Stats - Drops when carrier dies
Simply set it to "true"

then I would use triggers to create some random items at the place where the unit died.
If that's the fact, that you want it to drop random item... Do you mean any random item, or all the dying units item, or a random item from his inventory?
 
Level 1
Joined
Mar 19, 2008
Messages
6
I want it to drop all items. The random item thing is simply a workaround that I was thinking about. You are correct that it is normally an easy process, however, BX-TRS II doesn't use warcraft 3 items it uses destructible icons and triggered bonuses to simulate the effect of items. Changing the object properties to drop on death has no effect because the item doesn't exist on the hero. If I could figure out how to drop items on death that would be best but I don't know how, and have yet to see anyone that does. I have to resort to this method or figure out how to create something similar to the original dropping code(used to drop a single item after clicking a button) below:
 
Last edited:
Level 23
Joined
Nov 29, 2006
Messages
2,482
humm.... As far as I know, I dont know jass yet, (and as far as I know you shouldn't post jass in here)

And this system, I tried it, and it seems to be way over my limit...

I think it would be more handy if you posted this thread in the Jass Section

Im sorry but its looks very complicated for me, this system and all, ask anyone who knows jass. I think they can help you out

/Regards
 
Level 1
Joined
Mar 19, 2008
Messages
6
Ok, I edited that out I was just trying to show you why I needed this. I could still use an easier method of cloning a hero if anyone knows how. Thanks.
 
Status
Not open for further replies.
Top