Page 1 of 1

Multiple Firing Arcs

Posted: 27 Aug 2010, 17:22
by SpikedHelmet
Possible? Currently arcs are done by providing x y z co-ords for the direction, and a value to define the size of the cone the weapon can fire in this direction. Request is to be able to define multiple arcs using multiple sets of x y z co-ords; for instance:
"weaponMainDir1=1 0 0, -1 0 0;"
"maxAngleDif1=90;"

-- this would allow the weapon to fire in 90 degree arcs both to the right and left but not forward and rear, comprising an "X-type" firing capability. The ability to define the maxAngleDif for each co-ordinate set isn't particularly necessary (so it wouldnt need MaxAngleDif1=90, 90; for example); it would simply use the one angle-size for both directions.

Re: Multiple Firing Arcs

Posted: 28 Aug 2010, 09:51
by hoijui
can you not use two weapons?

Re: Multiple Firing Arcs

Posted: 28 Aug 2010, 21:51
by SpikedHelmet
No unfortunately I can not. We're talking about a ship with turrets along the centerline that can shoot on either side but not forward or backward.

Re: Multiple Firing Arcs

Posted: 28 Aug 2010, 23:52
by Pressure Line
You can Spiked :P IIRC the problem with that is that the larger S44 ships are hitting the weapon limit.

Re: Multiple Firing Arcs

Posted: 29 Aug 2010, 10:12
by hoijui
could the turret be a second unit, transported by the ship, having two weapons?

Re: Multiple Firing Arcs

Posted: 29 Aug 2010, 15:41
by Masure
Why is the weapon count limited ?

Re: Multiple Firing Arcs

Posted: 29 Aug 2010, 20:23
by Rafal99
No idea, but it is just a simple #define in Spring code, can be changed at any time. Would be nice to make it mod-definable imho.

@Spiked:
Can't you do it in unit script by blocking the gun from shooting in directions you don't want and/or ingoring the targets?

Re: Multiple Firing Arcs

Posted: 01 Sep 2010, 07:35
by Nemo
Raising that #define to something higher (say 64?) would be super handy at times (especially now that we can do lua unitscripts which don't require writing out X number of weapon scripts). That said, I imagine there's a reason it isn't set at some arbitrarily high value already, so letting it be defined by mod would be nice as well.

Re: Multiple Firing Arcs

Posted: 01 Sep 2010, 20:33
by yuritch
Spiked: unwanted targets (which cause aiming in restricted arcs) can be filtered script-side, by using set CHANGE_TARGET to <weapon number> (not yet sure how to do that in lua, but afaik no ships apart from my Gangut use lua scripts yet).

Re: Multiple Firing Arcs

Posted: 09 Sep 2010, 02:43
by REVENGE
yuritch wrote:Spiked: unwanted targets (which cause aiming in restricted arcs) can be filtered script-side, by using set CHANGE_TARGET to <weapon number> (not yet sure how to do that in lua, but afaik no ships apart from my Gangut use lua scripts yet).
Eh? That sounds interesting, do you have an example unit with a bunch of weapons and script I could look at?

Re: Multiple Firing Arcs

Posted: 09 Sep 2010, 13:48
by yuritch
I'll make an example when I'll get home. Probably using one of S44 ships as a base (they have lots of weapons). You'll need a testing build of S44 to see it though.

Edit: unit files attached. Torpedo launchers on the destroyer are limited by both maxangledif AND script. This seems to work ingame (but this change is not in S44 builds, so I don't have any testing data from naval battles).