Space Engineers

Space Engineers

CAT Custom Turret Rotor Slaving
Loues.S.Cat  [developer] 20 Mar, 2015 @ 12:27pm
How to use this script
The general stuff to get started with.
The SHIP_PREFIX is a short string. The script will check the name of each block it finds to be sure the name of that block starts with the string indicated by SHIP_PREFIX. it will skip any blocks that not not start witht he SHIP_PREFIX. this means diffrent ships can use the same script and the same keywords as long as the SHIP_PREFIX is diffrent. It can also be disabled by setting it to null. this means setting SHIP_PREFIX = null; _not_ setting SHIP_PREFIX = "null";

The Master Rotors: There should be two of these. One will have the Keyword indicated by ROTOR_MASTER_ONE which by default should be something along the lines of "[RM1]" and the other will use the keyword indicated by ROTOR_MASTER_TWO which by default will be something lie "[RM2]".
Each of these rotors will be located by the script, it's current angle checked and stored.

The Slave rotors: There can be quite a lot of these. They can come in up to four types, indicated by the keywords in ROTOR_SLAVE_ONE, ROTOR_SLAVE_TWO, ROTOR_SLAVE_ONE_INV, and ROTOR_SLAVE_TWO_INV. These default to values along the lines of "[RS1]", "[RS2]", "[RS1i]", and "[RS2i]". Each type represents a rotors that will be slaved to one of the two master rotors and they will rotate to match any change in the master rotors angle. One will rotate to copy the master rotors directly while the other will be inverted. This allows turrets to be made that have seperatly rotating sides, one left and one right, or one top and one bottom.
So [RM1] will map to [RS1] and [RS1i], while [RM2] will be mapped to [RM2] and [RM2i].

So, if SHIP_PREFIX is "[CAT]" and the other keywords are as described above, the master rotors will have names along the lines of "[CAT] Rotor [RM1]" and "[CAT] Rotor [RM2]"
The slave rotors would have name such as "[CAT] Rotor [RS1]".

You need to set up a timer to run the timer block as often as you want it to run, which to be effective will have to be fairly often. This can be done by either setting a 1 second timer to start itself and run the script or to trigger itself and run the script.

At the moment the script creates a list of rotors when it is first run, so you need to set up your rotors names in advance or reset the script.
Last edited by Loues.S.Cat; 20 Mar, 2015 @ 12:27pm
< >
Showing 1-6 of 6 comments
MrClifford 7 Jun, 2015 @ 6:32am 
how would i reset the script
Loues.S.Cat  [developer] 7 Jun, 2015 @ 7:36am 
Open it up in the editor and save changes should do it, even if you made none.
I'll have to go back through all my scripts and add reset inputs now that that is an option.
Keatosis 18 Feb, 2018 @ 11:59am 
Did an update break this? because I literally cannot get it to work, I've done everything you said to do but it still won't work :(
Keatosis 18 Feb, 2018 @ 11:59am 
Is there an example file I can copy?
Loues.S.Cat  [developer] 27 Feb, 2018 @ 3:31pm 
Sorry.
Been distracted by life.
I havent been updating these as Keen break them >.>
I'll get back on that.
Keatosis 1 Mar, 2018 @ 7:39pm 
Thanks buddy, you're my hero
< >
Showing 1-6 of 6 comments
Per page: 1530 50