| 12-07-2003, 05:09 AM | #1 |
I'm making a reflect skill which gets the ordercode of an ability cast on a unit, and casts it back at the caster. A dummycaster learns this spell and is ordered to cast it. The units that are to be reflected upon are in a unit group so that multiple units can order/cast on the target. The problem is that I'm unsure how to store the ordercode for each order of each cast on the target. The potential bug of using a single unit variable and a single ordercode variable is but this: Warden is ordered to cast Shadow strike on target Mountain King is ordered to cast Storm Bolt on target Storm Bolt is negated and reflected at Mountain King Shadow Strike is cast and nothing happens because the variables are the mountain king and his stormbolt. Thanks for help. |
| 12-07-2003, 01:07 PM | #2 |
You can try to use a order variable array and a unit variable array. For example if a Warden casts shadow strike you store the order id in OrderVariable[Integer_Here] and the unit id in UnitVariable[Integer_Here]. When those values are set you set Integer_Here + 1 and then when the mountain king casts the storm bolt you do the exact same thing as with the warden. Then when mirroring them you run a loop (For each Integer A) that casts the order OrderVariable[Integer A] on unit UnitVariable[Integer A]. If I didn't get it right then you'll have to explain better but I hope I got it right :) |
| 12-07-2003, 02:06 PM | #3 |
You could use a local variable, and that ought to fix your problem, but I don't know how order-string variables work in local form (they are integers). |
| 12-07-2003, 02:13 PM | #4 |
They work the exact way as if you would have declared a global variable, it's the same thing. |
| 12-07-2003, 04:27 PM | #5 |
I had considered using arrays, but what if in some hypothetical situation, 40 satrys were all ordered to Purge the target? I would need 1 variable in the array for each one. I'm sure things would work out if it was like an array of a size of 100 or something, but it just seems sloppy to me. |
