Space Engineers

Space Engineers

Rotor Cannon Script
124 Comments
funhans Feb 21, 2022 @ 7:47pm 
Howdy ;)

This thing is basically a dream - shredds everything withing moments and doesn't take any resources ^^ - huuuuuge thank you ;)

From time to time I get the error/message "Head already exists" ... Do you know something about it?
Shillelagh Sep 15, 2021 @ 7:35pm 
1 rotor would be extremely slow
Liquighost Sep 15, 2021 @ 5:10pm 
can i use this with one rotor for a cold launch missile?
Sarekh Aug 16, 2021 @ 1:54pm 
I don't know if I have ever properly thanked you for this wonderful script - I use it in a great many ships and artillery units and it always performs perfectly!
Shillelagh Aug 7, 2021 @ 6:57am 
Ah, thank you.
I remeber playing with them briefly a while ago and they were extremely overpowered.
I guess it's time I need to write a piston cannon script.

Thanks for the fun with these!
dagriefaa  [author] Aug 6, 2021 @ 8:09pm 
Unfortunately, the days where a rotor gun could hurl things at 600m/s are long gone. You might be able to squeeze 250m/s out of them if you try, which is still enough to wreck most things.

If you want to hurl things really really fast, then piston jolt guns are what you want these days. Especially if you don't have a speed mod.
Shillelagh Aug 6, 2021 @ 9:35am 
Rather slow. I've increased oscillations yo 15 and the stack is 10 large rotors long.
I've seen these things fire ridiculously fast objects, what am I missing here?
dagriefaa  [author] Mar 13, 2021 @ 8:25pm 
Update the script, use a 5-rotor gun, and check your groups are correct.
Also have a look at the showcase ship and see if that still works.
Starry Mar 13, 2021 @ 6:44pm 
Every time i try to fire a gun, it always explodes after the first oscillation, and detaches at the first rotor. I am trying a normal 6 rotor part gun
MagnaGazoo Jan 28, 2021 @ 6:50pm 
I changed detachOnRetract: to 1 and it stopped blowing up BUT I see no head part launching. It makes the noise and shakes but no head is flying.
MagnaGazoo Jan 28, 2021 @ 6:37pm 
I have used this before the last update just fine. Now with just the basic 6 rotor head launcher and default settings. The last couple of rotors explode every time. :(
bomml Sep 14, 2020 @ 12:52pm 
Thank you for the help! Keep up the great work :D
Sh4yd9w Aug 21, 2020 @ 5:01pm 
why everything explodes when i fire? it seems the block is coliding....
dagriefaa  [author] Aug 15, 2020 @ 7:52pm 
It should be fixed now.
(on an unrelated note, you might also want to set detachOnRetract to 1 :^) )
bomml Jul 23, 2020 @ 8:31am 
dagriefaa  [author] Jul 17, 2020 @ 6:37pm 
It should detect the first rotor without a head.
Can you provide a blueprint/world of the gun?
bomml Jul 17, 2020 @ 8:31am 
Is there a way to help the script recognize the generator? I have a rotor gun made of 5 adv. rotors, one of which is the gen. If I fire it, the script seems to think the first rotor (so the one furthest away from the "Muzzle") is the generator and detaches that one, so four rotors fly out of the gun and the cannon itself is destroyed...
dagriefaa  [author] Jul 12, 2020 @ 6:03pm 
So, you don't need any 'Accelerator/Generator' groups for this script. Just put all of the rotors/merge blocks in one RDSA group and delete the old ones.
The script crashing was caused by having only one rotor in a group. I think. I've added some safeguards for that.
SGT_MAJOR_FISH Jul 12, 2020 @ 5:58am 
SGT_MAJOR_FISH Jul 12, 2020 @ 5:38am 
also should mention that its not letting me run it at all on the gun im currently building, but on another gun that uses a merge block instead of a rotor generator it works normally
SGT_MAJOR_FISH Jul 12, 2020 @ 5:28am 
fire
dagriefaa  [author] Jul 12, 2020 @ 5:24am 
What arguments are you putting in?
SGT_MAJOR_FISH Jul 12, 2020 @ 4:51am 
I'm still getting an error:

Caught exception during execution of
script: index was out of range. Must
be non negative and less than the
size of the collection.
Parameter name: index
at
System.ThrowHelper.ThrowArgumen
tOutOfRangeException(ExceptionArgu
ment
argument,
ExceptionRecource
resource)

at
Program.init()

at
Program.Main(String
arguments)

at
Sandbox.Game.Entities.Blocks.MyPr
ogrammableBlock.<>c_DisplayClas
s46_0.<ExecuteCode>b__0(IMyGridP
rogram)

