HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero Revival

04-14-2004, 06:34 PM#1
fugly
iw anna make it in my map then when a hero dies, a command will automatically be issued to the alter to revive the hero, but i can't find the order to revive a hero anywhere in the world editer, so i am turning to jass, any one know the order code or something to revive a hero?
04-14-2004, 10:37 PM#2
PitzerMike
easy enough the order string for reviving is "revive"
04-14-2004, 11:34 PM#3
fugly
...lol... thx, but who will this revive? all of the heros in the alter?
edit: doesn't work...
04-15-2004, 08:15 AM#4
PitzerMike
I think it should be a order targeting a unit (and as target you choose the unit to be revived)
04-19-2004, 12:50 AM#5
iac
Quote:
Originally Posted by PitzerMike
I think it should be a order targeting a unit (and as target you choose the unit to be revived)

Hmmph... I'm not sure revive is order targeting a unit. Here is how i do revive dead heroes:

(Needed variables:
Hero (array, type - unit)
HeroDeathTimes (array, type - integer, filled by zeros at the map initializing or by default)
IntTemp001 (type - integer)
UnitTemp001 (type - unit))

Event:
a) Hero becomes reviveable
b) Unit dies
Conditions:
a) none
b) Dying unit is hero
Actions:
a)set UnitTemp001 = reviveable hero
b)set UnitTemp001 = dying unit
set IntTemp001 = Player Number of (owner of (UnitTemp001))
set HeroDeathTimes[intTemp001] = HeroDeathTimes[IntTemp001] + 1
//insert Timer Window of ya want here
wait (game-time) (Real(HeroDeathTimes[IntTemp001])x20.00)
instantly revive (Hero[IntTemp001])
02-04-2005, 04:29 AM#6
Guest
Ok, I'm trying to make an arena map where heroes from each team revive in their respective start locations (ala DoTA, ToB, other AoS). I found some JASS code that assigns local variables, because globals would mess up with multiple deaths, but im not sure what to change in the code. Like i mentioned, when a hero from a specific team dies (Note* only 2 teams) i want that hero to revive in the team start rect (TeamStart1 and TeamStart2) Just to let you know, I am not competent with JASS, but I'm sure I can figure out a way to get this to work with your help =D Thanks guys. Here is the sample code.

Revive Hero
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Custom script: local timerdialog WINDOW
Custom script: local integer HEROWAIT
Custom script: local timer OURTIMER
Custom script: local unit OURHERO
Custom script: set OURHERO = GetDyingUnit()
Custom script: set HEROWAIT = ( GetHeroLevel(OURHERO) * 5 )
Custom script: set OURTIMER = CreateTimer()
Custom script: call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
Custom script: call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
Custom script: set WINDOW = GetLastCreatedTimerDialogBJ()
Custom script: call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
Custom script: call PolledWait( HEROWAIT )
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)
02-04-2005, 10:06 AM#7
PitzerMike
This line specifies that the player has to wait 5 seconds for each hero level to revive:
Custom script: set HEROWAIT = ( GetHeroLevel(OURHERO) * 5 )

If the timer dialog is fine for you you'll just have to replace this line:
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true )



I'm assuming that team 1 is from player 1 to 6 (respectively 0 to 5 in JASS) and that TeamStart1 and TeamStart2 are global point variables declared by you.

Custom script: if GetPlayerId(GetOwningPlayer(OURHERO)) <= 5 then
Custom script: call ReviveHeroLoc(OURHERO, udg_TeamStart1, true )
Custom script: else
Custom script: call ReviveHeroLoc(OURHERO, udg_TeamStart2, true )
Custom script: endif
02-04-2005, 07:06 PM#8
Guest
Ok, Im having some problems implementing the code. Basically, I have an initialaztion trigger (set for event game time elapsed 1 second) that takes 2 rects (Team 1 Start and Team 2 Start) and sets 2 rect variables (TeamStart1 and TeamStart2). Then, I replaced the:
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true

I put in your code and I tried to save it and the world editor crashed when it got to the variables portions. Did I do something wrong when I set the rect variables? I assume this is the problem since I am brand new to triggering, and I need to set my variables in a different way, or chose a different type of variables to use. Thans again for your help.
02-04-2005, 11:25 PM#9
PitzerMike
As I said, I assumed that TeamStart1 and 2 are location variables. But if they are rects the code would look like thsi:

Custom script: if GetPlayerId(GetOwningPlayer(OURHERO)) <= 5 then
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(udg_TeamStart1), true )
Custom script: else
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(udg_TeamStart2), true )
Custom script: endif
02-05-2005, 04:34 AM#10
Guest
Sorry for the confusion on my part. I had trouble with setting the variables, but everything is fixed now. The only other tweak I'd like to ask about is the camera pan. Now, I'm unsure if i need to make a new > if > then > else for the 2 different camera pans. So here is the line question:

Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )

Thanks again for your help!
02-05-2005, 08:46 AM#11
Sicknesslife
No. You only need 1 camera pan and no if/else statements. (OURHERO) will already be revived at the correct place and since the pan targets OURHERO it will go to the right rivival zone. Adding another if/else statement to do this would be redundant and counter-productive
02-05-2005, 08:06 PM#12
Guest
Ok, so what do i have to change in the camera pan script to make it pan to the hero's spawn location? As it stands now, the camera pans to where the hero died.