Jass Random Point Facing Problem

hunterrravyn

TH.net Regular
Reaction score
19
Editing the jass from the knockback system into gui, but i still have 1 problem... the attacked units facing.

JASS:
function Trig_Attack_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hpea' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Attack_Actions takes nothing returns nothing
    call MoveRectToLoc( udg_Temp_Regon, GetUnitLoc(GetTriggerUnit()) )
    call SetUnitFacingToFaceLocTimed( GetTriggerUnit(), GetRandomLocInRect(udg_Temp_Regon), 0.10 )
    call UnitKnockTargetEx(GetTriggerUnit(), GetAttackedUnitBJ(), GetUnitFacing(GetTriggerUnit()), 50.00, 2.00, 1.00, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", "origin")
    call RemoveRect(udg_Temp_Regon)
endfunction

//===========================================================================
function InitTrig_Attack takes nothing returns nothing
    set gg_trg_Attack = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Attack, Condition( function Trig_Attack_Conditions ) )
    call TriggerAddAction( gg_trg_Attack, function Trig_Attack_Actions )
endfunction


Ive converted it to jass to try to help.:D
 

hunterrravyn

TH.net Regular
Reaction score
19
The knockback system tells the unit to face the triggering unit, the triggering unit is the unit in this trigger to be pushed.

It ends up not changing direction and getting pushed in that direction... this means im going to try and use a random point in region.... put this is to many arguments for the knockback part....

Well thats what i atleast think....

Sry about slow response time...
 
Reaction score
341
I'm guessing call UnitKnockTargetEx pauses the unit , not allowing him to turn. Maybe do something like..

JASS:
function Trig_Attack_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hpea' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Attack_Actions takes nothing returns nothing
    call MoveRectToLoc( udg_Temp_Regon, GetUnitLoc(GetTriggerUnit()) )
    call SetUnitFacingToFaceLocTimed( GetTriggerUnit(), GetRandomLocInRect(udg_Temp_Regon), 0.00 )
    call TriggerSleepAction(.30)
    call UnitKnockTargetEx(GetTriggerUnit(), GetAttackedUnitBJ(), GetUnitFacing(GetTriggerUnit()), 50.00, 2.00, 1.00, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl", "origin")
    call RemoveRect(udg_Temp_Regon)
endfunction

//===========================================================================
function InitTrig_Attack takes nothing returns nothing
    set gg_trg_Attack = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Attack, Condition( function Trig_Attack_Conditions ) )
    call TriggerAddAction( gg_trg_Attack, function Trig_Attack_Actions )
endfunction
 
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