SetUnitMaxLife isnt working?

SlayerII

New Member
Reaction score
0
JASS:
function Trig_test_Func001A takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(6), udg_startpoint[GetConvertedPlayerId(GetEnumPlayer())], bj_UNIT_FACING )
    call SetUnitMaxLife(GetLastCreatedUnit(),udg_maxlife[GetOwningPlayer(GetLasCreatedUnit())]
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetRectCenter(udg_rect[GetConvertedPlayerId(GetEnumPlayer())]) )
endfunction

function Trig_test_Actions takes nothing returns nothing
    call ForForce( udg_activaded_players, function Trig_test_Func001A )
endfunction

//===========================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_test, 1.00 )
    call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction

Since i used the SetUnitMaxLife the hole thing isnt working anymore... Someone know wy?
 

Faust

You can change this now in User CP.
Reaction score
123
I don't think you can increase max hp above the original hp (set in object editor)

You should use War Animal Training upgrade.
 
Reaction score
341
I don't think you can increase max hp above the original hp (set in object editor)

You should use War Animal Training upgrade.

You can with this.

Make sure you have all of the abilities copied, as well as the function.

Try this, (btw, it leaks)

JASS:
function Trig_test_Func001A takes nothing returns nothing
    set bj_lastCreatedUnit = CreateUnitAtLoc(Player(6), 'hfoo', udg_startpoint[GetConvertedPlayerId(GetEnumPlayer())], bj_UNIT_FACING)
    call SetUnitMaxLife(bj_lastCreatedUnit,udg_maxlife[GetOwningPlayer(bj_lastCreatedUnit)]
    call IssuePointOrderLoc(bj_lastCreatedUnit, "move", GetRectCenter(udg_rect[GetConvertedPlayerId(GetEnumPlayer())]))
endfunction

function Trig_test_Actions takes nothing returns nothing
    call ForForce(udg_activaded_players, function Trig_test_Func001A)
endfunction

//===========================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_test, 1.00 )
    call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction
 

SlayerII

New Member
Reaction score
0
hmmm solved it this way:
JASS:
function Trig_test_Func001A takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'H005', Player(6), udg_startpoint[GetConvertedPlayerId(GetEnumPlayer())], 270 )
    call SetHeroStr(GetLastCreatedUnit(),R2I(udg_maxl[GetConvertedPlayerId(GetEnumPlayer())]), true )
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetRectCenter(udg_rect[GetConvertedPlayerId(GetEnumPlayer())]) )
endfunction

function Trig_test_Actions takes nothing returns nothing
    call ForForce( udg_activaded_players, function Trig_test_Func001A )
endfunction

//===========================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_test, 1.00 )
    call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction

:)
But ty for help
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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