| 05-07-2003, 12:36 AM | #1 |
Okay, the problem is kindof simple, I need to detect when a unit roots, not when the root order is given but when it actually finishes rooting. Since this is very similar to spell casting the first thing that came into my mind is to do it Darky's way, a loop that waits for either something signifying the unit is rooted (mana change doesn't work, duh) or a cancelling of the order. My problem now consists of finding something that changes when the unit roots that I can detect. Please suggest anything you can think of, but try it first, I have done alot of exploring on my own and have mostly checked simple things like movement speed acquisition range etc (none of these change btw). Thank you in advanced. |
| 05-07-2003, 12:57 AM | #2 |
couldnt you just set the location of targeted order as a local point varaible. Then loop like loop Exitwhen StillRooting = false or DistanceBetweenPoints(point, GetUnitLoc(GetOrderedUnit())) <= 10 Call TriggerSleepAction(.1) endloop or am i missing something? I assume you would know how to make a function to dectect another issued order and exit this loop. |
| 05-07-2003, 01:14 AM | #3 |
heres a map with the trigger in it.. worked for me (do i get in the PR credits now :P) |
| 05-07-2003, 02:08 PM | #4 |
Good idea but some problems... The biggest problem with that is first of all pressing stop when the unit reaches there but before it roots, and the second problem is the time it takes for the unit to root, although I can also use an event that triggers before doing so this isn't that big of a problem. |
| 05-07-2003, 05:06 PM | #5 |
hmm i forgot about that, i solved the problem of taking a while to root by just adding an wait 1 second in the actions before the rest, the timing looked perfect to me, couldnt you do out of teh loop afer he has reached the spot call TriggerSleepAction(1) (i am making this syntax up right now) if GetNumUnits(Units withenrangeofType(10, unitrooted, pointx)) = 0 then return endif wouldnt this check 1 second after reachign the point that if there isnt a rooted unit at that spot then it would skip the rest of the actions, or else it would continue? lemme know if iit works? |
| 05-07-2003, 05:23 PM | #6 |
again heres a map with this new thing in it, i tested it a few times by stopping right before i would root and the text never appeared. maybe this wont work 100% but it works for me :P |
| 05-07-2003, 07:27 PM | #7 |
Just so you know a unit and it's rooted version both have the same unit type. But I think the location thing will most likely work, and I can add a wait/timer to match the animation. Thanks for the help...probably woulda taken me a little while to come up with that, sadly it's the simple solutions you see last... |
| 05-29-2003, 06:13 AM | #8 |
Guest | Maybe you should check if unit can attack, or smth like that. |
