• 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.

Hero Revival problem

Status
Not open for further replies.
Level 1
Joined
Aug 18, 2008
Messages
2
http://world-editor-tutorials.thehelper.net/heros/revivecode.jpg

I followed this "tutorial" but I can't change the respawn location. I got variable and region called "Respawn" and I have tried things like:

  • call ReviveHeroLoc(OURHERO, GetRectCenter(GetRectRespawn()), true )
  • call ReviveHeroLoc(OURHERO, GetRectCenter(GetRespawnRect()), true )
  • call ReviveHeroLoc(OURHERO, GetRectCenter(Respawn()), true )
I don't know much about custom scripts and I really need to get this working.
 
Level 6
Joined
Jul 22, 2008
Messages
243
First of all, why are you using custom scripts? If you are unsure about them don't use em. There is a GUI way to do that just as easy. But anyways, "OURHERO" is that a local variable? Can't help that much without the whole code.
 
Level 6
Joined
Jul 13, 2007
Messages
173
revive
  • Events
    • Unit - A unit owned by you player Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
    • Actions
      • Wait 4.00 seconds
      • If ((Triggering unit) Equal to (Matching unit)) then do (Unit - Move (Triggering unit) instantly to (Center of team 1 <gen>)) else do (Unit - Move (Triggering unit) instantly to (Center of team 1 <gen>))
      • Wait 2.00 seconds
      • If (((Last created destructible) is alive) Equal to False) then do (Camera - Pan camera for (Owner of (Triggering unit)) to (Center of team 1 <gen>) over 1.00 seconds) else do (Do nothing)
      • Wait 2.00 seconds
      • Hero - Instantly revive (Dying unit) at (Position of (Triggering unit)), Show revival graphics
      • Unit - Set mana of (Triggering unit) to 100.00%
      • If (((Owner of (Triggering unit)) controller) Equal to Computer) then do (Unit - Order (Triggering unit) to Move To (Center of team 1 <gen>)) else do (Do nothing)
 
Level 5
Joined
Nov 14, 2007
Messages
161
to answer your question:

  • Custom script: call ReviveHeroLoc(OURHERO, udg_LOCATION, true )
"LOCATION" is a point variable. the "udg_" part means that it is a global which all variables are when using only GUI. just set that point in your initializations and you should be all set such as:
  • Set LOCATION = (Center of REGION <gen>)

i used this on my map and it got me starting to learn JASS.... cus it just works for MUI ^_^


@QueloR: this is the rest of the trigger after some slight modifications:
JASS:
function Trig_Revive_Hero_Copy_Actions takes nothing returns nothing
    local timerdialog WINDOW
    local integer HEROWAIT
    local timer OURTIMER
    local unit OURHERO
    set OURHERO = GetDyingUnit()
    set HEROWAIT = ( GetHeroLevel(OURHERO) * 5 + 15 )
    set OURTIMER = CreateTimer()
    call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
    call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
    call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 3, ( GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1 ), R2S(TimerGetRemaining(OURTIMER)) )
    set WINDOW = GetLastCreatedTimerDialogBJ()
    call TimerDialogDisplayBJ( true, WINDOW )
    call PolledWait( HEROWAIT )
    call ReviveHeroLoc(OURHERO, udg_SpawnAttackPoint, true )
    call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
    call DestroyTimerDialog(WINDOW)
endfunction

@roguo's trigger, it will work fine but if 2 hero's die both holding a ankh within 8 seconds of each other, the first one wont revive >.> and i dont think your "Matching unit" does anything in that first line.

anyway. that's your answer lol
YO_MA_MA
 
Status
Not open for further replies.
Top