Barotrauma

Barotrauma

Not enough ratings
Periscope-Turret Auto Switching System
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
291.950 KB
2 Apr, 2022 @ 4:02am
2 Apr, 2022 @ 5:31am
2 Change Notes ( view )

Subscribe to download
Periscope-Turret Auto Switching System

Description
Route the periscope to the turret where having contact automatically!

系统功能
System Function

和已有mod不同,此系统并非通过炮塔角度决定将当前潜望镜切换到哪个炮塔,而是根据运动传感器感应敌人,并将潜望镜切换到有敌人方向的炮塔上
Different from existing famous mod, this one does not switch the turret connect to current periscope by its angle, but detect enemy by motion sensor, then switch periscope to the turret where its direction having enemy.

此系统仍然具有一定的缺陷(比如,只能在两个炮塔之间切换)和开发潜力,这将在后面进行讨论,但目前效果仍具备一定的功能性和较强的可用性。尤其是,如果上下各有2门线圈炮,当你忙于其他事务的时候只需要两个NPC炮手而不是4个
Although the system having some defect (for example, can only switch between two turrets) and developing potential, which will be discussed later, current status having enough function and worked well. When you have 2 coilgun on each side of top and bottom, you need only 2 NPC gunner instead of 4 now.

工作模式:以一个潜望镜控制船首一上一下两个炮塔为例。当两侧其一传感器捕捉到敌人时,潜望镜强制连接到有敌人一侧的炮塔,手动切换不可用。当两侧都没有敌人或者都有时,自动切换不工作并允许手动切换(是的就是XOR)这个逻辑满足无需手动控制时的自动切换,同时也可以在优先集火或者观察矿物时手动控制朝向
Function: Use the example that one periscope control two turret on top and bottom in front of a ship. When motion sensor on EITHER side found monster, periscope will be connected to the turret where there is enemy, manually switching does not work. When BOTH side have or have no monster, auto-switching does not work and manual control enabled (XOR logic). This logic fulfill the need that when you engaging enemy and have no time for manual control or running between different scopes, and also when you want to observe minerals outside on a specific side.

什么?为什么两侧都有的时候不切换?对啊你把一侧的打完它就自动切到另一侧了
What? Why auto-switching does not work when both side having contact? Yes when you killed every monster on one side it will switch to the other side.

内容:
Contents:

Auto Turret Switching System (Assemble)
== 主要内容,显示在物品组合中,便于安装
== Main content, shown in item assemble, easy to install on your ship