at
Sandbox.Game.Entities.Blocks.MyPr
ogrammableBlock.RunSandboxedPro
gramAction(Action`1
action,
String&
response)
dagriefaa  [author] Jul 11, 2020 @ 6:05pm 
Not broken anymore.
SGT_MAJOR_FISH Jul 11, 2020 @ 9:28am 
broken?
bomml Jun 30, 2020 @ 2:40pm 
Thank you!
Blacky Watchy Jun 30, 2020 @ 12:50am 
cool, thanks
dagriefaa  [author] Jun 29, 2020 @ 10:25pm 
The problem has been fixed. Everything should now work.
Blacky Watchy Jun 29, 2020 @ 2:20pm 
@kellettchrist . try to coppy all the script, moving it to word or a notepad and use the option replace.
bomml Jun 26, 2020 @ 9:34am 
@kellettchris I figured! I unfortunately can't help you sorry as I am as proficient at coding as a fish is at hiking! But would that mean we can potentially have hinge firing rotor guns?
kellettchris Jun 26, 2020 @ 8:21am 
@bomml and @dagriefaa - it's because the action "Add Top Part" has been changed/removed. Due to the new hinges, the action list now has "Add Rotor Head" and "Add Hinge Head". But I'm having trouble calling those actions in test scripts. Can anyone can help with this?
bomml Jun 25, 2020 @ 1:07am 
Hey there! I love your script and it has been an integral part of many of my ships! Unfortunately I have to report that the last update broke it:(
pyrotech850 Jun 22, 2020 @ 1:19pm 
Thanks BROTHER this fixes the 1 problem i have with space engineers - not enough guns.
Quickshadow10m May 22, 2020 @ 11:49am 
lol
akaalexandermax May 22, 2020 @ 11:47am 
love it :)))
HERETIC Nov 30, 2019 @ 1:49am 
I am, deeply sorry for how stupid i've been being, I completely missed the <substring-id> par of the argument entering, I will now and hide in the depths of the pit of shame but at least i'll have rotorguns that work
dagriefaa  [author] Nov 28, 2019 @ 3:48pm 
It should detect things automatically, and you shouldn't actually need to put arguments beyond what's specified in the description.
...
At this point I really don't know.
HERETIC Nov 28, 2019 @ 9:34am 
I already was, I've gone back over the entire description like 3 times and nothing has helped
do I need to like, enter anything along the the arguments when I run the PB ? I'm at a complete loss here, do I need to name generator and accelerator groups like for the lightweight version ?

the lightweight version works a charm btw, but I wanted this one to make merge block ones
dagriefaa  [author] Nov 27, 2019 @ 4:10pm 
I think you might need to remove the rotor head from the last rotor. That's the only thing I can think of.
HERETIC Nov 26, 2019 @ 9:23am 
To clarify, the script is not returning any errors and apears to be running as intended, with the exception of it not functioning. I have tried the test ship in another world and it works just fine, so I assume there must be a mistake in my setup, but I am unable to find said mistake
HERETIC Nov 26, 2019 @ 8:45am 
it won't work for me at all
everything seems to be grouped properly, I get the "standby" in the PB, but when I run with any argument, nothbing happens
dagriefaa  [author] Nov 20, 2019 @ 4:17pm 
Try setting detachOnRetract to 1.
SGT_MAJOR_FISH Nov 20, 2019 @ 5:13am 
my merge block keeps breaking when i add a larger projectile, what do i need to adjust?
dagriefaa  [author] Nov 18, 2019 @ 7:35pm 
Any rotors will work.
KKComice Nov 18, 2019 @ 6:12pm 
Do the rotors need to be normal rotors or can I use advanced rotors behind the normal rotor? (rotor part gun)
dagriefaa  [author] Nov 16, 2019 @ 4:39pm 
There is a link to an example ship at the top of the description.
Ded Banzay Nov 16, 2019 @ 1:17am 
It is not possible to make a working version of "RDSA".
Is there a video or detailed instruction?
Lanigav Oct 8, 2019 @ 10:19pm 
Previous post aside, a 5s burst didn't punch through multiple air-gapped layers of heavy armor. It put a dent in the second layer, the problem is the rotor heads don't destroy themselves so after a few get bunched up you've effectively ADDED armor to the ship you are shooting at.

That said.... the odds of you shooting from a stationary position at a stationary target are slim (if you are using this); and nothing beats the efficiency or spray n pray factor of this weapon. In my opinion it's a must have as of current build and will cause VERY noticable damage to whatever it hits. Even self-repairing ships don't have much chance as it leaves all kinds of debris in the way of rebuilding.
Lanigav Oct 8, 2019 @ 9:45pm 
Can confirm it does work as of 10/8/19 in SP creative. One stack of 6 rotors unleashes hell upon whatever is in front of it in 0g.
Orwell_Huxley ®™ Oct 8, 2019 @ 8:52am 
I was shooting this yesterday. Trying to reverse engineer it to learn the mechanics of these things. It does work.