Space Engineers

Space Engineers

评价数不足
Raycast Lidar
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
509.777 KB
2021 年 7 月 27 日 下午 7:42
2022 年 1 月 1 日 下午 1:40
4 项改动说明 ( 查看 )

订阅以下载
Raycast Lidar

描述
Simple script using raycast vanilla camera. The GPS of the found target is placed in the CustomData camera and can be used for further automation, for example, firing torpedoes.

Main features

1. measuring distance to object / target
2. setting the scanning range
3. transferring GPS coordinates of the found target to the autopilot (if installed)
4. calling a given program block with a parameter or GPS target

Installation and configuration
For the script to work, the following are required:

a) program block
b) ship controller (cockpit, remote control, pilot's seat)
c) camera (not behind glass)

The installation of the script code into the program unit is carried out by subscription in Steam. After saving the code, add the same "lidar" prefix (by default) to the name of the camera and LCD panel to display information. The output can be carried out on the screen of the cockpit or the pilot's seat; for this, the prefix must also be added to the cockpit name. The script works on demand and does not use the system timer, which makes it convenient for use on servers.

Usage
  • If the variable autopilot is not equal to 0, then the script transfers the target coordinates to the autopilot installed on the same grid as the PB, the GPS target coordinates. Waypoint is put on autopilot under the name "Lidar". The autopilot is manually activated if necessary.

  • You can make a sight out of a transparent LCD panel using a variable sight. If it is not equal to "", then its contents will be displayed when the script is initialized and the target is rescanned. This is convenient for scripts to control custom turrets like MART.

  • Custom Data of camera lidar can be easily adapted to launch missiles of the same type using automatic guidance and control scripts type Easy Lidar Homing Script

An example of such use is published in the workshop.

Description of parameters and settings in the header of the script. Comments and questions are welcome.

15 条留言
Survival Ready  [作者] 11 月 13 日 下午 5:31 
You just need to execute the script with one of the parameters specified in the script header.
ReDinverno 11 月 13 日 下午 2:12 
It says ready to scan but how do I start it?
ThePhoenixKnight 11 月 1 日 下午 4:36 
Would it be possible to make the script check subgrids aswell? currently it only checks main grid for a camera with the tag "lidar", whenever I put the camera on a subgrid it stops working.
Survival Ready  [作者] 2022 年 3 月 24 日 上午 8:58 
You did the right thing. The peculiarity of the work of Raycast is related to how far the scanning will be performed at the time of initialization. For example, with a range of 15 km, it takes me about 7 seconds for the initial scan, but then everything works quickly.

Since you are printing drones, every time the drone runs the script for the first time, you will experience this delay.
Nikki 2022 年 3 月 23 日 上午 9:41 
I seem to have mostly fixed the issue by setting the scan range to just 3000m. Maybe it had something to do with there being too much ground to scan. Anycase it seems to be way more reliable now!
Nikki 2022 年 3 月 21 日 上午 10:34 
It sometimes keeps giving me the nothing found in *insert max range*, despite multiple attemts. If i try to do it in a diffrend scenario it suddenly works fine. Idk if it has to do with the terrain somehow blocking the beam? Perhaps im just missing the beam due to server or something.

If you want to help heres the blueprint, its a simple drone carrier for pvp rover only server. Each drone has your script on it, bound to scan on the number 2. The lcd has to be viewed from first person which is a flaw i have to fix.

https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2782630844
Survival Ready  [作者] 2022 年 3 月 21 日 上午 7:48 
Lidar works by the point where the beam touches the object. What exactly are the problems and what is displayed?
Nikki 2022 年 3 月 21 日 上午 6:31 
Eady to use script. I use it for launching wheeled drones out of a large rover. Tough i do seem to sometimes have some inconsistent trouple trying to tag a grid with the scan.
RandomGuy0400 2022 年 3 月 10 日 上午 8:18 
that's what I was trying to use it for, i like to use the camera because if i just point my crosshairs at an object from the cockpit, I won't always get an accurate distance reading or even any distance reading, so I control the thing from the camera so my crosshairs actually line up with what the camera sees, so im looking at the same point as the camera
Survival Ready  [作者] 2022 年 3 月 10 日 上午 8:06 
In general, you are right, but this script was developed primarily for reconnaissance of asteroids in space, where it is not always possible to determine by eye which one is closer, and then it was extended to fire, among other things, missiles guided by GPS coordinates.