Unit is created, refueses to slide

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Okay, this is a 4 part trigger system but so far all it does is create a unit.
Its meant to make it slide forward until it hits an enemy, but it doesn't.

Code:
function Trig_riki1_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A004'
endfunction

function Trig_riki1_Actions takes nothing returns nothing
    local location XYTY
    local real faceds
    set udg_rikicastingunit = GetSpellAbilityUnit()
    set XYTY = GetUnitLoc(udg_rikicastingunit)
    set faceds = GetUnitFacing(udg_rikicastingunit)
    call CreateUnitAtLoc(GetOwningPlayer(udg_rikicastingunit), 'hpea', XYTY, faceds )
    set udg_rikimissileunit = GetLastCreatedUnit()
    call TriggerExecute( gg_trg_riikitimer )
    call TriggerRegisterUnitInRangeSimple( gg_trg_riki2, 10.00, udg_rikicastingunit )
endfunction

//===========================================================================
function InitTrig_riki1 takes nothing returns nothing
    set gg_trg_riki1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_riki1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_riki1, Condition( function Trig_riki1_Conditions ) )
    call TriggerAddAction( gg_trg_riki1, function Trig_riki1_Actions )
endfunction

---------------------------------------------------------------------------------------

function Trig_riki2_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetEnteringUnit(), GetOwningPlayer(udg_rikimissileunit)) == true
endfunction

function Trig_riki2_Actions takes nothing returns nothing
    call UnitDamageTargetBJ( udg_rikicastingunit, GetEnteringUnit(), 100, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
    call ExplodeUnitBJ( udg_rikimissileunit )
    call PauseTimerBJ( true, udg_rikitimer )
endfunction

//===========================================================================
function InitTrig_riki2 takes nothing returns nothing
    set gg_trg_riki2 = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_riki2, Condition( function Trig_riki2_Conditions ) )
    call TriggerAddAction( gg_trg_riki2, function Trig_riki2_Actions )
endfunction

---------------------------------------------------------------------------------------

function Trig_riki3_Actions takes nothing returns nothing
    local location where = GetUnitLoc(udg_rikimissileunit)
    local real face = GetUnitFacing(udg_rikimissileunit)
    call SetUnitPositionLocFacingBJ( udg_rikimissileunit, where, face )
endfunction

//===========================================================================
function InitTrig_riki3 takes nothing returns nothing
    set gg_trg_riki3 = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_riki3, udg_rikitimer )
    call TriggerAddAction( gg_trg_riki3, function Trig_riki3_Actions )
endfunction

---------------------------------------------------------------------------------------

function Trig_riikitimer_Actions takes nothing returns nothing
    call StartTimerBJ( udg_rikitimer, true, 1.00 )
endfunction

//===========================================================================
function InitTrig_riikitimer takes nothing returns nothing
    set gg_trg_riikitimer = CreateTrigger(  )
    call TriggerAddAction( gg_trg_riikitimer, function Trig_riikitimer_Actions )
endfunction
 

Duwenbasden

Ver 6 CREATE energy AS SELECT * FROM u.energy
Reaction score
165
Code:
call CreateUnitAtLoc(GetOwningPlayer(udg_rikimissileunit), 'hpea', XYTY, faceds )

udg_rikimissileunit not assigned any values. ;)
 

Hero

─║╣ero─
Reaction score
250
Code:
call CreateUnitAtLoc(GetOwningPlayer(udg_rikimissileunit), 'hpea', XYTY, faceds )

udg_rikimissileunit not assigned any values. ;)

That is correct...also shouldn't all those other functions being called be above the function calling them?
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
There are 4 different triggers, not 4 different functions in one figure.
I did change that, still does the same thing.
 

Tom Jones

N/A
Reaction score
437
Code:
function Trig_riki3_Actions takes nothing returns nothing
    local location where = GetUnitLoc(udg_rikimissileunit)
    local real face = GetUnitFacing(udg_rikimissileunit)
    call SetUnitPositionLocFacingBJ( udg_rikimissileunit, where, face )
endfunction
You keep moving the unit to the same location.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Oh yea!
lol
Is there a way to tell a units angle and then move its position by increasing or decreasing its X and Y position?
Or just detecting weather it should add to X and subtract from Y or visa-versa. Or add or subtract from both.
 

Luth

Lex Luthor!
Reaction score
41
Polar Offset.:cool:
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
Did that, need to update the trigger.
Still spawns it.
Does anyone want to look at the map?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top