Space Engineers

Space Engineers

Whip's Turret AI Slaving Script
2,489 条留言
Francis 10 月 24 日 下午 2:35 
Is there a way to configure the turret slaving to ONLY be active while the designator is being Manually Controlled; so when the designator stops being Manually Controlled, the slaved turrets return to vanilla independent behavior.
(I.E. for purpose of allowing independent turret targeting as default, and only using the slaving script for manual Target Focusing upon request.)
(vanilla Target Locking theoretically achieves nearly this, however turrets obey subsystem and auto-lead behavior in that case; the desire is purely manual control of all slaved turrets via designator (again, only when designator is controlled))
Gohei 8 月 30 日 下午 1:11 
any way to change the speed at which they shoot? like if i want a 1 or 2 second timer between each shot?
Whiplash141  [作者] 8 月 4 日 上午 7:47 
Possible? Yes. Sensible? No.
Based_Stickman 8 月 3 日 下午 10:36 
Is it possible to have these be able to slave to a target given by ai block kind of like the way rdav did his missiles
Whiplash141  [作者] 7 月 30 日 下午 10:26 
"will they still shoot?"

Yes.

"i notice it seems u use interior turrets as designators"

I made a lot of the documentation and examples above years before when interior turrets had 800m range. It is just a regular (albeit subpar) turret now.

"detects enemies / allies"

For clarity, turrets only detect what they shoot at. If you want to detect allies, you should use a custom turret controller as a designator.

"can i use the custom turret as the designator"

As in a custom turret controller? Yes, that will work with this script.
Cpt.Krinkov 7 月 30 日 下午 10:22 
if the designator cannot see the target but my slaved AI turrets can, will they still shoot?

i notice it seems u use interior turrets as designators, does the interior turrets range effect how it detects enemies / allies for the slaved turrets?

also does this stop ur turrets from shooting ur own ship or only ally ships?

i have a strange multi turret set up on top of my ship. (big grid) 1 assault cannon, 2 chain guns, 2 missile turrets, 1 custom turret. can i use the custom turret as the designator or would it be more viable to use an interior turret for each of my AI guns and for the custom
Whiplash141  [作者] 7 月 26 日 下午 10:04 
each turret group can share the same designator without issue, yes.

what issue are you having?
Slatex 7 月 24 日 上午 11:05 
hey man nice script! sorry to bother but i cant find the answer, each rotor turret group need to have their own designator? im trying to make several customs turrets using 1 designator but i cant manage to make it work
Whiplash141  [作者] 7 月 15 日 下午 9:01 
Without any details I cant help you.
Cmdr. Chicken 7 月 15 日 下午 5:39 
on this since literally 5h now its 4am i cant get a single turret to work...
Whiplash141  [作者] 5 月 18 日 上午 5:57 
no it will not
KAD65 5 月 7 日 下午 11:19 
will this help ai turrets aiming leading and tracking without setting up a designator ?
LeoBlackburne 1 月 29 日 下午 12:22 
Gotcha, thank you!
Whiplash141  [作者] 1 月 29 日 下午 12:04 
it needs to be in the group.
LeoBlackburne 1 月 29 日 上午 11:02 
It isn't in the group and I am using the Assault Weapons Pack without Weaponcore
Whiplash141  [作者] 1 月 27 日 下午 3:07 
(1) Is it in the turret group and (2) are you using weapon core?
LeoBlackburne 1 月 27 日 下午 1:36 
I'm having issues with the script acknowledging a designator turret. I've added Designator to the name of one, but it continues to not see it
Whiplash141  [作者] 1 月 13 日 下午 12:23 
Yes it still works.
Jon Kirk 1 月 12 日 下午 8:43 
Does this scrip still work?
I've never been able to get it to work, it sees custom turrets fine but it never finds the Designators.
Lathy...or is it 2024 年 11 月 17 日 上午 2:34 
Is there a guide that explains the settings in Custom Data? I don't understand what they do ^^;
~Ari~ 2024 年 11 月 12 日 下午 9:11 
I don't know if it would be ideal to add as a feature for this script or to make it its own independent script but I currently have a ship that doesn't have a need for turret slaving but I would like this script simply for the purpose of making turrets avoid shooting through the ship and its subgrids. Is there a way to make this work without needing a slaved vanilla turret?
bucket 2024 年 11 月 7 日 下午 10:07 
The programmable block is spitting out an error for both turret groups where it isn't recognizing the traverse or elevator and saying,
"Unsorted rotor(s) found:
"2 traverse"
"2 elevator"
Checked ownership as per brought up by the other comment on this issue, it's all mine. How do i fix this?
Whiplash141  [作者] 2024 年 10 月 17 日 上午 9:28 
if said camera is controlled by a CTC that is marked as a designator, yes
e_sd 2024 年 10 月 17 日 上午 9:24 
Does this script work with a camera designator instead of a turret designator?
HS_DRAGON ✞ 2024 年 9 月 30 日 上午 10:29 
Hello. I didn't quite understand how this Script works; For this script to work, do you need to put guns on rotors/hinges?
I just want my guns to stop shooting at my own buildings, what do I need to do?
jperk354 2024 年 9 月 12 日 下午 7:10 
OK, testing on both ship and static grid, when controlling the designator, it seems to lose gravity calculations. When the designator is using its AI, it seems to have gravity calculations
Whiplash141  [作者] 2024 年 9 月 12 日 上午 2:18 
It is a multiplier of whatever the current gravity value is. The script attempts to find a ship controller somewhere on your ship to use to read the gravity value.
jperk354 2024 年 9 月 11 日 下午 7:54 
Yep, standard earthlike. Is the gravity mod function a multiplier of "1" gravity, m/s, or something else
Whiplash141  [作者] 2024 年 9 月 10 日 下午 10:46 
Dumb question: are you in natural gravity?
jperk354 2024 年 9 月 10 日 下午 9:35 
Edit: when manually controlling the director
jperk354 2024 年 9 月 10 日 下午 9:25 
Hey Whip, it's looking like the gravity mod option in the custom data isn't doing anything right now. I've set it from -10 to 5000, and all the shots are dropping the same
phoenix 2024 年 9 月 4 日 下午 1:18 
@Whiplash141 I've tried several different setups but yet whenever I see if the friendly fire is working it always shoots through my ships and never registers any friendly at all maybe one tower of six will recognize a friendly but they're all set up the same way
Whiplash141  [作者] 2024 年 8 月 27 日 下午 6:05 
You are adding the weapon to the toolbar right? If so, the only workaround is to hold the crouch key (C by default) to fire, or have a manual toggle on the toolbar for a group of guns that only includes what you want.

