• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to resurrect a corpse

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2012
Messages
82
Hello.
I was trying to remake the resurrection spell to resurrect enemy unit too, and I realize I have no idea how to pick a corpse to resurrect it.
Please help.
Thank in advance.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Have you tried modifying with its targets field?
Go to the OE (Object Editor) Abilities, find that Resurrection ability then find the field: Stats - Targets Allowed
Check the 'Enemy'.

If you want to own those resurrected enemies you can change their ownership.
Similar Thread that may help you.
 
Level 3
Joined
Mar 21, 2020
Messages
35
Code:
Event: 
unit has died (generic)

Conditions: 

Actions: 
set dyingUnitType = unit-type of triggering unit
set realVariable1 = convert triggering unit's real value (hit points) (uHoc or smt I believe)
set realVariable2 = convert triggering unit's real value (mana)
etc..
*(remove triggering unit from game) optional, or disable can decay in object editor
create 1 dyingUnitType for triggering player at X and Y position of triggering unit
set lastcreatedunit's hit points to realVariable1
set lastcreatedunit's mana to realVariable2
etc..

If you can't figure it out, let me know and I'll show you in the World Editor!
 
Level 4
Joined
Oct 28, 2012
Messages
82
Thank you.
The similar thread is exactly what I want.


@lil apex
thank
I think I could go with this for less chance for problem to happen.
 
Last edited:
Level 3
Joined
Mar 21, 2020
Messages
35
Thank you.
The similar thread is exactly what I want.


@lil apex
thank
I think I could go with this for less chance for problem to happen.

Yeah it's the most manual way I can think of (and therefore the least buggy).

If you keep everything in one trigger try to use "triggering unit" etc. (in-built variables) as much as you can, they're faster (and less buggy) than storing them to variables. Store it to variables if you want to call on the data in another script or at a later time.

Good luck with your mapmaking!
 
Status
Not open for further replies.
Top