Space Engineers

Space Engineers

[Archive] Rdav's Turret-Tracking-Script
280 Comments
Darkness Overlord 28 Oct, 2018 @ 9:46am 
Why rotor with sensor, armor block and gun reverce on 360X[unlimited]? He crash weapon =/
Avelius 25 Apr, 2018 @ 7:50am 
The script doesn't seem to work on small grids.
Avelius 25 Apr, 2018 @ 7:17am 
Ok turret moves now (had called the gat turret "Designator" instead of "Director". But turret still spins wrong and seems reversed.
Avelius 25 Apr, 2018 @ 5:18am 
Script set-up was successful but the turret does not move at all, I've set everything up correctly, checked everything 3 times. Could you please help me?
Avelius 27 Dec, 2017 @ 1:45pm 
@Hellfire Yes I know ;) I was just looking for a script, which would make rotor based turrets completely to AI turrets without any director turret to rely on. But thanks for the help man ;D I appreciate it.
Saticron 27 Dec, 2017 @ 12:16pm 
@[A.G.I.] ◥ ARSTALUS ◤ there is also the MART script if you wont want the turret director

(it helps greatly with tanks)
Rdav  [author] 27 Dec, 2017 @ 9:36am 
yup
Avelius 27 Dec, 2017 @ 7:16am 
Do you need that Turret Director at ALL times?
Saticron 2 Dec, 2017 @ 1:41pm 
does it just fire when you aim at something or does it shoot when the turret shoots?
JudgeHenryAllenLaidermilk 16 Sep, 2017 @ 12:07pm 
Hey Rdav love all your stuff man, have a question about alternate usage for this. Instead of having this script fire a gun, is there a way to have it trigger another specific timer block instead? would love to use this for long range detection and triggering of other defences. thanks.
tunamansquare 27 Jun, 2017 @ 9:05am 
found the problem
Rdav  [author] 27 Jun, 2017 @ 8:19am 
@Afockewulf a) did you read the troubleshooting flowchart? B) this code was superseded by my EZ turret AI code, that's a lot more user friendly to setup, and more powerful,

However if you're keen on a one p-block to rule them all code I'd check out Whiplash 141's workshop, he made a turret code very similar to this,
tunamansquare 27 Jun, 2017 @ 7:22am 
i did everything and it just spins
Kalec84 1 Jun, 2017 @ 2:46pm 
Anyone alse having it not working any more after the last patch?
Kalec84 28 May, 2017 @ 7:40am 
I'm trying to load the script (double click on the list in the programmable block menu) but it didn't work... is like there is no script
Postwar Vandal 7 Apr, 2017 @ 6:30am 
I've been playing around with the script, it's good fun. But it got me thinking that it would be cool to have a script that can track a friendly ship. that way you could have a spotlight following ships when they're coming into dock. Is there a way to adapt this scrip for such usage?
Hirodripto.rl 11 Feb, 2017 @ 1:29am 
V Theres a new script......
FцllSїzёd 10 Feb, 2017 @ 7:15pm 
...When it does actually shoot in the general direction of the target that the director turret is shooting at it usually fires several shots at the target then both turrets for some reason snap back to their default home positions and fire a few shots there before returning to the actual enemy target. The director turret fires straight at the nearby enemy target non stop unless the script is running. Which suggest its return to home position is some side effect of the script.

I have check and rechecked everything in the set up many time and still it wont work. I have tested extensively both on dedicated server and in solo games.
FцllSїzёd 10 Feb, 2017 @ 7:15pm 
I can't get this to work. Ive been trying for hours. In rare occasions it actually shoots in the direction of the Director turret but its offset by several blocks usually resulting in a complete miss of the target. Even then I can copy and paste the platform and the new one may or may not work.

MOST of the time after I get everything set up the script completely ignores preset rotor limits and almost immediately upon startup rotates both rotors at max speed until everything breaks into tiny pieces.

