Exide
I am amazingly focused right now!
- Reaction score
- 448
Hi.
I made another thread about this, in the GUI-section, and there I decided to make a trigger that checks the points of all locust units of a certain type, and then compare it to the point where the "hero unit" is.
So I made it in JASS. Surprisingly, it actually saved the map and was able to start it (I was expecting a crash or two,) but not-so-surprisingly it doesn't work.
EDIT: Right, what the trigger is supposed to do:
Whenever one of these Locust-units comes within 70 range of the Hero-unit, the Hero-unit recieves 50hp damage, and the Locust-unit is removed from the game.
So here's my trigger: (It's Initially Off, but is Turned On, using another trigger.)
Any ideas?
(Oh, and as a "bonus", how would I get rid of that BJ in 'UnitDamageTargetBJ'? -according to JassCraft, UnitDamageTarget has a lot more "settings".)
Thank you.
/Exide.
I made another thread about this, in the GUI-section, and there I decided to make a trigger that checks the points of all locust units of a certain type, and then compare it to the point where the "hero unit" is.
So I made it in JASS. Surprisingly, it actually saved the map and was able to start it (I was expecting a crash or two,) but not-so-surprisingly it doesn't work.
EDIT: Right, what the trigger is supposed to do:
Whenever one of these Locust-units comes within 70 range of the Hero-unit, the Hero-unit recieves 50hp damage, and the Locust-unit is removed from the game.
So here's my trigger: (It's Initially Off, but is Turned On, using another trigger.)
JASS:
function Trig_Setting_Points_Actions takes nothing returns nothing
local location array checkloc
local location heroloc
local unit hero
local group locustgroup
local integer loopstart
local integer loopend
set hero = udg_Hero
set heroloc = GetUnitLoc(hero)
set locustgroup = GetUnitsOfTypeIdAll(039;h00W039;)
set loopend = CountUnitsInGroup(locustgroup)
set loopstart = 1
loop
exitwhen loopstart > loopend
set checkloc[loopstart] = GetUnitLoc(GetEnumUnit())
if ( DistanceBetweenPoints(heroloc, checkloc[loopstart]) < 71.00 ) then
call UnitDamageTargetBJ( GetEnumUnit(), hero, 50.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_LIGHTNING )
call AddSpecialEffectLoc( "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", heroloc)
set udg_SpecialFX = bj_lastCreatedEffect
call TriggerExecute( gg_trg_Special_Effect_Destruction )
call RemoveUnit( GetEnumUnit() )
else
endif
set loopstart = loopstart + 1
endloop
set loopstart = 1
loop
exitwhen loopstart > loopend
call RemoveLocation(checkloc[loopstart])
set checkloc[loopstart] = null
set loopstart = loopstart + 1
endloop
call DestroyGroup(locustgroup)
call RemoveLocation(heroloc)
set heroloc = null
set hero = null
endfunction
//===========================================================================
function InitTrig_Setting_Points takes nothing returns nothing
set gg_trg_Setting_Points = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Setting_Points, 0.50 )
call TriggerAddAction( gg_trg_Setting_Points, function Trig_Setting_Points_Actions )
endfunction
Any ideas?
(Oh, and as a "bonus", how would I get rid of that BJ in 'UnitDamageTargetBJ'? -according to JassCraft, UnitDamageTarget has a lot more "settings".)
Thank you.
/Exide.