HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trapping "Hero Dies" when hero has an anhk

05-04-2003, 08:34 PM#1
Telamon
I'm currently trying to implement a trigger that makes a hero drop one of his items at random when he dies. The problem is, I'm editting a defense-type map where anhks are used to give the heroes "lives". So my question is, how can I detect when a hero has died if he has one or more anhks of revival on him? I've tried used the "Hero Died" and "Hero becomes revivable" events, but apparently niether kick in if the hero is about to be revived by an anhk.

On a side note: is there a way to extend the amount of time it takes an anhk to revive a hero? I don't want to do any MPQ editting because I'm designing this map for LAN and internet play and want to just let people DL and play without hassle of replacing MPQs.

Thanks for any input!
05-04-2003, 10:45 PM#2
FyreDaug
For the second part, you can do mpq editing for that, the map itself counts as an MPQ. Edit the AbilityData.slk file and scroll down until you find something related to the ankh (look at the ability in the unit editor and find that in the .slk file) There is a commented section there on what to change.
05-04-2003, 11:41 PM#3
SyDemon
For your first part, are you doing so to keep track of the number of "lives" a hero has?

When you use the "hero becomes revivable" did you remember to refer to the hero via "Revivable hero?"
05-05-2003, 02:58 AM#4
Telamon
Maybe I gave too complicated a description before. Say I was making a normal map with a normal hero that has a normal anhk of revival in his inventory (the item that resurrects the hero when he dies from the regular game). I want to execute a script to make him drop an item when he dies. Deciding when to execute that script is what is giving me trouble. If the hero didn't have an anhk, it would be easy, I would just use the "Hero Dies" trigger. But since the hero has an anhk, that event isn't fired. So what else can I do?

The "Hero becomes revivable" event doesn't work either, BTW
05-05-2003, 03:36 AM#5
MicrosoftXP
this isnt easy.. but heres the soln.

you have to make a 'fake' ankh item. it doesnt have the reincranate ability. You detect when the hero dies, check if he has a fake ankh item, remove it if he does and revive. You can also get tricky and add special effects and a wait etc.

if u need more help than that i can take screen shots of my triggers from my map and post them.
05-05-2003, 09:46 AM#6
Guest
maybe im crazy but coundnt you have a condition for the trigger that does an item comparison?

maybe i'm misunderstanding something.
05-05-2003, 01:42 PM#7
MicrosoftXP
for whatever reason the 'hero uses item' event didn't work for ankhs when i tried it, although it was a long time ago and i was a nub mapper then so mebe i just messed it up.
05-05-2003, 02:14 PM#8
MartinezTG
Hmm... I didn't read the thread carefully but to detect if a hero who has an ankh has died you can simply detect if he has 0 hp.

Martinez
05-05-2003, 11:29 PM#9
Guest
Yep.
05-06-2003, 02:49 AM#10
MicrosoftXP
wrong. that would be easy and its not that easy. When a hero has an ankh the 'unit dies' event does not fire, the hero hasn't 'died' or at least the computer doesnt think so. Thats why you never hear "our allys hero has fallen!" when they have an ankh, only when they perma die.
05-06-2003, 04:25 AM#11
Dead-Inside
Yes. When they have an ankh, they never die. They don't become revivable either, so none of the above will work. Look at the other "random drop" maps.
05-06-2003, 07:44 AM#12
rwxr-xr-x
I don't know why the 'Uses item' didn't work, because I've used it before, and it works great, no unecessary SLK editing or fake items needed. The same concept can be applied to the Ressurection ability of the Tauren in order to detect when he's fallen, but is revived.

EVENTS
A unit owned by Player 1 Uses an item
CONDITIONS
Item being manipulated Equal to Ankh
ACTIONS
<fill in your actions>

It's interesting to note that for your event, you can even use 'A unit owned by Player 1 Loses an item'.
05-07-2003, 12:51 AM#13
Dragon
Use a recource, (wood) as lives. i.e. 3 wood = 3 lives. Whenever he died take 1 wood away, ressurect. Execute the 'drop item on random' thing before he gets ressurected. If he gots no wood, dont ressurect. Or you would use an alter of hero revival and just take an item away and drop it when they die. The hero dies, the item is dropped, the player ressurects him at an alter.

Think up some way to get more wood yourself. 8000 gold you can buy a wood maybe?
05-07-2003, 01:12 AM#14
rwxr-xr-x
Quote:
Originally posted by ThePersonThing
Use a recource, (wood) as lives. i.e. 3 wood = 3 lives. Whenever he died take 1 wood away, ressurect. Execute the 'drop item on random' thing before he gets ressurected. If he gots no wood, dont ressurect. Or you would use an alter of hero revival and just take an item away and drop it when they die. The hero dies, the item is dropped, the player ressurects him at an alter.

Think up some way to get more wood yourself. 8000 gold you can buy a wood maybe?


That's good, but what if you need to use wood for purchasing or building something? Granted most UMS games won't use wood, but it still prevents you from being able to use wood for more valuable things. Detecting when an Ankh is used is a much better approach.
05-07-2003, 01:29 AM#15
dataangel
The 0 health and the "fake ankh" tricks will work. The former will work because it uses a different event, the latter will because the hero does actually die.