Space Engineers

Space Engineers

TCES | Turret Controller Enhancement Script
516 Comments
Whiplash141  [author] 19 Jul @ 3:28pm 
multiple for elevation will work, multiple for azimuth likely will not.
Wickedcube 19 Jul @ 1:26pm 
Hey, will this script let me have multiple rotors/hinges control the same turret? I'm making some pretty heavy stuff so the turret needs more than one hinge and rotor for its Azi and Ele. Ive tried it already but the turret does not move.
Whiplash141  [author] 18 Jul @ 4:21pm 
I'm not sure what you mean. TCES supports stabilization on both the azimuth and elevation rotor(s). It works perfectly fine for tanks as a result
TheVulture 18 Jul @ 3:15pm 
I was testing this and found out that unfortunately TCES doesnt allow stabilizing for rotation, this would be great for things such as tanks or apcs as it makes aiming a little bit easier. Would be a fun thing to add.
Vomsay 6 May @ 3:26pm 
Anyone having problems with the latest Keen update?
My custom turrets with TCES are completely bugged :(
WardenWolf 2 May @ 4:08pm 
I know it's a little outside the scope, but there's literally nothing out there that does this automatically. I (and I'm sure others) would absolutely love if there was an option to automatically reset the orientation on our vanilla turrets as well. Or an option to trigger a timer block so we can tie actions to end of combat.
spiro9 | peef 30 Apr @ 3:51pm 
Does this script work for grouping single-block turrets? I'd like to have synchronized simultaneous control of groups of turrets for the sake of barrage and broadside style attack sequences.
Whiplash141  [author] 6 Apr @ 12:21pm 
The automatic deviation angle computes the maximum allowed aim deviation angle by taking into account the radius and distance to your target.

For example: if your target is 1000m away and has a radius of 50m, the script would compute the max deviation angle as atan(50/1000) or roughly 2.9 deg. If your guns are not firing with that setting on it is because the guns are not aiming within 1 target radius of the target. (they are likely not tracking precisely enough)

You can of course turn this off, but you will likely be wasting ammo as a result.
xxmanofmemesxx 5 Apr @ 9:20am 
I was doing some testing of SPAA/PD vehicles and noticed some would track but not engage missiles launched by the test aircraft. Turning off the angle deviation calculation allowed the vehicles to engage.

I'm now interested in what the angle deviation calculator does and where it is best applied for future builds. What benefits does it have over static deviation values and what weapons or situations does it best work for?
DazeyDream 2 Apr @ 9:35am 
TCES v1.14.2. I have MART running too, but the MART prog block is turned off while TCES and custom turret are turned on (toolbar toggle to swap between auto aim and manual aim while driving)

I've uploaded the tank. If you fire the cannons with the toolbar it will fire the right side cannons a second time after reload. Doesn't look like it does this if it's the ctc firing.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3456773193
Whiplash141  [author] 1 Apr @ 10:05pm 
@DazeyDream:
Any other scripts running? Also what version of TCES?
DazeyDream 1 Apr @ 5:55pm 
Having an issue where if one elevation guns fire, the other elevation will also fire in sync, but will fire a second time after the assault cannons reload.
wtdtd 22 Feb @ 12:21pm 
If it is not too much work, make it an option so people can choose between server preformance and the accuracy of the rest position.
Whiplash141  [author] 22 Feb @ 12:59am 
Its a performance consideration I built in. Once it gets decently close to the rest angle, it puts the turret control loop to sleep to save on some processing power. I could probably make the cutoff a bit tighter tbh.
wtdtd 21 Feb @ 2:58am 
I noticed that the rest angles arent very exact, on an azimuth rest angle of 0 it will either settle on 359 or 1. This due to some setting somewhere or just general limitations in the script?
Nighthunter 18 Feb @ 4:46pm 
@Whiplash141 ah okay thats sd to hear. I really like your script and use WC very often. Would it be okay for me to make a companion script for yours to make it work with WC if I can figure it out?
Whiplash141  [author] 17 Feb @ 8:43am 
I have no interest in mods like weapon core that don't conform to the script API.
Nighthunter 17 Feb @ 7:21am 
@Whiplash141 I had the Extra weapon not fire or just fire short bursts. It solved it self now after multible times of reloding the world on my end. So might have been a World error.

Ps: If you at some time want to make a Weapon Core Patch or addon script, I found a scripting template for those weapons and more here on the workshop.
Whiplash141  [author] 16 Feb @ 9:11pm 
Extra weapons are working in that world:
https://steamusercontent-a.akamaihd.net/ugc/36694476724297503/3C2F0768F71D5E5B9D684B3F909A3569CF708B4B/

What issue were you seeing?
Nighthunter 16 Feb @ 2:21pm 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3428914692 Should be fixed now. Forgot that the Vanilla Pack of Consty's has different ID's.
Nighthunter 16 Feb @ 2:11pm 
3.5 gigs of mods :spacemarineskull: Yeah I know. I used a lot of moded blocks on that one xD
Whiplash141  [author] 16 Feb @ 1:56pm 
Option 1 spawns without guns so I can't test it. Is there something missing from the mod list?
Whiplash141  [author] 16 Feb @ 1:44pm 
3.5 gigs of mods :spacemarineskull:
Nighthunter 16 Feb @ 1:42pm 
@Whiplash141 ah that could explain why it sometimes works with your script and sometimes not.
Would left the Moded weapons on the Vanilla Framework and why those do not work. Maybe its a World Problem.

I uploded both options:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3428891930

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3428890191
Whiplash141  [author] 16 Feb @ 10:12am 
Extra rotor weapons still work on my end in every configuration I've tested. If you have a blueprint that can replicate the problem, I'll take a look.
Nighthunter 15 Feb @ 4:21pm 
@Whiplash141 Hey, I encountered a bug with your new version. The Script does still recognise extra rotors and extra weapons but fails to fire the weapon on the extra rotor. I encounter this bug with vanilla weapons and also with Weapon Core. Before the Update it worked fine for me in both cases.
Whiplash141  [author] 13 Feb @ 1:03pm 
Yeah, it is called a physics engine from last decade. Disable stabilization or experiment with inertia tensor on elevation or both elevation and azimuth rotors.
Spencer 13 Feb @ 6:51am 
Yeah was just about to say its a fantastic script but makes my turrets shake. it seems this is a pretty common issue
bubblebutt 8 Feb @ 7:56am 
Hello whip. I'm struggling with this mod is there a tutorial video at all I'm trying to build a cool turret and can't get this mod to pick up the second elevation hinge any help would be appreciated
Whiplash141  [author] 5 Jan @ 1:50pm 
Turn on share inertia tensor for your elevation rotor only.

If that does not work, you'll just have to disable stabilization for elevation since something about your turret makes the physics engine mad.
Lt.Fenix 5 Jan @ 12:36pm 
While you can still control manually, the turret shakes uncontrollably, particularly up and down, making it practically useless.
Lt.Fenix 5 Jan @ 12:35pm 
I seem to have a bug where the turret controllers are configured correctly when not being controller manually, but as soon as one assumes manual control of a turret controller, the azimuth and elevation rotors get selected to none.
When you go out of manual control, the azimuth and elevation rotors automatically go back to their correct selections.
Whiplash141  [author] 28 Dec, 2024 @ 4:39pm 
@Wonko The Sane
Do you have a blueprint I can look at?

When you have extra rotors that are not the azimuth/elevation, the script will pick the first camera that is directly attached to either the azimuth or elevation rotors and within the TCES group.

As alluded to by my response to ~Ari~, you can alternatively solve whatever ambiguity there is in your system by being explicit with SYNC groups.

Add your primary elevation/azimuth rotors and the tools/cameras they control to a TCES group, but do not add your extra weapons/tools to that group.

Instead, create a SYNC group with each extra rotor and weapon/tool that includes the CTC of your TCES group. You can create any number of SYNC groups that synchronize to a CTC (even if it is not TCES controlled). This is what TCES is doing internally, but sometimes the assumptions it has to make do not hold up in all use cases, so you may need to help it out by being more explicit.
Whiplash141  [author] 28 Dec, 2024 @ 4:33pm 
@~Ari~
Try v1.14.1. I added inverted rotor support to TCES and SYNC groups. Try it out and let me know if that works for your use case. There are a few edge cases with using inverted rotors in a TCES group that controls extra rotors, since TCES has to make a few assumptions. These assumptions should hold for the vast majority of sensible use cases, but on the off chance that they do not, it is always possible to explicitly specify things with a minimal TCES group and multiple SYNC groups.
Wonko The Sane 20 Dec, 2024 @ 2:03pm 
it did seem to work when i initially built it, but when i rejoined the server there was a problem
Wonko The Sane 20 Dec, 2024 @ 2:02pm 
no elevation ones
Wonko The Sane 20 Dec, 2024 @ 2:02pm 
i have lots of azimuth rotors that are slaved to a main azimuth rotor
Whiplash141  [author] 20 Dec, 2024 @ 12:10pm 
So you have extra elevation rotors? Or just a single one?
Wonko The Sane 20 Dec, 2024 @ 9:00am 
Re-previous comment-
It seems to pick the first camera in the drop down list
Wonko The Sane 20 Dec, 2024 @ 8:49am 
I have a problem where the script in the programmable block keeps changing the camera that i choose in the turret control block for the azimuth, i have a camera called "Camera_Solar_Panel_Azimuth" which is the one i want to use but it keeps switching to other cameras, (the ones that are supposed to follow the main one). Every time i pick the one that i want it switches to the other, unless the programmable block is turned off.
~Ari~ 20 Dec, 2024 @ 12:29am 
Uh oh. :AimiShock: I'm so sorgy
Whiplash141  [author] 20 Dec, 2024 @ 12:16am 
That is definitely new behavior. That code was certainly not there last time I looked in a decompiler. It will take time to unwind the implications of how to handle that in TCES.
~Ari~ 20 Dec, 2024 @ 12:07am 
The turret does work without the script, I can provide a blueprint if needed
Whiplash141  [author] 19 Dec, 2024 @ 11:56pm 
"I have a turret with the elevation hinge on the gun side and the hinge part on the turret base"
That arrangement will not work with the CTC natively and thus will not work with this script.
~Ari~ 19 Dec, 2024 @ 11:53pm 
I have a turret with the elevation hinge on the gun side and the hinge part on the turret base, because I need to switch from SG large conveyors to LG in a compact space. This is causing issues with aiming and stabilization. Aiming is janky, the gun always slides to max or min elevation and doesn't stay still, and elevation stabilization is also in the wrong direction. Since diving into the script to invert the direction control would invert all other custom turrets on the ship that aren't built with this funky configuration, is there an easy way to make TCES invert just this turret? Or account for the hinge being on the "wrong" subgrid?
bsimp14 4 Dec, 2024 @ 4:02pm 
I've had this fenomona to happen before, It happened after I got everything to work without fiddling with the settings
Whiplash141  [author] 4 Dec, 2024 @ 5:30am 
"is it possible to setup turrets with multiple elevation rotors to move independently of each other"
Not if they are controlled by the same CTC via TCES
W7v3rn 3 Dec, 2024 @ 11:25pm 
is it possible to setup turrets with multiple elevation rotors to move independently of each other, as if each barrel is raised individually.

something similar to this image i found:
https://www.navygeneralboard.com/wp-content/uploads/2019/01/South-Dakota-Independent-Elevation.jpg

i always wanted that satisfying movement massive cannons, like the triple barrel, are usually depicted having.
Ace 2 Dec, 2024 @ 4:58am 
I hope the friendly fire avoidance gets added soon because I just shot a hole through a parked ship using a laser on a custom turret.

Whoops.
bsimp14 27 Nov, 2024 @ 9:28pm 
will this work for turret blueprint pasting if the CTC is included in the turret?