Wait.. would this script work? (if you cba to read that, then all i need you to see is- set udg_BulletOffset = PolarProjectionBJ(GetNearestPathableLoc(GetUnitLoc (udg_Bullet)), 50.00, GetUnitFacing(udg_Bullet)) that works right?
function Trig_Bullet_Move_Func001Func001Func005002003001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Bullet)) == true )
endfunction
function Trig_Bullet_Move_Func001Func001Func005002003002 takes nothing returns boolean
return ( IsUnitDeadBJ(GetFilterUnit()) == false )
endfunction
function Trig_Bullet_Move_Func001Func001Func005002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Bullet_Move_Func001Func001Func005002003001(), Trig_Bullet_Move_Func001Func001Func005002003002() )
endfunction
function Trig_Bullet_Move_Func001Func001Func006A takes nothing returns nothing
// Sniper Rifle
set udg_WeaponDamage = 100.00
call UnitDamageTargetBJ( udg_Bullet, GetEnumUnit(), udg_WeaponDamage, ATTACK_TYPE_MELEE, DAMAGE_TYPE_UNIVERSAL )
call GroupRemoveUnitSimple( udg_Bullet, udg_Bullets )
call RemoveUnit( udg_Bullet )
endfunction
function Trig_Bullet_Move_Func001Func001Func008C takes nothing returns boolean
if ( not ( GetUnitUserData(udg_Bullet) >= 100 ) ) then
return false
endif
return true
endfunction
function Trig_Bullet_Move_Func001Func001A takes nothing returns nothing
set udg_Bullet = GetEnumUnit()
call SetUnitUserData( udg_Bullet, ( GetUnitUserData(udg_Bullet) + 1 ) )
set udg_BulletOffset = PolarProjectionBJ(GetNearestPathableLoc(GetUnitLoc(udg_Bullet)), 50.00, GetUnitFacing(udg_Bullet))
call SetUnitPositionLoc( udg_Bullet, udg_BulletOffset )
set udg_BulletHit = GetUnitsInRangeOfLocMatching(50.00, GetUnitLoc(udg_Bullet), Condition(function Trig_Bullet_Move_Func001Func001Func005002003))
call ForGroupBJ( udg_BulletHit, function Trig_Bullet_Move_Func001Func001Func006A )
// End of the Line
if ( Trig_Bullet_Move_Func001Func001Func008C() ) then
call GroupRemoveUnitSimple( udg_Bullet, udg_Bullets )
call RemoveUnit( udg_Bullet )
else
call DoNothing( )
endif
call RemoveLocation (udg_BulletOffset)
call DestroyGroup (udg_BulletHit)
endfunction
function Trig_Bullet_Move_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 3
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call ForGroupBJ( udg_Bullets, function Trig_Bullet_Move_Func001Func001A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Bullet_Move takes nothing returns nothing
set gg_trg_Bullet_Move = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Bullet_Move, 0.01 )
call TriggerAddAction( gg_trg_Bullet_Move, function Trig_Bullet_Move_Actions )
endfunction
And @Wrym Lord,how do i find out the TerrainCliffLevel that a particular unit is on?