| 04-08-2006, 05:43 AM | #1 |
Basically: I have something like this: JASS:local unit dummyunit = CreateNUnitsAtLoc(1, unit-type, CastingPlayer, PolarProjectionBJ(GetUnitLoc(GetEventTargetUnit()), 100.0, 60.0)) IssueTargetOrderById(dummyunit, 'amov', TargetUnit) Create a local unit variable; set it equal to a newly created unit that is 100 distance away from the target of my spell. Order unit to move to my spell's target. My problem? How do I detect when the unit reaches the target? I was thinking I could use CreateTrigger with the event "A unit enters within range of this other unit" and then use this new trigger's actions function to do w/e else I want, but... obviously, I'm losing all data from my local variables in my original trigger. Any other suggestions on how to do this? Or, alternatively... is there anyway to pass local variables from 1 trigger to another trigger's action function? I know that it's possible for me to do this with the Caster System by creating Collision-detectable projectiles, but I'd rather not incorporate CS into this spell if possible, as I don't need it for anything else :/ Please don't post solutions with Global Variables... that's what I'm trying to avoid (to keep it MUI with the JESP standard; unless you think of a way with globals that -is- MUI, anyways). EDIT: One possible, psuedo-solution I thought of was to use a timer that calculates the time it takes the unit to traverse the distance (distance / movespeed) but that doesn't take into account if the target unit is moving and still requires me to add Custom Script code to the map for Handle...handling. |
| 04-08-2006, 08:32 AM | #2 |
The creating trigger option will work, but no matter what you do (unless you use some arbitrary thing like looping check with TriggerSleepAction) you would have to use the game cache to store information to pass it to the trigger. I suggest you start learning how to use it early, many things can't be done MUI without it. |
| 04-08-2006, 03:25 PM | #3 | |
Quote:
1.) I should just use the Caster System and 2.) Learn to use Gamecache ._. |
