Space Engineers

Space Engineers

36 ratings
Weapon Control Sytem
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
3.648 KB
17 Aug, 2017 @ 7:17pm
14 Mar, 2018 @ 10:51am
3 Change Notes ( view )

Subscribe to download
Weapon Control Sytem

Description
This script lets you group your weapons together (vanilla, modded,
even different types in the same group) and fires them in automatic- or burst-fire mode

You can use you mouse to control the weapons; using the toolbar is also possible !

All weapons except turrets can be used, modded guns should work too.
Using different types of weapons is also possible, but only in burst fire-mode.
The script works with large ships and small ships.
To assign weapons to the group, just copy paste the prefix from the script
( by default [GunControl] ) anywhere into their names.

If you want to use more than one group, set up several programmable blocks each with
a different prefix.


In auto mode, you can single tap, burst or hold down your mouse button to autofire.
Basically like an ak47.

In burst mode, the script will fire all guns once one after another, great for broadsides
and giant cannon volleys.

The fire rate or RPM (rounds per minute) (for both burst and auto) can be calculated automatically
to ensure continuous fire(only works with vanilla rocket launchers)
or set to a value between 1 and around 20.000.(theoretically infinite)

The sequence of the guns firing is alphabetical, see pictures above.
If they are in order in the terminal (also alphabetically sorted) they are in the correct order.

No timer needed !
The script automatically runs itself every tick.

All variables are easily accessible and configurable in the script. (see picture above)

Guide for setting up the script:
1. Load Script into ProgrammableBlock, save & exit
4. Name your weapons with the prefix [GunControl], e.g. "A [GunControl] GatlingGun"


[OPTIONAL]
There is also a number of arguments you can use to directly do something from the toolbar.
Just drag the prog. block to the toolbar, choose run and type one of these arguments in.
-cycle: skips the current weapon and proceeds to the next one
-shoot: shoots the current weapon and proceeds to the next one
-reset: selects the first gun on the list as currently active gun
-burst: fires a single burst


References:
This script is quite similar to Whip's Weapon Sequencer,
from which I took a lot of Inspiration and maybe a line of code or two ;)
Whip's Weapon Sequencer

The ship from the thumbnail with the nice broadside cannons is the [HS] Cobra Destroyer.
[HS] Cobra Destroyer


Also check out these:
Thruster Heat Sink
Weapon Heat Sink
15 Comments
Major Jon  [author] 19 May, 2021 @ 4:34am 
No idea, I'm not maintaining this script anymore. I last updated it one year before wc even came out. I don't even know if it works at all anymore. Just try it out, maybe you're lucky.
Abisius Xarvenius Carbensius 19 May, 2021 @ 3:09am 
@Major Jon
do oyu also include weaponcore based modweapons into your modded weapons?
i ask cause most scripts that are made to work with vanilla based modweapons or other weapon frameworks dotn work with wc https://sp.zhabite.com/workshop/filedetails/?id=1918681825
ManedWolf 31 Jan, 2021 @ 7:06pm 
Nevermind that. I found a way.
ManedWolf 31 Jan, 2021 @ 6:48pm 
Is there a way to switch to another type of weapon ? For example, I have this ship with rocket launchers and reloadable rocket launchers. The programmable block is on "cycle mode". And I want to switch between them. I mean, I want these rocket and reloadable rocket launchers to fire on "cycle mode" separately when I switch between them in the toolbar.
Sanyanov 22 Mar, 2018 @ 12:56pm 
Ah, sorry, I was dumb, can't read properly. "All weapons except turrets can be used" :D. My fault.
Major Jon  [author] 22 Mar, 2018 @ 12:14pm 
This small fighter of me uses this script and it works fine.
http://sp.zhabite.com/sharedfiles/filedetails/?id=1333811988
Maybe comparing them could help.
Major Jon  [author] 22 Mar, 2018 @ 12:11pm 
Well it works for me with no problem.
The only other things i can think of are subgrids, which as far as I know don't work
and modded guns, which might not work in some cases.
Also turrets are not supported at all by this script.
Also you have to use these [xyz] instead of the normal ones (xyz)
Sanyanov 22 Mar, 2018 @ 11:30am 
But still can't find it
Sanyanov 22 Mar, 2018 @ 11:30am 
Yes, I'm an owner of both blocks, both are turned on, script is running correctly
Major Jon  [author] 22 Mar, 2018 @ 8:05am 
Do they have the same ownership as the prog ?