Carl-Fredrik
New Member
- Reaction score
- 51
Hi everyone...
In my map there are a couple of explosive barrels, so I added damage through these in a trigger. I also want it to display "Boom!" at the exploding point, but nothing is displayed at all
Anybody knows why? :/
Thanks in advance!
// Carl-Fredrik
Edit: Also any optimization of the code is always appreciated.
Edit2: I found that the variable "d" is the problem.. how come it works in one of the functions but not the other? :S
In my map there are a couple of explosive barrels, so I added damage through these in a trigger. I also want it to display "Boom!" at the exploding point, but nothing is displayed at all
JASS:
scope ExplosiveBarrel initializer EBInit
globals
private group DAMAGEGROUP = CreateGroup()
private destructable d
endglobals
private function Actions2 takes nothing returns boolean
local texttag t
call CreateTextTagLocBJ("Boom!", GetDestructableLoc(d), 0, 20, 100, 50, 50, 0)
set t = bj_lastCreatedTextTag
call SetUnitLifePercentBJ(GetFilterUnit(),5.00)
call DisplayTimedTextToForce( GetForceOfPlayer(GetOwningPlayer(GetFilterUnit())), 10.00, "It039;s an EXPLOSIVE barrel! What did you expect!?")
call SetTextTagPermanent( t, false )
call SetTextTagFadepoint( t, 3.00 )
call SetTextTagAge(t, 3.00)
call SetTextTagLifespan( t, 3.00 )
set t = null
return false
endfunction
function Destructables takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
private function Actions takes nothing returns nothing
set d = GetDyingDestructable()
call EnumDestructablesInCircleBJ( 300.00, GetDestructableLoc(d), function Destructables )
call GroupEnumUnitsInRange(DAMAGEGROUP, GetDestructableX(d), GetDestructableY(d), 300.00, Filter(function Actions2))
call GroupClear(DAMAGEGROUP)
endfunction
private function EBInit takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterDeathEvent( t, gg_dest_LTex_0985 )
call TriggerRegisterDeathEvent( t, gg_dest_LTex_0984 )
call TriggerRegisterDeathEvent( t, gg_dest_LTex_0983 )
call TriggerRegisterDeathEvent( t, gg_dest_LTex_0986 )
call TriggerAddAction( t, function Actions )
endfunction
endscope
Anybody knows why? :/
Thanks in advance!
// Carl-Fredrik
Edit: Also any optimization of the code is always appreciated.
Edit2: I found that the variable "d" is the problem.. how come it works in one of the functions but not the other? :S