Space Engineers

Space Engineers

108 个评价
Turret Alarm v2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
532.012 KB
2020 年 10 月 8 日 上午 10:03
2023 年 7 月 15 日 上午 10:05
28 项改动说明 ( 查看 )

订阅以下载
Turret Alarm v2

描述
A small script that turns your turrets into an automatic alarm that trigger if an enemy is detected or its loss
Can be used both in vanilla and with WeaponCore


Update 2023.2.1
Now script can work with one trigger setup
Added "error" to script status options


Notes
Automatic updating of blocks starts approximately every 6 seconds (at the moment, the update depends on the game ticks directly) and allows you to change the blocks used and tracked by the script without manually restarting it. To disable this function, the script has a special switch in the parameters section.

For the convenience of tracking the status of the script, it is now possible to display its information on the LCD panel. To do this, add the prefix [TA LCD] to the required panel. If you want to display information on a specific panel in a block with multiple LCD's, then you need to add a prefix with the panel number in the list of block panels. For example, to display script state on the right monitor of Control Seat, you will need to add the following prefix to the block: "[TA LCD][2]"

MeshMode - now you can set the 3 different modes to the script: 0 - default (default TurretAlarm behavior), 1 - Tower (checking the turrets and sending updates to the base) and 2 - Base (receiving the messages from any grids via antennas or laser signal and start/stop the triggers)
For using MeshMode just change the parameter in the script or CustomData (0-3) and set up unique broadcast tag.

WC threats mode is a new method of obtaining enemy grids. This mode ensure that you will detect threats with any WC blocks. This mode can be useful on grids with a significant number of weapons as it works more optimized that original vanilla method. Caution, you cannot use WC threats mode and the mode of operation with certain turrets ("turretsTag") at the same time. WC threats will have the highest priority!

Hybrid turrets list allows now not to worry about switching between vanilla and weaponcore modes. Now you can use both types of turrets on your grid.
And because of that, now the Vanilla mode, WC mode and override mode is deprecated and removed from the script

SETUP
1) Place on your grid turrets
2) Place on your grid 2 Timer blocks
3) Name timer blocks as "DetectionTrigger" and/or "LostTrigger" (You can change it's names in the script)
4) Place programmable block and paste this script in it
5) Set up your timer blocks as you wish

OPTIONAL STEPS
1) Enable delay (Set "detectionTriggerDelay" and/or "lostTriggerDelay" as true) and set the required time in the script ("detectionTriggerDelayTime" and "lostTriggerDelayTime". letter 'F' MUST be at the end)
2) Add a prefix [TA LCD] to the required LCD panels to display the script state
3) Specify the tag you need so that the script only works with certain turrets (Change "turretsTag")
4) Set 'searchInGrids' to 1 if you want use turrets from subgrids
5) Add "Run" command on the button panel and/or control seats with one of the following arguments:
a) "refresh" - script will refresh list of used blocks
b) "refresh switch" - disable or enable auto block refresh
c) "switch lcd" - disable or enable the use of LCDs by the script

Thanks to:
Sigmund Froid and his api guide for WeaponCore
Xaker_Two for testing and contribution in some features
Chuckination for contribution in WC threats mode

Updates:
dd/mm/yy
22/02/22: Major Update 2022.1.4
23/02/22: Minor Update 2022.1.5

Warning
100% functioning of the script is not guaranteed due to the use of the WeaponCore API, which may change from time to time, but is pursued as the final goal.

When using groups of turrets with tags, make sure that there are no other blocks in the group other than the turrets. Currently, the search for blocks in groups is not supported

Problems?
If you have any problems with the script, please write to the Troubleshooting discussion.

Want to be on the edge of news and see what other will not? Join the OPC discord! https://discord.gg/zZHAccYpzV
If you want to support me, I now have a Patreon page[www.patreon.com]
热门讨论 查看全部(1)
24
2023 年 9 月 14 日 下午 2:48
置顶: Troubleshooting
Foltast
148 条留言
Foltast  [作者] 2024 年 10 月 2 日 上午 7:19 
AFAIK there is no API for searchlights, so no
Creamy Catboy 2024 年 10 月 2 日 上午 3:29 
Is there anyway to use Searchlights instead of turrets?
<#27ac8f>0micron 2023 年 9 月 23 日 上午 11:15 
Thanks very much!
Foltast  [作者] 2023 年 9 月 23 日 上午 10:40 
Yep, turrets should be on for the script
With this script there is no other way to detect, no
<#27ac8f>0micron 2023 年 9 月 23 日 上午 9:19 
This may be a dumb question but the turrets have to be on for this script to work correct? Is there a way for this script to detect enemies before turrets begin firing at them?
Kham 2023 年 7 月 16 日 上午 7:57 
@Sir Connery in the Custom Data for the PB you can change the name of the timers it's looking for so you could name them however you want.
Kham 2023 年 7 月 16 日 上午 7:53 
@Foltast thanks man, I'll check it out! :)
Sir Connery 2023 年 7 月 16 日 上午 4:46 
A small non-essential request. The timer block has to be named TriggerDetect. If it was possible to just have blocks including the name for example. Timer TriggerDetect. So I could keep using my naming conventions for everything. Same for the LCD.

I can live without it, but it would declutter my Control Panel and having every Timer in the same place is a comfort in a game with 100s of functional blocks.
Sir Connery 2023 年 7 月 16 日 上午 4:46 
Just letting you know this is an essential script for me. Good work.

I can trigger my whole base defence setup with it when the Turrets detect an enemy. Lights, choppers launching to defend with the automation blocks etc.
Foltast  [作者] 2023 年 7 月 15 日 上午 10:05 
Should be done :)