Alternatively, you can use TCES in conjunction with custom turret controllers to control your turrets. That way you get the turret stabilization and rest angle behavior of MART with the AI targeting potential provided by the turret controller itself. Also turret controllers have special code to only fire the turret you are actively controlling that MART simply doesn't have access to.
MARHWIN 2024 年 8 月 27 日 上午 11:01 
@Whiplash141 Okay, I've changed it to "false". Thanks
And about the second thing. When I fire MART (rear) turret, the other (underbelly) fires aswell. Could this be helped?
Whiplash141  [作者] 2024 年 8 月 24 日 下午 1:12 
It does shoot, it is just the friendly fire avoidance is stopping it from firing in many instances because of the turret being recessed into the surrounding blocks. You can disable friendly fire avoidance in the custom data of the turret slaving programmable block:

Change "- Avoid friendly fire (own ship)" to false.

Also I noticed that you changed the nametags for both MART and the turret slaving script to be the exact names of their respective turrets. Just be aware that if you want to have more turrets controlled by MART or the turret slaving script, all additional turrets will require that full name tag in their names to be registered by either script (which could end up clunky)
MARHWIN 2024 年 8 月 24 日 上午 3:28 
@Whiplash141 No, they're grouped separately.
I've post the skeletized debug version of the problematic build:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3315988361
Whiplash141  [作者] 2024 年 8 月 23 日 下午 1:02 
Did you group a MART turret with a rotor turret controlled via this script?
MARHWIN 2024 年 8 月 22 日 上午 7:51 
Must have messed something, I have two gatling turrets but they behave oddly:

1st is on this script [Gun, 2 Rotors, Designator];
When I'm in direct control it fires only rounds for the designator.
Designator mod: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2325483917

2nd is on MART [Gun, 2 Rotors, Camera, Seat];
For it to fire i need to drag gatling gun to shortcut bar, when I fire, both turrets fire.
Valdar 2024 年 8 月 17 日 上午 6:33 
Thank you so much, now I can pretend I am in outlands :)
KraziYeti 2024 年 7 月 22 日 下午 10:25 
I knew it was right in front of me! LOL! IMy brain just kept looking in the custom data of the Programmable Block. Great mod and thank you for the quick reply.
Whiplash141  [作者] 2024 年 7 月 22 日 下午 6:48 
check the custom data of the rotors themselves
KraziYeti 2024 年 7 月 22 日 下午 12:46 
Hi Whiplash, apologies if this is right in front of me but I can't see it. I'm using custom turrets and i've got it all working with turret groups and designators etc. But I want to set the rest angle and I spotted your comment "You can set rotor/hinge rest positions in the custom data of the rotors/hinges once the code has finished registering your turrets." So I've run the setup argument and recompile multiple times but the Custom Data is not showing any parameters that look like I can set rest angle etc. There's two about rest but they are rest speed and rest delay. Any help is really appreciated.
Black_Overlord 2024 年 7 月 19 日 上午 7:07 
Thank you, thats all i wanted to know
Whiplash141  [作者] 2024 年 7 月 18 日 下午 7:44 
Yes. Add "Designator" to the name of the custom turret controller and add it to the Turret Group as if it were an AI turret. It should work the same. You will not; however, be able to manually fire the slaved turrets with that CTC since there are no weapons to read the status of.
Black_Overlord 2024 年 7 月 18 日 下午 1:00 
Can i (if yes - how?) use custom turret with just camera (with a vanilla custom turret controller) as a designator?
Whiplash141  [作者] 2024 年 6 月 8 日 下午 9:07 
Default meaning unowned or owned by you? If unowned, make sure everything is owned by you
aBunningssnagwithonionsplease 2024 年 6 月 8 日 下午 8:27 
Ownership is default, at the moment I'm building the turret as a separate grid so the only rotors and hinges should be on the turret I'm trying to script.
Whiplash141  [作者] 2024 年 6 月 8 日 上午 7:31 
are you using the rotors from the correct turret and is ownership correct?
aBunningssnagwithonionsplease 2024 年 6 月 8 日 上午 5:07 
Hey! I swear you've helped me with this issue before, and I've even got my other turret next to my current build at the moment pulling my hair out trying to replicate it. Really sorry to bother you again.

Can't seem to get the script to recognise the left right rotor, up down hinge, or the weapons

Turret Summary:
1 rotor turret group(s) found

Error 1:
No weapons, tools, lights or
cameras found

Error 2:
No base rotor found

Error 3:
No secondary rotor(s) found

Warning 1:
Unsorted rotor(s) found:
- "Turret Pan"
- "Turret Tilt"

I have weapons, a rotor and a hinge in this turret group.
Whiplash141  [作者] 2024 年 5 月 9 日 上午 11:54 
It does still work, yes :)