Space Engineers

Space Engineers

Whip's Turret AI Slaving Script
2.481 kommentarer
Whiplash141  [ophavsmand] 15. juli kl. 21:01 
Without any details I cant help you.
Cmdr. Chicken 15. juli kl. 17:39 
on this since literally 5h now its 4am i cant get a single turret to work...
Whiplash141  [ophavsmand] 18. maj kl. 5:57 
no it will not
KAD65 7. maj kl. 23:19 
will this help ai turrets aiming leading and tracking without setting up a designator ?
LeoBlackburne 29. jan. kl. 12:22 
Gotcha, thank you!
Whiplash141  [ophavsmand] 29. jan. kl. 12:04 
it needs to be in the group.
LeoBlackburne 29. jan. kl. 11:02 
It isn't in the group and I am using the Assault Weapons Pack without Weaponcore
Whiplash141  [ophavsmand] 27. jan. kl. 15:07 
(1) Is it in the turret group and (2) are you using weapon core?
LeoBlackburne 27. jan. kl. 13: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  [ophavsmand] 13. jan. kl. 12:23 
Yes it still works.
Jon Kirk 12. jan. kl. 20: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 17. nov. 2024 kl. 2:34 
Is there a guide that explains the settings in Custom Data? I don't understand what they do ^^;
~Ari~ 12. nov. 2024 kl. 21: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 7. nov. 2024 kl. 22: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  [ophavsmand] 17. okt. 2024 kl. 9:28 
if said camera is controlled by a CTC that is marked as a designator, yes
e_sd 17. okt. 2024 kl. 9:24 
Does this script work with a camera designator instead of a turret designator?
HS_DRAGON ✞ 30. sep. 2024 kl. 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 12. sep. 2024 kl. 19: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  [ophavsmand] 12. sep. 2024 kl. 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 11. sep. 2024 kl. 19:54 
Yep, standard earthlike. Is the gravity mod function a multiplier of "1" gravity, m/s, or something else
Whiplash141  [ophavsmand] 10. sep. 2024 kl. 22:46 
Dumb question: are you in natural gravity?
jperk354 10. sep. 2024 kl. 21:35 
Edit: when manually controlling the director
jperk354 10. sep. 2024 kl. 21: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 4. sep. 2024 kl. 13: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  [ophavsmand] 27. aug. 2024 kl. 18: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 27. aug. 2024 kl. 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  [ophavsmand] 24. aug. 2024 kl. 13: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 24. aug. 2024 kl. 3:28 
@Whiplash141 No, they're grouped separately.
I've post the skeletized debug version of the problematic build:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3315988361
Whiplash141  [ophavsmand] 23. aug. 2024 kl. 13:02 
Did you group a MART turret with a rotor turret controlled via this script?
MARHWIN 22. aug. 2024 kl. 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://steamhost.cn/steamcommunity_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.
Acherion 17. aug. 2024 kl. 6:33 
Thank you so much, now I can pretend I am in outlands :)
KraziYeti 22. juli 2024 kl. 22: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  [ophavsmand] 22. juli 2024 kl. 18:48 
check the custom data of the rotors themselves
KraziYeti 22. juli 2024 kl. 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 19. juli 2024 kl. 7:07 
Thank you, thats all i wanted to know
Whiplash141  [ophavsmand] 18. juli 2024 kl. 19: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 18. juli 2024 kl. 13:00 
Can i (if yes - how?) use custom turret with just camera (with a vanilla custom turret controller) as a designator?
Whiplash141  [ophavsmand] 8. juni 2024 kl. 21:07 
Default meaning unowned or owned by you? If unowned, make sure everything is owned by you
aBunningssnagwithonionsplease 8. juni 2024 kl. 20: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  [ophavsmand] 8. juni 2024 kl. 7:31 
are you using the rotors from the correct turret and is ownership correct?
aBunningssnagwithonionsplease 8. juni 2024 kl. 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  [ophavsmand] 9. maj 2024 kl. 11:54 
It does still work, yes :)
Cthulhu 9. maj 2024 kl. 11:30 
Hello there,
quick Question, does die AI turret slaving Part still work? I need it so the turrets stop blasting my plane wings. Thx
Whiplash141  [ophavsmand] 4. maj 2024 kl. 20:30 
No, I kind of retired this script with the advent of the custom turret controller and my subsequent script TCES
Layzanya 4. maj 2024 kl. 6:27 
Since I haven't seen any posts or comments about it, is there a way to make this communicate with MART?
Whiplash141  [ophavsmand] 25. apr. 2024 kl. 23:11 
That indicates that the script does not see a rotor base on the same grid as the rotor head of another.

Have a screenshot or blueprint of your turret? Your turret should look like one of the example turrets as pictured in "Rotor Turret Group Setup"
25iceking20020 25. apr. 2024 kl. 22:42 
So im building a ship that has some guns underneath. the guns are connected by conveyor to a hinge then rotor but it says no guns are available and no secondary rotor. Any idea why?
Whiplash141  [ophavsmand] 16. apr. 2024 kl. 8:17 
no
Manshima 16. apr. 2024 kl. 5:05 
This is the behavior I would like: Reaver spawns in at 5km away and moves toward my station. I take control of a search light to find it and 'paint' the target. All of my station turrets (vanilla turrets, not custom) aim at the reaver that I have in my sights and fire as soon as the ship gets into range.

Currently my turrets won't fire until they have turned towards the ship, and they won't start moving until the ship gets into range. Will this script allow them to be slaved to my searchlight?
Whiplash141  [ophavsmand] 7. mar. 2024 kl. 11:20 
This script has an collision detection algorithm that attempts to check if there is any grid based occlusion. It is not perfect, but it should be a bit more conservative than the CTC checks.