Space Engineers

Space Engineers

CAT Custom Turret Rotor Slaving
Loues.S.Cat  [开发者] 2015 年 3 月 20 日 下午 12:27
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.
最后由 Loues.S.Cat 编辑于; 2015 年 3 月 20 日 下午 12:27
< >
正在显示第 1 - 6 条,共 6 条留言
MrClifford 2015 年 6 月 7 日 上午 6:32 
how would i reset the script
Loues.S.Cat  [开发者] 2015 年 6 月 7 日 上午 7:36 
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 2018 年 2 月 18 日 上午 11:59 
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 2018 年 2 月 18 日 上午 11:59 
Is there an example file I can copy?
Loues.S.Cat  [开发者] 2018 年 2 月 27 日 下午 3:31 
Sorry.
Been distracted by life.
I havent been updating these as Keen break them >.>
I'll get back on that.
Keatosis 2018 年 3 月 1 日 下午 7:39 
Thanks buddy, you're my hero
< >
正在显示第 1 - 6 条,共 6 条留言
每页显示数: 1530 50