Auto Turret Switching System Example (submarine)
== 安装范例,可用于在编辑器中测试效果(或者直接用来玩),你可以活用F3控制台刷怪来测试
== Install example for u to test in editor (or play), use F3 console (if you don't know yet) to spawn monster and test the function

安装说明
How to install

安装工作很简单,只需要把组合中的一套东西拿出来并给线圈炮接电,然后调整传感器位置即可。
Install is simple, just pick the system out of item assemble, connect coilgun to power and adjust the position of motion sensor.

需要注意的是, 如果两个炮塔一上一下在船头具有重合的有效范围,请务必也将传感器范围重合一部分。否则怪物在两个区域内左右横跳会导致炮塔上下疯狂切换
Note: if two turret having overlapped controlling area, make sure the motion sensor also have same overlap. Or it will switching like mad when monster jumping between two sensor area.

系统原理说明
How it work

本部分介绍系统电路元件中各个部分的功能以便你在此基础上添加或改进功能(类似代码注释)
This section introduce the function of all parts, check it out when you would like to add or improve some function of the system. (like the comment of code)

如图所示:
As the pic. of this mod shows:

1. 系统总开关
1. System switch

控制切换系统的开关,可以同时连接多个系统块,字面意思,关闭时无论如何都不会自动切换
Controls the switching system, can connect to multiple system block. Like its name, when it's off, auto switching will not happen anyway.

2. 当前系统控制
2. Current System Control

决定当前块在什么时候进行自动控制。
Decide when this auto control block is functional

XOR,AND:
仅当两侧之一接敌,且总开关打开时,自动控制可用,传感器信号被向前传递。上侧信号为1,下侧为0(NOT),通过两条不同的线连接到下一级
Only when EITHER side contact, AND system switch on, the auto switching is functional, and the signal from sensor passed to next layer. Top is 1, bottom is 0(NOT), relayed to next layer by two different cable.


3. 防错误复位
3. Anti false reset

由于传感器本来连接到一个敌袭方向指示灯,所以当不再有怪物时会输出一个0信号(不然灯会一直亮着)。然后这个信号会在怪物死亡或者离开感应范围时立即将潜望镜接到反方向的一侧。于是添加了一个信号检查模块,过滤掉这个警报解除的信号
Since the sensor originally connect to a contact direction indicating light, so when there is no monster, it output a False signal (or the light will never off). This signal will switch the turret to the opposite side. Thus these SGN was added to filter out this signal.

4. 潜望镜连接切换
4. Scope Switching Relay

潜望镜的输出同时接到两个继电器的输入,继电器输出到两个炮塔。同时两个继电器直接通过一个NOT模块连接其状态,即其中之一打开或关闭时,另一个会执行相反的动作。
Scope's output connect to input of two relay, relay output to two turrets. While two relay's status connected by NOT block. When the one on the left turned on or off, the other one does the opposite.

5.指示灯与手动开关
5. Indicator and manual switch

字面意思
As it's name says.
Popular Discussions View All (1)
0
2 Apr, 2022 @ 5:00am
Question or Bug
AsunoHikari
11 Comments
AsunoHikari  [author] 6 May, 2023 @ 8:39pm 
【可以不能】是什么东西啦……总之切换炮塔和AI没关系,炮塔的切换是通过位移传感器自动执行的,潜望镜上有没有人是不是人它都会自己切。如果没切就是系统接的有问题,切了AI不开火要么没看见要么AI有问题。然后你喊他去哪个炮塔他都会上那一个潜望镜。实在不行你图纸传创意工坊吧我有空了看看什么情况
tp664066 6 May, 2023 @ 7:46pm 
例如我把ai設定成前砲塔 在後砲塔生成怪 這樣好像就可以不能
tp664066 6 May, 2023 @ 7:44pm 
您好 那請問你ai有設定它更換砲塔嗎
AsunoHikari  [author] 6 May, 2023 @ 6:37am 
我刚去测了一下安装范例,是没问题的。理论上AI看到敌人就能开炮,那我只能假定你的AI没有看到敌人,至于他为什么没看到……那我也猜不出。可能有用的排障流程如下1.确保总开关打开即拉杆在下方。2.上潜望镜看看是前还是后。3.按下“手动开关”即切换按钮观察是否切换到另一个炮塔。4.确保你没有漏接位移传感器且位移传感器的范围足够囊括武器射界。5.编辑器中F3,输入spawn Crawler,回车,上声纳看怪在哪边,打死它,手动按3的步骤把潜望镜切换到刚刚没来怪那边的炮塔,重复刷怪,检查自动切换是否正常。
tp664066 6 May, 2023 @ 5:47am 
您好 玩家可以 但是ai就是不行
AsunoHikari  [author] 5 May, 2023 @ 7:32am 
玩家能开火吗?位移传感器位置调整了吗?
tp664066 5 May, 2023 @ 12:11am 
您好
我設定一前一後 ai不會開槍
tp664066 4 May, 2023 @ 10:47pm 
您好
可是ai 不會開槍??
AsunoHikari  [author] 4 May, 2023 @ 10:19pm 
会,这个系统会自动把潜望镜连接到有敌人一侧的炮塔,AI只要会开炮就行。不过由于切换的突然性且AI并不知情,在此过程中产生的任何误射我和AI均不负责:lunar2019piginablanket:
tp664066 4 May, 2023 @ 9:30pm 
您好,請問ai會使用嗎