Page 1 of 1

CMD.ATTACK_MANUAL

Posted: 18 Mar 2009, 11:21
by Argh
Acts like standard Attack, but tells the engine to not bother with Avoid checks.

Right now, if you send a CMD.ATTACK with three params, if it raytests and finds a collision with something that's supposed to be Avoided, it cancels that attack command (which it should not do, imo, a three-param attack should ignore the raytest and just obey LOS / terrain), and instead the Unit behaves stupidly, and tries to move ever-closer to the "target".

Not exactly ideal behavior, when dealing with World Builder stuff. It makes it impossible to have Units that Avoid Neutral by default, yet can be told to attack Neutral stuff, if given an explicit order by a user.

Another way of doing this would be to just have a Lua callout that would cancel the Avoid status of the given WeaponID until reset. Then I could code timer loops in COB to handle it, among other possible approaches.

As it is, I'll just continue to not use the Avoid code.

Re: CMD.ATTACK_MANUAL

Posted: 18 Mar 2009, 13:37
by imbaczek
we could move avoid* (and much more, i guess) from the weapondef to the weapon itself and add proper manipulation functions. unitdefs could use the same treatment.