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: 123

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
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top