Space Engineers

Space Engineers

评价数不足
Orbital script V2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
408.140 KB
2021 年 11 月 29 日 下午 8:39
1 项改动说明 ( 查看 )

订阅以下载
Orbital script V2

描述
This is a modified version of this script: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1401338706

Modifications I made:
- Increased max speed to 1000 m/s (You can change this if you'd like, open the programmable block, hit "edit", and change the variable i_maxOrbitalVelocity to whatever you want)
- Changed the display code so it can output to multiple displays, allowing you to have multiple orbital maps and status displays


This script allows you to keep a ship in orbit around a planet and render an orbital map.

Instructions:

You ship will need a few components for this script to do its job.
The most important is a ship controller. This can be either a remote control or a cockpit. It must be named "OrbitController" for the script to find it. This block will define the orientation of the ship when orbiting a planet with the autopilot. The Up side of this block will point away from the planet, and the Front side will point forward.

The autopilot can be activated with the argument "toggleAutopilot". When activated it will attempt to allign the ship with the target orbit and then accelerate to the required orbital velocity. In order for the autopilot to work your ship will need a gyroscope and 1 thruster in each direction.

To select an orbit you can run the script with the arguments "forward", to generate an orbit based on your current direction, or "input", to generate an orbit based on the input variables. There are a lot of things you can change in the input section of the script, so I suggest you take a look at that.

The orbital map can be rendered by adding an lcd panel named "OrbitDisplay". This will display the planet (grey), the ship (green), the target orbit (light blue) and the current trajectory (magenta). If you add waypoints to the ship controller (if it is a remote control), these will be also be displayed (blue).

Extra stats and error messages can be displayed on an lcd panel by naming it "OrbitStats".


A Speed mod is highly recommended for autopilot functionality.
I suggest one of these:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=380168871
or this one:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=599536562
3 条留言
Marredone 2021 年 12 月 1 日 上午 8:32 
Thanks for the answer
samtisch  [作者] 2021 年 11 月 30 日 下午 9:54 
I edited the display rendering code to output to multiple displays named "OrbitDisplay" or "OrbitStats". Before, if you had 2 displays named "OrbitDisplay", only one of them would show the display. This version supports multiple displays, so if you have 2, they will both update.
Also, when using the script, I always turned up the max velocity to 1000 m/s from 500 m/s, so I saved that change in the script.
Marredone 2021 年 11 月 29 日 下午 9:41 
What did you end up tweaking from the original script? Curious since I use the other one pretty heavily still