I've been able to write a BOS script that will prevent units from aiming lower than a certain angle- keeping them from ever firing. This was a superficial problem with certain NanoBlobs units, and I'm quite glad I actually found a solution to this problem.
I'm pretty sure this code won't work in OTA, because it doesn't check things with SIG_AIM functions often enough, but it works just fine in Spring.
Just a quick note about BOS aiming
Moderator: Moderators
Ok, my dreams for FINALLY having the ability to keep units from aiming down through themselves are partly realised.
Yeah, that also means that we can have a MINIMUM RANGE.
The bad part? Very simply, there is exactly ONE type of weapon that will actually obey its script and return proper values without hanging.
Yeah, that also means that we can have a MINIMUM RANGE.
The bad part? Very simply, there is exactly ONE type of weapon that will actually obey its script and return proper values without hanging.
Spring doesn't read minbarrelangle.
Also, what's so hard about if(pitch < desiredangle) { return FALSE; } if(pitch > desiredangle) { do normal stuff and return TRUE; } ? Does exactly what you just described, and should be foolproof--well, maybe not quite, I think pitch is measured oddly in spring, but once you work out that oddness it'd be foolproof since it's consistent oddness.
The only problem is that you can't break a unit's lock on a target from the script, this is why script based arcs are bad--in both engines. If a unit gets locked on, then moves in close enough the the unit with the min angle, it won't decide to aim at a new target since it now can't fire at the old one. A well microed assault could effectively jam and make limited angle weapons totally useless. We either need a way to tell units to pick a new target from the script, or it needs to be properly coded in so they do that themselves without our prodding.
Also, what's so hard about if(pitch < desiredangle) { return FALSE; } if(pitch > desiredangle) { do normal stuff and return TRUE; } ? Does exactly what you just described, and should be foolproof--well, maybe not quite, I think pitch is measured oddly in spring, but once you work out that oddness it'd be foolproof since it's consistent oddness.
The only problem is that you can't break a unit's lock on a target from the script, this is why script based arcs are bad--in both engines. If a unit gets locked on, then moves in close enough the the unit with the min angle, it won't decide to aim at a new target since it now can't fire at the old one. A well microed assault could effectively jam and make limited angle weapons totally useless. We either need a way to tell units to pick a new target from the script, or it needs to be properly coded in so they do that themselves without our prodding.
Maybe the best way to deal with this would be two things:
A MinimumRange tag, so that ballistic weapons do a check against the range, and if less than X, then they pick another target, or wait.
A TargetLock tag, that specifies the maximum time that a weapon may lock on given target. After that, the weapon is forced to start the target-selection procedure over again.
Both things wouldn't cost a great deal more CPU than the current methods, and they'd allow us to get rid of a lot've headaches.
A MinimumRange tag, so that ballistic weapons do a check against the range, and if less than X, then they pick another target, or wait.
A TargetLock tag, that specifies the maximum time that a weapon may lock on given target. After that, the weapon is forced to start the target-selection procedure over again.
Both things wouldn't cost a great deal more CPU than the current methods, and they'd allow us to get rid of a lot've headaches.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Spring has such a tag, but as to whether or not it does as you described, I am uncertain.Argh wrote:A MinimumRange tag, so that ballistic weapons do a check against the range, and if less than X, then they pick another target, or wait.
This would also fix that "get a defender (or any other non-mobile unit with a turret) to target the enemy com so you can see where it is for as long as that defender lives" exploit.Argh wrote:A TargetLock tag, that specifies the maximum time that a weapon may lock on given target. After that, the weapon is forced to start the target-selection procedure over again.