Space Engineers

Space Engineers

Not enough ratings
Kaien's Drone Control System
   
Award
Favorite
Favorited
Unfavorite
Tags: autopilot
File Size
Posted
Updated
472.917 KB
8 Jun, 2018 @ 8:21am
6 Jun, 2021 @ 3:52am
29 Change Notes ( view )

Subscribe to download
Kaien's Drone Control System

Description
Versions:
v5.5.0 (20210606)
Manually Hover, "BST", "STEER"


Summary:
This script can control multiple drone on mother ship. It should work with Radar Display Script Alternative(based on Whip's Turret Based Radar), you can find it from my fighter F27X Tower https://steamproxy.net/sharedfiles/filedetails/?id=2190108872

For mother ship, install radar display script, for slave ship, install both radar display script and this script.

The radar display script use antenna intergrid communication. The mother ship will broadcast its position, and each slaves will get the position. The radar display script on the slave will send the data to this script.

Setup:
1, for mother ship.
a, a cockpit or flightseat
b, one or more antenna
c, a programmable block.
Install radar display script in that programable block, it use the same way with the original Whip's Turret Based Radar script. Only add 2 new parameters in custom data.
a, mother code. Input the name of your mother ship, should be unique.
b, slave code. Input anything, because this mother ship don't listen to anyone.

2, for drone
a, a cockpit
b, one or more antenna
c, 2 programmable blocks
d, 6 directions thrusters and gyros
Install radar display script in one of the programmable block. for the 2 parameters we mentioned.
a. mother code. Input anything, because no one listen to you (but, actually you can establish a multi-layer command tree).
b. slave code, Input the name of your mother ship. Indicate who will you listen to.

Then, install this DCS script to another programmable block, change the name of this programmable block to 'Programmable block dcs', only first character is upper case.
There is a section in the script source code, marked like son example. Copy this section to the custom data this programmable block. edit its value to match drone's cockpit. (No need to change the antenna, because radar display script used the latest inter-grid api, it can use any antenna of the ship)

Change your cockpit screen setting, DCS display is located in the right top screen(3rd screen). change it to "text and image", if everything is right, you may see that there is something displayed in that screen.

With a flashing mark "<=" which means you are receiving positions from radar display script. if you don't see it, try to recompile the radar display programmable block.

And, you may find the relative position in that screen. this position is based on your mother ship. you may change the custom data of drone's DCS programmable block, to set that where to land, and where to "prepare for landing", and where to wing the mother ship. There are 9 parameters, if something wrong, you may try to change the plus-minus sign of each number, to see what is the different.

Then you may use:
1, "RADAR:FLYBYON"
2, "RADAR:DOCKINGON"
3, "CONTROL"
this 3 commands to the DCS programmable block. That means you can put the programmable block to the shotcut bar, with parameters. and input these strings above.

there are many more functions the script can do.
1. Attacking enemy locked by mother ship FCS (MEA's Fire Control System)
2. Control the VTOL thrusters.
3. Save the hydrogen if there is no need to activate hydrogen thrusters.
4. Maintain the specific speed when climbing up or diving down
5. Transform the Variable Fighter(VF), but you need to setup it carefully, perhaps change some of the source code to do so. (refer to F27X Tower transforming system)
when i have time, i will write them down.

一些补充说明
Hi,我先假设你可以看懂中文,所以先用中文回答,我怕我的英文水平写出来会有偏差。首先我需要说明一些基本的概念。DCS早期的版本采用天线做网格间通讯,而且是由DCS脚本自主完成这个通讯的,也就是说,早期版本的DCS是不需要和radar脚本协作的。这里我们展开讲一下以下概念:
1,广播模式和单播模式
2,和radar脚本协作的目的,优点和缺点
首先,广播模式。也就是说,作为母舰一端,是不需要“知道”有多少子飞船的。母舰只需要把自己的座标广播出去。指令也是如此,所有子飞船都收到相同的指令。这样做的好处是,无论新增还是删除子飞船,母舰这一端是不感知的,也不需要做任何调整。
当然对应的,子飞船本身需要知道自己应该处在母舰的哪个方位上伴飞,左还右,上还下。所以如果你增加了一架子飞船,你需要单独设置每一架子飞船的方位,他们各不相同。如果他们一样,伴飞模式,他们会设法尽量不要撞在一起。但在降落指令下达后,他们会关闭避撞功能,并想要停靠在相同的地点,显然这会造成他们相撞。这也是对打印版的无人机不要下达停靠指令的原因。
但这样做,显然要处理一个问题,就是我们假设有多个母舰的情况,子飞船会搞不清楚自己到底应该要听谁的。解决的办法是为不同的母舰取不同的名字,而在每一架子飞船上,设置该飞船该跟随哪一艘母舰。这也就是母舰上要设置mother code,而子飞船上要设置 slave code的原因。假设A母舰的mother code是A,B母舰的mother code是B。而X飞船的slave code是A,则X飞船会跟随A母舰的信号。虽然,X也能收到B母舰的广播信号,但X会忽略它。
X飞船不必设置自己的mother code,但是X也可以设置,比如X把自己的mother code设为X, slave code设为A,另外,还有一架Y飞船的slave code是X。这样会形成一个链式的传递。即X跟随A,Y跟随X。
最新的radar脚本还有指定slave code发送指令的功能,但其实这个指定的指令也是广播的,只不过对这种指令,除了有mother code外,还有一个slave code,这样,子飞船只有同时满足以下两个条件时才会执行指令:1,自己的slave code等于该指令的mother code, 2,自己的mother code等于该指令的slave code。关于这个新功能的部分,我会再做一期视频专门说明。

另外,关于为什么最新的dcs需要和radar脚本合作。首先,whip的radar脚本非常优秀,我决定在我所有飞船上都安装这个脚本。但这样会有一个小问题,就是radar和dcs都会使用天线发送母舰的坐标信号。其实这种发送由于实时性要求,频率很高,因此也很容易拖慢sim speed。因此我决定删除dcs的信号广播功能。新版的dcs只有本地运行的功能,不再控制天线和跨网格通讯。相对的,radar脚本需要把母舰的信息转发给dcs脚本,以便dcs控制子飞船去跟随母舰。
radar会安装有在一个独立的program block中,而不是和dcs合并为同一个程序。这有两个原因:1,我在dcs里加了太多的功能,导致dcs的文本太长了,我又懒得使用脚本压缩程序。2,将这两者分开,则一些固定的基地可以选择只安装radar,即可行使指挥中心的角色。基地是不能移动的,因此实际上不需要安装dcs。
同一网格中的程序块之间互相调用,是不需要走跨网格通讯那一套的,可以用另一种api实现直接调用。radar的程序块会主动调用dcs的程序块,采用的就是这个机制。

以上,我不知道这些说明是否把事情说清楚了,DCS脚本在易用性上确实有很多可以改进的地方,但这毕竟是个游戏。我个人性格不想投入太多的精力在打磨这个脚本。相反我喜欢在里面加各种新功能。也请理解。

我个人的最新脚本都会放在git上更新,请搜索 kai-en 这个用户。workshop这里的更新可能不会很及时。
26 Comments
慕容夜 8 Dec, 2022 @ 12:57am 
我不会用啊,按你说的步骤,无人机一动不动,有详细点的教程吗?
wu.will.china  [author] 15 Jun, 2022 @ 8:10am 
change the mother code and son code fields of the radar display programmable block
Fascinus 1 Jun, 2022 @ 1:23pm 
How do you specify on the fighter which ship it should listen to?
wu.will.china  [author] 23 Aug, 2021 @ 12:21pm 
我发现留言的文本限制,我把剩余的内容一并放到原介绍里好了
wu.will.china  [author] 23 Aug, 2021 @ 12:20pm 
当然对应的,子飞船本身需要知道自己应该处在母舰的哪个方位上伴飞,左还右,上还下。所以如果你增加了一架子飞船,你需要单独设置每一架子飞船的方位,他们各不相同。如果他们一样,伴飞模式,他们会设法尽量不要撞在一起。但在降落指令下达后,他们会关闭避撞功能,并想要停靠在相同的地点,显然这会造成他们相撞。这也是对打印版的无人机不要下达停靠指令的原因。
但这样做,显然要处理一个问题,就是我们假设有多个母舰的情况,子飞船会搞不清楚自己到底应该要听谁的。解决的办法是为不同的母舰取不同的名字,而在每一架子飞船上,设置该飞船该跟随哪一艘母舰。


wu.will.china  [author] 23 Aug, 2021 @ 12:19pm 
Hi,我先假设你可以看懂中文,所以先用中文回答,我怕我的英文水平写出来会有偏差。首先我需要说明一些基本的概念。DCS早期的版本采用天线做网格间通讯,而且是由DCS脚本自主完成这个通讯的,也就是说,早期版本的DCS是不需要和radar脚本协作的。这里我们展开讲一下以下概念:
1,广播模式和单播模式
2,和radar脚本协作的目的,优点和缺点
首先,广播模式。也就是说,作为母舰一端,是不需要“知道”有多少子飞船的。母舰只需要把自己的座标广播出去。指令也是如此,所有子飞船都收到相同的指令。这样做的好处是,无论新增还是删除子飞船,母舰这一端是不感知的,也不需要做任何调整。



FreezingPanzer 20 Aug, 2021 @ 7:45pm 
你好
请问脚本里说的
Install radar display script in that programable block, it use the same way with the original Whip's Turret Based Radar script. Only add 2 new parameters in custom data.
a, mother code. Input the name of your mother ship, should be unique.
b, slave code. Input anything, because this mother ship don't listen to anyone.

Install radar display script in one of the programmable block. for the 2 parameters we mentioned.
a. mother code. Input anything, because no one listen to you (but, actually you can establish a multi-layer command tree).
b. slave code, Input the name of your mother ship. Indicate who will you listen to.
应该具体怎么写呢? 有没有例子 比如:mother code:shipname 这样吗
FreezingPanzer 20 Aug, 2021 @ 5:11pm 
hi, great script.
i have a few question though.
about the setting up of the script.

step 1 c part a & b
when you say to "Install radar display script in that programable block, it use the same way with the original Whip's Turret Based Radar script. Only add 2 new parameters in custom data.
a, mother code. Input the name of your mother ship, should be unique.
b, slave code. Input anything, because this mother ship don't listen to anyone."

what should i type in custom data of programable block of radar display? can you give some example plz

wu.will.china  [author] 9 Jun, 2021 @ 5:33pm 
sorry, it must be a cockpit. because cockpit have multiple screens, and it will use the right one. i leave the left one and middle one for other script. because the seat only have one screen, so. you may use a LCD panel instead, name it DCS_LCD.