Space Engineers

Space Engineers

43 ratings
Enemy Detection Script - Turret Triggers Timer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
1.527 KB
26 Dec, 2018 @ 2:19am
1 Change Note ( view )

Subscribe to download
Enemy Detection Script - Turret Triggers Timer

Description
This is a simple script which triggers a timer block when a turret detects an enemy.

-Rename the timer block to "Timer Block - EnDec" (without quotation marks) or change the name to whatever you want as indicated in the code.

-Rename a turret to "DetectorTurret" (without quotation marks) or change the name to whatever you want as indicated in the code.
20 Comments
Unruly 6 Oct, 2023 @ 8:07am 
Right. It checks for blocks named correctly. But it crashes with an exception if it doesn't find both blocks named correctly. That's all I was saying to Seth, now long gone..

Also, using a ctc only lets you detect from block weapons. I want to include detection from turrets.

Thank you for sharing your bps/mods, btw.
DaddyDamo  [author] 6 Oct, 2023 @ 12:43am 
the code doesnt do anything besides check if a turret which is currently named whatever is in the code has detected something, and if it has, trigger a timer block. dont know why people are still using this script, its obsolete with the new turret controller block.
Unruly 5 Oct, 2023 @ 12:02pm 
Hey Seth, it's been quite a while, but I'm sure the problem you were having is because you hadn't yet named both a timer block and a turret.
The code SHOULD detect when that's the case, but it doesn't.
Seth Stone 3 Jan, 2021 @ 12:53pm 
Looks like its broken to me, also getting an error when i try to use
AngelMarc 22 Oct, 2020 @ 4:24am 
Mata52 31 Jul, 2020 @ 9:34am 
Nice script. Is it somehow possible to make a grid that detects an enemy (with that turret) send commands to another grid (like a base)? As far as I know the timer block cannot be set to give commands to other grids automatically but maybe there is a different script for that or some magical way?
Scrap 8 Jan, 2020 @ 2:40pm 
I have an error when trying to use.
wyqydsyq 30 Nov, 2019 @ 12:06am 
@Hage Maoh set the timer block to rerun/recompile the PB running this script at the end of its action sequence
Hage Maoh 2 Sep, 2019 @ 3:28pm 
Really needs some way to reset, or a cooldown between detection events. Seems like the turret detects once, and then the whole setup needs to be taken down and rebuilt
Thunderous Broadside 30 Aug, 2019 @ 8:35pm 
"EnDec" wouldn't happen to be an Encoder Decoder, would it?