Page 1 of 1

Distance-aware aiming scripts

Posted: 29 Aug 2006, 14:23
by KDR_11k
I think it would be cool if the AimWeaponX function somehow told you how far the target is away. That would allow stuff like having a command tower that when attacking has a piece that looks like a plane swoop down at the target and shoot at it. Unfortunately I can't think of a way to fit this into the current BOS system (unless you can add parameters to an engine-called function at will so AimWeaponX would really have three parameters but the third is ignored when the function definition only lists two).

Posted: 30 Aug 2006, 14:02
by Argh
Actually, you can do such things, but it involves using several pieces and then doing the trig necessary to return the distance. Complex, and not very much fun, but it is possible. I'd check out zszwg's teleporter code, if I were you :-)

Posted: 30 Aug 2006, 15:08
by KDR_11k
The trig functions in BOS are pretty limiting, I'd have used the manual approach if sine or cosine was available but I don't think it is.

Posted: 31 Aug 2006, 22:00
by Dragon45
Look at zwzsg's code. It's All You Need To Know.