| 10-31-2006, 08:09 PM | #2 |
uhm, i think this is the problem JASS:
exitwhen IsUnitDeadBJ(ball)
JASS:
exitwhen IsUnitDeadBJ(ball) == true
|
| 10-31-2006, 08:56 PM | #3 |
No, you don't. Boolean has to be true, no need to compare with true. GetWidgetLife(ball) < 0.405 would be better. |
| 11-01-2006, 03:28 PM | #4 |
Cool, I'll see if it works... None of you said I needed anything in my custom script part (the things that load before any triggers) is that correct? I think I had something there .... JASS:call PolarProjectionNL(target, distance, angle) Getting an error like that... says: Expected a function name... Sorry, but I'm totally stupid at JASS... :P |
| 11-01-2006, 03:42 PM | #5 |
I'm not quite sure... is this what you trying to do ? - order the guardian to move towards the master when he is at range 1000 or more - if it is in the range, ask the guadian to attack random loc around it --- if thats the case, the try this, but i'm not sure will work or not JASS:function Trig_Guardian_Conditions takes nothing returns boolean return GetUnitTypeId(GetSummonedUnit()) == 'n00F' endfunction function Trig_Guardian_Actions takes nothing returns nothing local unit ball = GetSummonedUnit() local unit master = GetSummoningUnit() local location lball local location lmas local location target loop exitwhen GetWidgetLife(ball)<0.405 set lball = GetUnitLoc(ball) set lmas = GetUnitLoc(master) if DistanceBetweenPoints(lball,lmas) > 1000 then call IssuePointOrderLoc(ball,"move",lmas) else set target=PolarProjectionBJ(lball,GetRandomReal(100,500), GetRandomReal(0,360)) call IssuePointOrderLocBJ(ball, "attack", target) endif call TriggerSleepAction(0.5) endloop set ball=null set master=null set lball=null set lmas=null endfunction //=========================================================================== function InitTrig_Guardian takes nothing returns nothing local trigger t = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SUMMON ) call TriggerAddCondition(t, Condition( function Trig_Guardian_Conditions ) ) call TriggerAddAction( t, function Trig_Guardian_Actions ) set t=null endfunction |
| 11-04-2006, 03:17 AM | #6 |
Thanks Zen87 :) It works now, I suppose that I can change the range for the balls distance from the hero to whatever I want right ? Gonna try it out ;) +rep for the help! |
| 11-04-2006, 03:21 AM | #7 |
yes, just change the value here JASS:if DistanceBetweenPoints(lball,lmas) > 1000 then //change the 1000, for your case, i do suggest a number around... 300-500 |
| 11-04-2006, 03:29 AM | #8 |
Setting it at 300, just tried 650 and it seems like they get to go maybe 50-100 extra before returning as the trigger takes a bit to react, so 300 is fine :) Thanks for helping me out here since I fucked it up... gonna credit you for it and the original owner, although I've unfortunatly forgotten who wrote it for me back then :( I'll look around to see if I can't locate it :) Wanna take a look at another trigger for me? Alot bigger though... hehe.. but it's only 1 thing I need to make happen... |
| 11-04-2006, 03:53 AM | #9 |
well, i'll see what can i help, im still a jass learner after all, need more practice :P but remember to tell what's the trigger atctually doing x_x |
| 11-04-2006, 11:51 AM | #10 |
Zachary! When did you return? |
| 11-04-2006, 11:56 PM | #11 | |
Quote:
Hey mate! Like 1 or 2 weeks ago :) Took up THE project again :D hehe... Things are already looking up ;) Hope I don't get hurt for replying to this... hehe... I'll send you my MSN mate! |
