Space Engineers

Space Engineers

评价数不足
Stargate Script Extension
   
奖励
收藏
已收藏
取消收藏
标签: other_script
文件大小
发表于
更新日期
382.167 KB
2020 年 2 月 5 日 上午 9:26
2022 年 3 月 25 日 上午 3:50
2 项改动说明 ( 查看 )

订阅以下载
Stargate Script Extension

描述
Disclaimer
I'm a java programmer and not good at english. I apologize for all mistakes that have been made with this script and this page.

I played in a survival world with Gwindalmir's Stargate Mod and after buying the second decoration DLC, I wanted to make a base like the SGC. To my surprise, I didn't find any Script that activates blocks when the Stargate dials. So I went ahead and downloaded Gwindalmir's DHD script and used it as API to find out, how the Stargate state can be read by a script. By looking into other scripts like for example the Ship Layout script I found out how to put images on LCDs or write to them.

I'm proud to present my Stargate Script Extension to you!

What this does
The Script exposes several name tags to add to the name of your blocks, all tags can be changed, default values are recommended to avoid problems with similiar scripts. You can use multiple tags per block, using the second and third tag equals the first tag and the fourth and fifth tag can't be used simultanousley at the moment.
1. [SG-Alarm]
Every block with this tag in its name will be turned on if the Stargate is not idle (in other words when it's dialing, active or gets an incoming wormhole). Programmable Blocks will run/ Timer blocks will be triggered/ Sound Bocks will be set to play once. These Blocks will be turned off when the gate is idle.
2. [SG-Alarm-Incoming]
Every block with this tag in its name will be turned on if the Stargate gets an incoming wormhole. Programmable Blocks will run/ Timer blocks will be triggered/ Sound Bocks will be set to play once. These Blocks will be turned off when the gate is idle.
3. [SG-Alarm-Outgoing]
Every block with this tag in its name will be turned on if the Stargate dials. Programmable Blocks will run/ Timer blocks will be triggered/ Sound Bocks will be set to play once. These Blocks will be turned off when the gate is idle.
4. [SG-LCD]
These LCDs or Blocks with a changeable screen and with this tag in its name will show the gate status through the images provided by the Stargate mod.
5. [SG-LCD-Log]
These LCDs or Blocks with a changeable screen and with this tag in its name will show the last connections of the gate.

WARNING
If the script breaks because of a removed gate or invalid inputs the saved connections will be lost!

Additionaly
You can run it with the argument toggleshow to change between showing the saved connections on the block and LCDs and leaving them blank.
You can also run it with the argument toggleiris to change whether the gate should activate its iris on an incoming wormhole.
The third and last possible argument is clear which clears the saved connection.
Add an integer between 0 and <number of screens-1> to the CustomData on a block with screens to change the screen on which the script should display.

As Gwindalmir points out in the comments some functions of this script can be performed without this script.
So what's the point?
This script enables you to save your recent connections and it can diplay the gate status on LCD and block screens.
Also this script only adds successful dials to the recent connection list.

LIMITS
You can display LCD information only on one screen per block.
Inserting a wrong text for the screen number will break the script, working on fixing that.
The Stargate has to be named like the corresponding field in the script reads, you can change it's value in the script, though.
Tell me, if you find something.

This project was quite enjoyable and I hope, you'll have as much fun experimenting with it as I had making it.
Also feel free to add any feedback on the design of this workshop page, this is my first object in the workshop and I'd like to learn how to properly present it.
热门讨论 查看全部(1)
0
2020 年 2 月 5 日 上午 10:22
置顶: Bug Reports
Sigmund Froid
19 条留言
Bodyboarder2528 2024 年 6 月 26 日 下午 5:09 
looks like the incoming wormhole for iris doesn't work
Bodyboarder2528 2024 年 6 月 26 日 下午 5:06 
this no longer works
LunixiaLIVE 2023 年 1 月 23 日 上午 1:46 
[SG-LCD-Log] is not working for me. Not sure if i missing anything. Ive tried tweakings things I thought might be causing the issue, but i cannot figure it out. I did put an echo after the destination is fetched, but its blank :(
any ideas?
LunixiaLIVE 2023 年 1 月 22 日 下午 8:15 
Thanks! ran into another issues recently... just wanted to share what I found.

public void Main(string argument)
{
if(argument != "")

there was a space missing between argument and !
No biggie, it might have been an import issue.
Just wanted to post in case anyone else was having the same issue.

I love this script btw, hopefully future updates allow it to stay around.
Thanks again!
Sigmund Froid  [作者] 2022 年 3 月 25 日 上午 4:07 
Ok I don't know why the script broke for you, but I implemented a fallback in case the script fails to find it with string typing.
Sigmund Froid  [作者] 2022 年 3 月 24 日 上午 5:47 
This might be an API change on the Stargate Mod... I'll check it later, thanks for telling me anywas!
LunixiaLIVE 2022 年 3 月 23 日 下午 6:23 
Possible Bug, not sure if its because of the other mods im running, but this line

destination = gate.GetValue<string>("Phoenix.Stargate.Destination");

I had to change this in order to get it to work.
destination = gate.GetValue<StringBuilder>("Phoenix.Stargate.Destination").ToString();

Could be a .netFramework version issue, but I thought I would post it here instead of uploading my own "fix" when its just one like I corrected.
Bodyboarder2528 2021 年 3 月 25 日 下午 3:59 
hey i like the incoming and outgoing options but is it possible to have a idle option as i want to stop a grid on incoming and then when idle i want it to run a PB to make it continue to orbit a planet
TheMightySpud 2021 年 2 月 16 日 上午 12:42 
Duuuuude, I've been trying to write this very script for a couple of weeks now (limited c# knowledge lol.). Not played with it yet, but just that it exists is awesome.
Sigmund Froid  [作者] 2020 年 2 月 11 日 上午 10:09 
Just add the tag to the name of the block. They'll only activate when the assigned gate didn't initiate the connection