HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

finish repair unit event ?

05-11-2008, 02:42 PM#1
laikh
hi can anyone plz tell me how to make the game register a "finish repair" unit event?
or some alternatives to it?

i cant find that in here
TriggerRegisterUnitEvent
TriggerRegisterPlayerUnitEvent

ty
05-11-2008, 05:58 PM#2
Pyrogasm
There is no "repair" event because repairing is really just restoring a unit's health. You could check to see when a unit's health reaches 100%, but that could also fire off of other things.

What do you need this for?
05-11-2008, 06:21 PM#3
laikh
problem is that id like to create units and keep track of their health, once it goes below/above a certain value id like to fire some triggers off


... but for some reason i cant get

call TriggerRegisterUnitLifeEvent(
to accept global variables

so i cant get

Collapse JASS:
function Trig_Trig_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), "dsa" )
endfunction

//===========================================================================
function InitTrig_Trig takes nothing returns nothing
    set gg_Trig = CreateTrigger(  )
    call TriggerRegisterUnitLifeEvent( gg_trg_Trig, udg_uun, LESS_THAN, 450.00 )
    call TriggerAddAction( gg_trg_Unbezeichneter_Ausl__ser_004, function Trig_Unbezeichneter_Ausl__ser_004_Actions )
endfunction

to run where udg_uun is some unit type variable that is set during the game


thnx4reply
05-11-2008, 08:40 PM#4
Vexorian
you can use a global variable with that.
05-11-2008, 09:23 PM#5
laikh
Collapse JASS:
function Trig_A_Actions takes nothing returns nothing
    set udg_eh = gg_unit_hhou_0000
endfunction

//===========================================================================
function InitTrig_A takes nothing returns nothing
    set gg_trg_A = CreateTrigger(  )
    call TriggerAddAction( gg_trg_A, function Trig_A_Actions )
endfunction

Collapse JASS:
function Trig_Unbezeichneter_Ausl__ser_001_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_001" )
endfunction

//===========================================================================
function InitTrig_B takes nothing returns nothing
    set gg_trg_B = CreateTrigger(  )
    call TriggerRegisterUnitLifeEvent( gg_trg_B, udg_eh , LESS_THAN, 450.00 )
    call TriggerAddAction( gg_trg_B, function Trig_Unbezeichneter_Ausl__ser_001_Actions )
endfunction



does not work for me, i dont get an error mess when i start the map with that but ingame nothing happens

any ideas? ... im using roc we btw
greatful fpor any replies ideas
05-11-2008, 10:15 PM#6
Vexorian
Are you sure InitTrig_A is executed before InitTrig_B?
05-11-2008, 10:26 PM#7
laikh
trig A is executed on map initialisation

+ when i use gui, and use
EVENT: Unit Life

i cannot choose a variable for Unit but only pick a unit (that is on the map already)