Komaqtion
You can change this now in User CP.
- Reaction score
- 469
Hello
I was just making a very small revive "system" for a friend, and I've noticed that the function [ljass]ReviveHero[/ljass] doesn't seem to work (?!)
I use this small function (At the moment, it is supposed to be a lot bigger, but when not even this works I wonder...) to revive the hero:
And the first three messages shows, and the proper name it correct, but the hero isn't revived and the last message isn't shown ?!
Anyone have experienced this very weird bug ? :S
EDIT: I now use this to revive the hero, but it doesn't work either...
And I've disabled vJass syntax, just to be on the safe side
I was just making a very small revive "system" for a friend, and I've noticed that the function [ljass]ReviveHero[/ljass] doesn't seem to work (?!)
I use this small function (At the moment, it is supposed to be a lot bigger, but when not even this works I wonder...) to revive the hero:
JASS:
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer( u )
//call ReviveData.create( u, p )
call BJDebugMsg( "Works !" )
call TriggerSleepAction( 5. )
call BJDebugMsg( "Works now too !" )
call BJDebugMsg( GetHeroProperName( u ) )
call ReviveHero( u, GetStartLocationX( GetPlayerStartLocation( p ) ), GetStartLocationY( GetPlayerStartLocation( p ) ), false )
call ReviveHero( u, 0., 0., false )
if ReviveHero( u, GetStartLocationX( GetPlayerStartLocation( p ) ), GetStartLocationY( GetPlayerStartLocation( p ) ), false ) then
call BJDebugMsg( "It should work ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />" )
endif
set u = null
set p = null
endfunction
And the first three messages shows, and the proper name it correct, but the hero isn't revived and the last message isn't shown ?!
Anyone have experienced this very weird bug ? :S
EDIT: I now use this to revive the hero, but it doesn't work either...
JASS:
function CountTownhalls takes nothing returns boolean
if IsUnitType( GetFilterUnit(), UNIT_TYPE_TOWNHALL ) and GetWidgetLife( GetFilterUnit() ) >= .405 then
set udg_townHall = true
endif
return false
endfunction
function CheckTownhalls takes unit u returns boolean
local player p = GetOwningPlayer( u )
//call BJDebugMsg( "Works !" )
call GroupEnumUnitsOfPlayer( udg_TempGroup, p, Filter( function CountTownhalls ) )
return udg_townHall
endfunction
function Conditions takes nothing returns boolean
//call BJDebugMsg( "Works !" )
return CheckTownhalls( GetTriggerUnit() ) and IsUnitType( GetTriggerUnit(), UNIT_TYPE_HERO ) == true
endfunction
function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer( u )
//call ReviveData.create( u, p )
call BJDebugMsg( "Works !" )
call TriggerSleepAction( 5. )
call BJDebugMsg( "Works now too !" )
call BJDebugMsg( GetHeroProperName( u ) )
call ReviveHero( u, GetStartLocationX( GetPlayerStartLocation( p ) ), GetStartLocationY( GetPlayerStartLocation( p ) ), false )
call ReviveHero( u, 0., 0., false )
if ReviveHero( u, GetStartLocationX( GetPlayerStartLocation( p ) ), GetStartLocationY( GetPlayerStartLocation( p ) ), false ) then
call BJDebugMsg( "It should work ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />" )
endif
set u = null
set p = null
endfunction
function InitTrig_Untitled_Trigger_003 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
And I've disabled vJass syntax, just to be on the safe side