| 09-01-2003, 05:34 PM | #1 |
Is there any way to determine what a particular unit was last ordered to do, or in other words, what a unit is planning on doing? |
| 09-01-2003, 05:56 PM | #2 |
The only way I can think of doing this is by haveing a trigger that catches all orders, and sets the ordered unit's custom value to a corresponding integer. For example when a unit is issued to move you can set its custom value to '1', or if it was ordered to patrol, you could set the custom value to '2', etc... Then when you want to know what the unit last did, just convert their current custom value back to the order string. The problem with this is, that you will have to defiine a table that has all the possible order strings and a corresponding integer. |
| 09-01-2003, 06:21 PM | #3 |
what about computer-controlled units? |
| 09-01-2003, 08:00 PM | #4 |
What about them? If you're asking if this will work from them, then yes it will. |
| 09-01-2003, 08:30 PM | #5 |
Cool, thanks... I'll give it a shot! |
| 09-02-2003, 02:48 PM | #6 |
Is there some way to turn off certain kinds of orders for a unit and then turn them back on? I can't find any way of doing it... Specifically, I'm trying to get the unit not to move unless ordered to attack. Please help! |
| 09-02-2003, 03:20 PM | #7 | |
Quote:
#Trigger1 <Pause On> for <Unit1> #Trigger2 Unit gets Order <Attack Unit> Unit = <Unit1> <Pause Off> for <Unit1> |
| 09-02-2003, 03:52 PM | #8 |
You don't really need a order string to integer map because that already exists. In fact when you are catching orders you can get that id (probably not possible in GUI). That id is the 4-letter-code of the ability or if it is a build order the 4-letter-code of the building or unit to be built. With that you can even differ between orders that have the same order string but are different. You can store the order together with the target in an array. Just put a unique number in the custom data field of the unit on creation and then use that number as the position of the data in the arrays (you can use additional arrays if you want to store additional data). |
| 09-02-2003, 04:12 PM | #9 |
There's a slight problem with the pause method... When a unit is paused, it can't be ordered! Damned annoying, really. I'm interested in this 4-letter order code though... how do you catch it if not through the GUI? |
| 09-02-2003, 08:42 PM | #10 |
Orders are strings, only abilities, items, units, doodads, destructables, and upgrades have integer id codes. So your still going to have to use the Order-To-Integer map. Yes, I know move, patrol, attack, etc.... are abilities, but to actually "catch" their IDs it takes quite a bit of work, and it is impossible to do in the GUI. |
