• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] need help with a script

Status
Not open for further replies.
Level 10
Joined
Feb 7, 2005
Messages
409
first of all I'd like to say that this is not my design, creation or whatever else you'd like to call it, however it seems to work perfectly in the map I'm designing except for one litte line "call MoveUnitToPolarProjection(GetEnumUnit(), 55.00+udg_Player_Missle[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]*15, GetUnitFacing(GetEnumUnit()) )"

I have no idea what I'm supposed to do to fix it, it says "expected name" whenever I try to test what I want to know is if there's anything in that line that doesn't make sense to someone who can write this stuff, and what I could possibly do to at least attempt to make it work properly, also if you have an idea you could PM me or e-mail me at [email protected] I'll also send the map if you need to take a look at it. anyways, here's the rest of the script:


function Trig_Move_Func001Func003001002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetEnumUnit())) == true )
endfunction

function Trig_Move_Func001Func003A takes nothing returns nothing
if ( GetUnitFlyHeight(GetEnumUnit()) <= ( GetUnitFlyHeight(udg_PickedUnit) + 100.00 ) ) then
if ( GetUnitFlyHeight(GetEnumUnit()) >= ( GetUnitFlyHeight(udg_PickedUnit) - 10.00 ) ) then
call UnitDamageTargetBJ( udg_PickedUnit, GetEnumUnit(), 500, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call ExplodeUnitBJ( udg_PickedUnit )
endif
endif
endfunction

function Trig_Move_Func001A takes nothing returns nothing
local location TempPoint
local rect TempRect
local group TempGroup
local conditionfunc TempCondition

call MoveUnitToPolarProjection(GetEnumUnit(), 55.00+udg_Player_Missle[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]*15, GetUnitFacing(GetEnumUnit()) )

set udg_PickedUnit = GetEnumUnit()

set TempPoint= GetUnitLoc(GetEnumUnit())
set TempRect = RectFromCenterSizeBJ(TempPoint, 175.00, 175.00)
set TempCondition = Condition(function Trig_Move_Func001Func003001002)
set TempGroup = GetUnitsInRectMatching(TempRect,TempCondition )

call ForGroupBJ( TempGroup, function Trig_Move_Func001Func003A )

call RemoveRect(TempRect)
call RemoveLocation(TempPoint)
call DestroyGroup(TempGroup)
call DestroyCondition(TempCondition)

set TempGroup=null
set TempPoint = null
set TempRect = null
set TempCondition = null
endfunction

function Trig_Move_Actions takes nothing returns nothing
call ForGroupBJ( udg_Missles, function Trig_Move_Func001A )
endfunction

//===========================================================================
function InitTrig_Move takes nothing returns nothing
set gg_trg_Move = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Move, 0.05 )
call TriggerAddAction( gg_trg_Move, function Trig_Move_Actions )
endfunction
 
Level 8
Joined
Oct 3, 2004
Messages
101
Dude, MoveUnitToPolarProjection is a function.

Add this to your custom script section, OR, add it to your trigger:

JASS:
function MoveUnitToPolarProjection takes unit tomove, real dist, real angle returns nothing 
    call SetUnitPosition(tomove, GetUnitX(tomove) + dist * Cos(angle * .017453) , GetUnitY(tomove) + dist * Sin(angle * .017453)) 
endfunction
 
Status
Not open for further replies.
Top