Gui --> jass

MasterRofl

New Member
Reaction score
8
Map on second page

Why does this work
Trigger:
  • Revive Hero
    • Events
      • Time - Map_Revive_Timers[1] expires
      • Time - Map_Revive_Timers[2] expires
      • Time - Map_Revive_Timers[3] expires
      • Time - Map_Revive_Timers[4] expires
      • Time - Map_Revive_Timers[6] expires
      • Time - Map_Revive_Timers[7] expires
      • Time - Map_Revive_Timers[8] expires
      • Time - Map_Revive_Timers[9] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Map_Revivable_Heroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for Map_Revive_Timers[((Player number of (Owner of (Picked unit))) - 1)]) Less than 1.00
            • Then - Actions
              • Hero - Instantly revive (Picked unit) at (Center of Hero Spawn <gen>), Show revival graphics
              • Countdown Timer - Destroy Map_Revive_Timer_Windows[((Player number of (Owner of (Picked unit))) - 1)]
              • Unit Group - Remove (Picked unit) from Map_Revivable_Heroes
            • Else - Actions

and this not work?
JASS:
scope ReviveHero initializer Init

private function Callback takes nothing returns nothing
    local location HeroSpawnCenter = GetRectCenter(gg_rct_Hero_Spawn)
    if ( TimerGetRemaining(udg_Map_Revive_Timers[GetPlayerId(GetOwningPlayer(GetEnumUnit()))]) < 1.00 ) then
        call ReviveHeroLoc( GetEnumUnit(), HeroSpawnCenter, true )
        call DestroyTimerDialog( udg_Map_Revive_Timer_Windows[GetPlayerId(GetOwningPlayer(GetEnumUnit()))] )
        call GroupRemoveUnit( udg_Map_Revivable_Heroes, GetEnumUnit() )
    endif
    call RemoveLocation(HeroSpawnCenter)
    set HeroSpawnCenter = null
endfunction

private function Actions takes nothing returns nothing
    call ForGroup( udg_Map_Revivable_Heroes, function Callback )
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[1] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[2] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[3] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[4] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[6] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[7] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[8] )
    call TriggerRegisterTimerExpireEvent( t, udg_Map_Revive_Timers[9] )
    call TriggerAddAction( t, function Actions )
endfunction

endscope
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I mean the function CallBack is called correctly and all ?
What is working in the jass trigger ?
Put some BJDebugMsg.
 

MasterRofl

New Member
Reaction score
8
When I use a trigger to kill my hero, it's added to the group "udg_Map_Revivable_Heroes" and udg_Map_Revive_Timers is started (i = player number of owner of hero). Right now (and I have no idea why), the vJass trigger's Actions aren't even being triggered.

Edit: Included timer-creating trigger
JASS:
scope ReviveHeroTimer initializer Init

private function Conditions takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true )
endfunction

private function Actions takes nothing returns nothing
    call GroupAddUnit( udg_Map_Revivable_Heroes, GetDyingUnit() )
    set udg_Map_Temp_Real = I2R(GetHeroLevel(GetDyingUnit())) * 3.00
    call TimerStart( udg_Map_Revive_Timers[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], udg_Map_Temp_Real, false, null )
    call CreateTimerDialogBJ( udg_Map_Revive_Timers[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], "Time until respawn:" )
    call TimerDialogDisplayForPlayerBJ( true, udg_Map_Revive_Timer_Windows[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], GetOwningPlayer(GetDyingUnit()) )
    set udg_Map_Revive_Timer_Windows[GetPlayerId(GetOwningPlayer(GetDyingUnit()))] = bj_lastCreatedTimerDialog
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction

endscope


Also, how do you go about using BJDebugMsg? Is it like Game Text, but shows only when debug mode is turned on in your editor?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
No it's not a native function, it's just fast to write and display the string for all players, say if the string is null, the strings are displayed during a very long time, perfect for debugging purpose.
It's a blizzard function, you can look how it is make, but you don't need it.
 

MasterRofl

New Member
Reaction score
8
Link to Utilities lib please?

On-topic: What's making the trigger not fire? When I use the GUI trig, it works perfectly fine, and I don't really see a diff between them...
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Well i dunno the period of his timers but maybe you're right if the period is short.

EDIT : But heh for testing he should increase the period anyway.

The trigger doesn't fire at all ?
 

MasterRofl

New Member
Reaction score
8
Hero Revive category; triggers in question are "Revive Hero" and "Working Revive Hero" (press Esc to kill heroes)
 

Attachments

  • 123.w3x
    58.1 KB · Views: 121

Troll-Brain

You can change this now in User CP.
Reaction score
85
And when the timers are supposed to start ? You don't really let us to help you ...
But anyways my bed call me, gl.
 

MasterRofl

New Member
Reaction score
8
And when the timers are supposed to start ? You don't really let us to help you ...
But anyways my bed call me, gl.
When I use a trigger to kill my hero, it's added to the group "udg_Map_Revivable_Heroes" and udg_Map_Revive_Timers is started (i = player number of owner of hero). Right now (and I have no idea why), the vJass trigger's Actions aren't even being triggered.

Edit: Included timer-creating trigger
JASS:
scope ReviveHeroTimer initializer Init

private function Conditions takes nothing returns boolean
    return ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true )
endfunction

private function Actions takes nothing returns nothing
    call GroupAddUnit( udg_Map_Revivable_Heroes, GetDyingUnit() )
    set udg_Map_Temp_Real = I2R(GetHeroLevel(GetDyingUnit())) * 3.00
    call TimerStart( udg_Map_Revive_Timers[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], udg_Map_Temp_Real, false, null )
    call CreateTimerDialogBJ( udg_Map_Revive_Timers[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], "Time until respawn:" )
    call TimerDialogDisplayForPlayerBJ( true, udg_Map_Revive_Timer_Windows[GetPlayerId(GetOwningPlayer(GetDyingUnit()))], GetOwningPlayer(GetDyingUnit()) )
    set udg_Map_Revive_Timer_Windows[GetPlayerId(GetOwningPlayer(GetDyingUnit()))] = bj_lastCreatedTimerDialog
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction

endscope


Also, how do you go about using BJDebugMsg? Is it like Game Text, but shows only when debug mode is turned on in your editor?

There
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top