Hirodripto.rl 23 Jan, 2017 @ 8:35am 
V Follow the new versions tutorial exactly.
Stevros1903 22 Jan, 2017 @ 3:19pm 
Hay is this script still alive or completely replaced with new version as i cant seem to get this to work right always turns the AZ rotor 180 degrees from where i would expect. Would use new version but tried that and it only decided to use 1 the EL rotors and rocket systems not both??
Anyone with any ideas on either i would be very great full.
Hirodripto.rl 18 Jan, 2017 @ 6:07am 
Theres a new version of this! HIP HIP! HORRAY!!!!!!!!!!!!!!!!!! (Published in a different publish)
Stevros1903 17 Jan, 2017 @ 11:29am 
And sorry also is there any way to set up 2 instances of this code so i could say have one director for my right battery one for my left and 1 for my front?
Stevros1903 17 Jan, 2017 @ 11:15am 
Sorry Any way to have this trigger a grinder?? and or a timer so i can use it with a gravity turret?
delta07™ 27 Dec, 2016 @ 5:07am 
great idea but its just as deadly to you as it is to the enemy (provided you are not careful)
Hirodripto.rl 25 Dec, 2016 @ 7:36am 
DESC: Directing any vanilla or modded turret blocks is easy, simply change the names of any turrets you want to direct 'DIRECTED_TURRETS' and the script will aim them and fire them automatically - Your question @Yendor Mosreh has been answered.
YENDOR MOSREH 24 Dec, 2016 @ 11:40pm 
i can do this with just the sensors but they are hit and miss they stagger around like a drunk at the toilet pointing all around the bowl it ends you pointing at the target affter a few stumbles
YENDOR MOSREH 24 Dec, 2016 @ 11:35pm 
can this be used on a ships gyros to point the ship at the target ( and dose it have to be a interior turret can we use a normal turret since small ships dont use the internal turret
Hector 24 Dec, 2016 @ 3:53pm 
Do you think it would be possible to make a staggered rotation speed, so that if the turret is within a few degrees of its desired alignment, it turns slower? This would probably help a lot with heavier turrets.

Also, including an option for staggered fire would help turrets equipped with, for example, the CSD Battlecannon or weapons of comparable recoil to deal with said recoil.
Hector 24 Dec, 2016 @ 3:43pm 
Does this script only point the turret in the same azimuth and elevation as the director or does it take into account that turret and director will be a slight bit apart?
Whatever 28 Nov, 2016 @ 12:21am 
Probably a bit late here but: If you turn of DIRECTOR's idle movement the turret group just goes frenzy with movement. While the script is active you are unalbe to enable DIRECTOR'S idle movement. Just raising your awareness.
Hirodripto.rl 18 Nov, 2016 @ 10:28am 
What if i wanted not all the turrets to use the same DIRECTOR, Do i do like DIRECTOR 2 and so on?
TEMPO 2 Oct, 2016 @ 2:27am 
similar script is not what works?
Rdav  [author] 1 Oct, 2016 @ 9:18am 
@TEMPO
Should do, It's been updated and tested in both dev and stable now
TEMPO 1 Oct, 2016 @ 7:43am 
It still works?
Lord Wraith SOL3 24 Sep, 2016 @ 4:16am 
@Rdav did not know the script turned off the idle settings, so that solves that problem, next will retry with different setting on the targetting, will do this in an empty world and let you know...
ADM.i.RAL 24 Sep, 2016 @ 4:15am 
I have no problems
Rdav  [author] 24 Sep, 2016 @ 4:12am 
@Lord Wraith
If the director turret isn't tracking it might be something to do with the director turrets targeting settings, the script itself automatically turns off idle rotation, but does not set targetting settings. does the director not track anything at all?
Lord Wraith SOL3 22 Sep, 2016 @ 7:28pm 
Sorry to tell you this bud, but just tested the system and the turret will not move, just sits there even when a enermy comes around, ran the updated script and followed the instructions for set up, but when i completed it the Director simply went to a fixed forward posistion and i could not reset it into idel movement after that, also would not track a enermy ship, hope you can help:steamsad:
Rdav  [author] 22 Sep, 2016 @ 11:30am 
@Kopin
Afraid so!, That is at least, until some more of the DEV branch ingame-API gets put into the Stable branch, then I'll be a ble to monitor if a player is clicking or not.
ADM.i.RAL 22 Sep, 2016 @ 11:21am 
Weapon on turret shoots without click ,when control DIRECTOR, is it normal?
Rdav  [author] 22 Sep, 2016 @ 10:57am 
@Lord Wraith [DSN] + [MGE]LeonserGT
Script has been updated to fix the issues, once again the script is fully functional!
Lord Wraith SOL3 21 Sep, 2016 @ 5:06pm 
Sorry to say that i have tested this mod in both stable and dev, and i also keep getting the same error code when i try to compile it, hope you fix it soon....:steamfacepalm:
Rdav  [author] 17 Sep, 2016 @ 5:41am 
Didn't realise it was broken, yeah I'll give it some wel deserved love and care soon as I get a free moment, thanks for informing!
LeonserGT 17 Sep, 2016 @ 4:43am 
Hey Rdav, now PB changes merged to stable as well, script is totally not working now. Any plans for fixing?
drandarith 25 Aug, 2016 @ 9:35pm 
Ok. well I'll wait for the patch. Thanks though..
Rdav  [author] 25 Aug, 2016 @ 9:38am 
@dradndarith,
This is a bug introduced with the latest patch of stable-branch SE, as soon as I can get some time I will release a patch, in the meantime try switching between stable and dev branches and see if the problem appears in both, I believe it stll works in one branch,
drandarith 25 Aug, 2016 @ 1:55am 
Recap... I think I know the error.. the Turret (group) needs to be designated by a group name in block terminal. right? What prefix does it use?
drandarith 25 Aug, 2016 @ 12:20am 
When checking code for compilation I get this error: program(137,35): Error: 'IMyBlockGroup' Does not contain a definition for 'Blocks' and no extensions methos 'Blocks' accepting a first argument of type 'IMyBlockGroup' could be found (are you missing a using directive or an assembly refference?) ... I have NO idea how to fix this....
MrEvan312 15 Aug, 2016 @ 1:02am 
Will this allow me to position Orbital Defense platforms with fixed guns so they will turn and fire the main gun at approaching enemies?