| 08-23-2004, 09:25 PM | #1 |
Hey, I just need to be able to distinguish two orders in my JASS: move, and smart-move. Hence, if the user presses 'm' (for move) then the condition would return true, OR if the user right-clicks on a point on the ground, then the condition would return true. The problem is, I just want to catch those EXACT two conditions. When I use "smart", right-clicking on a target (to attack) is also caught, as well as the right-clicking on the ground for move. Any suggestions? I can't seem to find a list of order strings so I can't tell if there's perhaps some string like "smartmove". for example: if ( GetIssuedOrderIdBJ() == String2OrderIdBJ("move") ) then ... if ( GetIssuedOrderIdBJ() == String2OrderIdBJ("smart") ) then ... Thanks |
| 08-23-2004, 09:49 PM | #2 |
right clicking on an enemy unit wouldn't be a move command right? It would be an attack-move order. As far as I know catching the "move" order would be just looking for that. Moving is right clicking and/or pressing the "m" key and left clicking. When you press "m" and click on a unit the order would be different than attack move. Does anyone know the order for pressing "m" and left clicking a unit? Just use the "move" order. That will catch your "m" and your right click. What is smart-move? If there is such a thing as smart move you will have to say your order like "smart-move" with the hyphen I believe. |
| 08-23-2004, 10:01 PM | #3 | |
Quote:
Unfortunately, if that were the case, I wouldn't have needed to ask the original question. =) "move" only catches the user pressing the hotkey for move and specifying a target (unit or point on ground). And people (most people, unless they're using "move" to move-surround) use the right-click + point on ground to move. And while that is, by nature, a move command as well, "move" does not capture it. "smart" captures the right-click + point on ground, however, it will ALSO capture the right-click + target (unit/hero/etc) as well. Perhaps if I explained the context of the problem. Envision a "wind-walk" type spell. It has a variable duration, and variable movement speed increase based on a number of attributes (mainly the agility attribute of the caster). There's a trigger to activate the "wind-walk" type spell, and I need a trigger to deactivate/remove the "wind-walk" when the caster does anything BUT move. Hence my problem. The trigger must NOT run when the caster (with the windwalk buff) is moving around, either by "m" + target/point on ground OR right-click + point on ground. So, using "smart" is nice and all, since it captures the "right-click + ground" movement, but it also means that the caster can "right-click + unit" attack an enemy and retain invisibility. |
| 08-23-2004, 11:52 PM | #4 |
Ah, nevermind, I figured it out. After a little testing, "smart" accounted for both types of orders, and there wasn't any other string orders that could differentiate between the two. So I just added another if-condition where I checked if the target of the issued order was null or not. If it was null, then it was a smart-move. If there was a target, then it was a smart-attack. function Trig_Shadow_Run_Remove_Conditions takes nothing returns boolean if ( GetIssuedOrderIdBJ() == String2OrderIdBJ("smart") ) then if ( GetUnitTypeId(GetOrderTargetUnit()) == null ) then return false endif endif return true endfunction Ah well, easy enough. |
