Warcraft III resources & community, 2003–2006 · archived

Missile Seeker

not rated
Submitted by LeopardJASS Enhanced467 downloads35 KB
Screenshot
Screenshot
Missile Seeker (JESP)

Launch 3 missiles which homing to the target. Eventhough missiles are homing, they can miss the target depends on

-how fast the target move,

-movement`s direction of the target,

-and from what angle the missiles launched.
File Name
Spell - Missile Seeker.w3x
Author
Leopard
Download

Comments

9
VERY VERY VERY HARD TO COPY AND PASTE TO YR MAP SUPER HARD! i dont understand it, it still gives 187 errors on that trigger when i save my map gosh such a problem. cold u explain better i still dotn get it pls reexplain how to copy and paste. tell here pls
man thats good...
Updated! change some lines of code, add copy guide. Hope you like it. Comments and suggestions are appreciated. :)

Update#2: Change few lines of code, get rid some leaks, consider flying unit, follows JESP standard.

native TriggerRemoveAction takes trigger t, triggeraction ac returns nothing

native riggerRemoveCondition takes trigger t, triggercondition con returns nothing


These are the func. to remove Actions and Conditions from a trigger
Well, thanks again. I know about native function my friend :wink:, that's an usual word for programmer. I just don't know that BJ function call native function. Yeah, that's dumb, function call another function, why don't i call that function directly, my bad. Well, thanks in advance. :)
DestroyCondition(conditionfunc)

i dont rememer right now which func destroys action (but i think somewhere vex told that it leaks)

and i will explain you why IssueTargetOrderBJ is worse than IssueTargetOrder.



function IssueTargetOrderBJ takes unit whichUnit, string order, widget targetWidget returns boolean
    return IssueTargetOrder( whichUnit, order, targetWidget )
endfunction


OrderBJ calls Order,the native,but why should we call a function which calls a native,when we can call the native directly?

just speed,is faster.

and in case you dont now,native is a function like thing which does IMPOSSIBLE for us stuff.

i mean
AddSpecialEffect(...) is a native.
how can we add effects,using functions? can't.

UnitAddAbility(...) another native.we cant do these stuff.
Ok, thanks Nantuko. Anyway, how to destroy trigger's conditions and it's actions?

And why IssueTargetOrderBJ is dumb and IssueTargetOrder not? what's the difference?
well leopard,another spell in jass by you,seems you abandoned gui,well done.

So reading your code i saw signs that you are not too much familiarized with it.

and let me give you some advices/feedback.



        call CreateNUnitsAtLoc( 1, dummy(), GetOwningPlayer(caster), casterloc, GetUnitFacing(caster) + GetRandomReal((-1*DevAngle()), DevAngle()) )
        set dummyu = GetLastCreatedUnit()



first CreateNUnitsAtLoc is used only in GUI.

jass Uses
CreateUnitAtLoc(player,unitId,x,y,face)



which is much better.

seting a unit var to the last created unit is wrong because

1)what it does is call a function which returns a bj var

here is that func


function GetLastCreatedUnit takes nothing returns unit
return bj_lastCreatedUnit
endfunction


so setting
set dummyu =bj_lastCreatedUnit would be better.

but even better would be

set dummyu = CreateUnit,that's the best way.



IssueTargetOrderBJ is dumb and use
IssueTargetOrder instead.


when destroying a trigger destroy it's actions and conditions too,else they leak.

when declaring locals better put their values at declaration.



 local unit caster 
...
    set caster = GetTriggerUnit() 

//better this
local unit caster = GetTriggerUnit()



and another thing,why do you use soooo much parenthesis...

( (y > x) and ((y - x) > 180.00) )


x>y and y-x > 180

does the same,maybe you place those parenthesis,for priority on a calculation but here is not needed.
Here's the explanation:

Launch 3 missiles which homing to the target. Each missile deal damage in area, slow movement and attack rate.
Eventhough missiles are homing, they can miss the target not based on random number but depends on:

-how fast the target move,
-movement's direction of the target,
-and from what angle the missiles launched.

You can change some spell settings to gain more accuracy on your missiles

-MaxTurnAngle --> large number indicate more accuracy
-DevAngle --> large number indicate less accuracy

Give me credit if you use it on your map. Enjoy.