• 🏆 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!

[JASS] Problem spoted ! revive sistem ...

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
  • 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) * 2 )
      • 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)

Hi ! the trigger up there is the trigger that i use to revive the dead heroes on my map but if i manually revive my hero from a tavern the clock still goes on ... can someone tell me how to fix it ... i do not know jass very well so pls explain it to me or tell me what to do ... ty ...
Ty for your time !
~MA
 
  • 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) * 2 )
      • 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)

Hi ! the trigger up there is the trigger that i use to revive the dead heroes on my map but if i manually revive my hero from a tavern the clock still goes on ... can someone tell me how to fix it ... i do not know jass very well so pls explain it to me or tell me what to do ... ty ...
Ty for your time !
~MA

I guess you can create a trigger that will destroy the timer once the hero is revived.... though I'm not sure how you can set the hero since you use locals here..... btw the trigger leaks a location...
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Make a trigger to detect the hero is revived or not. If he/she is revived pause the timer, otherwise, do nothing and the timer will revive it.

That events should detect when the building that revives the hero has finished reviving any hero:

  • Revive
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • (Triggering unit) Equal to HeroTavern
    • Actions
      • Countdown Timer - Pause ReviveTimeLeftTimer
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
  • 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) * 2 )
      • 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)

Hi ! the trigger up there is the trigger that i use to revive the dead heroes on my map but if i manually revive my hero from a tavern the clock still goes on ... can someone tell me how to fix it ... i do not know jass very well so pls explain it to me or tell me what to do ... ty ...
Ty for your time !
~MA

I'm 99% sure that is trigger is taken from a tutorial or a demo map,cause i have seen this a lot of times...You probably imported this one into your map and having problem with making it work.Are you sure your variables are as they were supposed to be?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
JASS:
local unit OURHERO = GetDyingUnit()
local integer HEROWAIT = (( GetHeroLevel(OURHERO)+5) * 2 )
local timer OURTIMER = CreateTimer()
local timerdialog WINDOW
call StartTimer( OURTIMER, false, I2R(HEROWAIT) )
set WINDOW = CreateTimerDialog( OURTIMER)
call TimerDialogSetTitle(WINDOW, GetPlayerName(GetOwningPlayer(OURHERO)) )
call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) ) // not inlining this one, you can though, if you want
call PolledWait( HEROWAIT )
call ReviveHero(OURHERO, GetRectCenterX(bj_mapInitialPlayableArea),GetRectCenterY(bj_mapInitialPlayableArea), true )
call PanCameraToTimedForPlayer( GetOwningPlayer(OURHERO), GetUnitX(OURHERO),GetUnitY(OURHERO), 0.60 )
call DestroyTimerDialog(WINDOW)
here you go, i didnt inline 2 functions because they use Local Player,,
Why use such a system in GUI? It is all Jass, so use Jass for it!

That and there's no point using a resource if you don't know how to use it efficiently.
This isnt efficient anyway, so using it efficient is impossible.
 
Level 9
Joined
Jan 23, 2008
Messages
384
@reason 3: true that is not made by me as i said i just use it in my map ... and it works well but the timer does not stop if the hero gets revived from a tavern instead of waiting for it to revive

@ Yixx: ty i'll try that out :p

@En_Fuego & Deuterium: i am thinking of making one but for now i want to test pot Yixx's trigger ... Ty all !
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
If you want, i can make you a more efficient and accurate revive system in (v)Jass,, just tell me if you need it, and state if you want vJass or normal Jass (Normal JASS might be less efficient because i cannot use TimerUtils then.)
 
Status
Not open for further replies.
Top