HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Replaceing hero problem

07-20-2004, 06:15 PM#1
c-r0w
hi!
I have a trigger that is suppost to replace a hero when it drops an item.

But everytime, the game crashes.

I figured that it might be impossible to replace heros in the traditional way,

Code:
Event:
Unit - A unit loses an item

Action:
Unit - Replace (Triggering unit) with a Paladin using old units relative life and mana  

Any suggestions that might work?
07-20-2004, 06:22 PM#2
Dark_Uber
Instead of using the replace function, try just doing this:

Actions: Unit - Remove (Triggering Unit) from game
Unit - Create 1 Paladin at (Location of (Triggering Unit)) with (Triggering Unit) relative life and mana

Hope this helps... :D

Edit: Sorry, the old warcraft chat I used everyone used colors...I'll stop that o_O
07-20-2004, 08:53 PM#3
Shimrra
If you do it Computer[Uber]'s way, you should also set the levels of the paladin's abilities and his Hero level to variables, because the new paladin will be the default level 1 with no abilities learned.

Computer[Uber], please do not write in all colors like that. Thanks
07-20-2004, 10:33 PM#4
Anitarf
In my map EoW, I use "replace unit" on heroes with no problems. It's very handy because it keeps the levels, items, selection, and from 1.15 forth, it also stays in the skill-learning window if you were in it when the hero was replaced.

I think something else must be wrong, but I have no idea what, perhaps the other hero has illegal stats (this is not the case if you already have heroes of his type on the map before the crash)...
07-20-2004, 11:50 PM#5
th15
I've used the replace unit triggers on heros before and it does cause intermittent problems. Sometimes palyers would lose control of their hero, items would not transfer (most common problem) and exp may mess up.

Then again my maps are quite heavy on the CPU so you probably should'nt have any problem with the trigger if you don't do anything crazy on the map. But I think if you replace a unit with different hero abilities it might crash (all the heros I replace always have identical abilities).
07-21-2004, 08:00 AM#6
Anitarf
Nope, I replace heroes with different abilities and I have not yet encountered a problem with it (and I have played my map quite some times, and in every game, a player normaly changes hero classes 2 times). As I said, try placing the hero you are replacing with on the map, and if it crashes while loading, then your hero is the problem, otherwise, if you can play with that hero, the problem is somewhere else. In that case, what else does your trigger do besides replacing the unit? Can you copy it here?
07-21-2004, 01:03 PM#7
c-r0w
thanks for all you replys..

I first encountered the error on my new map with lots of triggers and stuff.. so i made a new map to test if the error was still there... it was..

I will try some other ways now and see how it goes.. it might be some weird setting that i have fiddled with