| 04-15-2008, 06:57 PM | #1 |
I have a custom movement system in my map which is based on the normal move function. When you click the move button, the unit will be added to a trigger that moves it in the chosen direction with some modifiers every 0.05 seconds. This thing works fine. I want the stop button to stop the unit again. Since the movement button makes the unit move infinitely, I need the stop button to turn off the movement. A normal order detection, with issued order == stop will trigger very very often since the unit is always stopped when it isnt moving. This leads to that the unit will be ordered to stop all the time, making it impossible to move the unit more than 3 yards at a time. I have tried detecting if the unit is idle too, but it is always idle since the movement is interrupted when I use the move instantly action. Ordering the unit to move 1 yard forward when it is ordered to move a longer distance neither seems to work. There are 2 possible solutions to this problem, either I need to detect the order in some way or I need to remove the stop button and replace it with a dummy ability that does the same thing. Help plplzzzlplplz?! |
| 04-15-2008, 07:19 PM | #2 |
I actually have a workaround for now but it doesn't look very good. If I switch the tooltips and the icons for stop and hold position I could use that ability instead. This could lead to problems later though so I'd prefer a better way of doing it. |
| 04-15-2008, 07:22 PM | #3 | |
Quote:
If the movement is triggered you will want to code a stop order on move order detection that you can catch and ignore (to prevent the actual movement occuring). |
| 04-15-2008, 07:36 PM | #4 | |
Quote:
I could try the setX/Y. That would probably work good if the unit remembers its orders. Ordering the unit to stop on move order and catch it is already tried. The problem is that the unit keep getting stop orders even after that. Something like this: Trig1: Events/Conditions: unit is ordered to move Actions: set blockstop = true <blahblah> order unit to stop Trig2: Events/Conditions: unit is ordered to stop Actions: if (blockstop == true) blockstop = false skip remaining endif <blahblah> If you don't mean like this, what do you mean by catching the stop order? |
| 04-15-2008, 07:39 PM | #5 |
Thats what I mean with the catching. The problem is that move instantly in GUI orders the moved unit to stop; which is where your problems are coming from. |
| 04-15-2008, 08:17 PM | #6 |
SetX/Y worked great. Now I don't even need to use SetUnitAnimationByIndex anymore since moving him does that automatically! I should prolly start coding in JASS instead, half of my triggers are made out of Custom Script actions already ![]() |
| 04-16-2008, 12:20 AM | #7 |
*watches JASSers everywhere do a collective fist pump* :P |
