Space Engineers

Space Engineers

Tidak cukup rating
SGC-Computer
   
Penghargaan
Favorit
Difavoritkan
Batalkan favorit
Ukuran File
Diposting
Diperbarui
1.509 KB
20 Feb 2015 @ 2:40pm
26 Apr 2015 @ 2:52am
7 Catatan Perubahan ( lihat )

Berlangganan untuk mengunduh
SGC-Computer

Deskripsi
Multstate DHD for Wormhole Portal (Full Dedicated Server Support!) and Stargate (working teleport)

This is an example on how to use a single DHD to dial out to multiple addresses, without needing to rename it all the time.

This method uses the buttons on a button panel as bits. This indexes into a list of address to chose the right one.

It then renames the DHD to that name, and indicates a valid address.


Requires:
Button panel(s)
1 Timer block + (status)
1 additional Timer block for each button you want to use (bit blocks)
1 Programming block +
Additional programming block for Iris, if desired
LCD Panel
1 interior light +
1 interior light for each button you want to use (bit lights)

1 source gate
1 source DHD

As many destination gates and, optionally, DHDs as you want

Example World: http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=396097685

Steps:
Keep in mind all source blocks must be on same grid.

Add source gate and DHD, name doesn't matter
Place several destination gates around the map. Name the gates something and remember their names
Place one or more button panels (2 buttons panels have 8 buttons, which are 255 possible addresses)
Add 1 interior light, anywhere on the source grid, named "Interior Light Status"
Add additional lights, one for each button (not panel) that will be used
Name each light "Interior Light Code_X" where X is a number from 1 to the number of buttons you have, eg "Interior Light Code_1"
Place 1 timer block, named "Timer Block Run"
Place additional timer blocks, once for each button, as with the lights. Named "Timer Block X", where X matches the interior light number above
Place an LCD panel, named "LCD Panel_Gates"
Create a new block group, named "DHD-Group" that contains the DHD, the LCD panel, and all the lights created above.
Place a Programmable block, named Programmable Block SGC

The buttons should be arranged in a binary configuration. What that means is if all placed in a single line, the first one is the right-most one:
Panel 2 - Panel 1
8 7 6 5 - 4 3 2 1
128 64 32 16 - 8 4 2 1

The right-most on will be button #4 on panel #1 (first bit). Using this information we go to the next step:
Go to the first bit button (remember, button #4 on the first button panel), and set the action to the ‘Trigger Now’ action on first timer block (Timer Block 1)
Repeat for each button on each panel, going from right to left (button #3 will be assigned to Timer Block #2, etc…)
Go to Timer Block 1, and set the following actions:
#1, Toggle Interior Light Code_1 On/Off
#2 Timer Block Run Start
#3 Toggle Interior Light Status Off
Repeat for each additional timer block, incrementing the Interior Light Code_X to match said Timer Block
Go to Timer Block Run and set the following action:
Programmable Block SGC - Run

Now to set final values.

Go to LCD Panel, and edit the Public Text
Add a list of destination gate address, one on each line
Click OK to save
Go to the Programmable Block SGC, and set the code to the script found on the workshop here: http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=396040403

Test:
Using the list in the LCD panel, activate the buttons on the panel to correspond to the number it is in the list
For example, for the first address, just enable the first bit (button #4 on Panel #1)
For the second, enable the second bit (Button #3 on Panel #1), and disable the first bit
For the third gate on the list, enable both the first and second bits.
The lights should turn on and off with the button presses
When address is entered, push the button on the DHD to dial.
17 Komentar
mr_trousers 1 Mei 2016 @ 11:13pm 
If anyone else chances on this script and has the same problem, I managed to fix it. Remove line 52 and add in its place:

var blockGroups = new List<IMyBlockGroup>();
GridTerminalSystem.GetBlockGroups(blockGroups);
mr_trousers 1 Mei 2016 @ 8:56pm 
When I go into the code of the programmable block and tell it to check the code, it says:

"Compilation failed
Line 52: 'Sandbox.ModAPI.Ingame.IMyGridTerminalSystem' does not contain a definition for 'BlockGroups' and no extension method 'BlockGroups' accepting a first argument of type 'Sandbox.ModAPI.Ingame.IMyGridTerminalSystem' could be found ,are you missing a using directive or an assembly reference?"

Any ideas?
mr_trousers 30 Apr 2016 @ 1:42pm 
My programmable block is giving me an error: "Assembly not found. Please compile script." Am I doing something wrong? I've never used programmable blocks before, sorry.

Thanks for this though, it looks really cool, and very useful.
Wolverine 17 Sep 2015 @ 4:07pm 
This looks awesome!
Anhktus  [pembuat] 10 Mei 2015 @ 12:37pm 
because thats not the way phoenix built his mod. i just made this script with a little help from phoenix to make it easier to dial multiple gates without multiple dhds. he built the star gate mod.
Geneticus 10 Mei 2015 @ 11:59am 
This seems like an overcomplicated way of doing this. Since Gate symbols are coordinate points, why not treat them as individual digits and a delimiter. then you just enter XXX,YYYYYYY,Z and if a gate is within 500m of those coordinates it locks and connects to that gate.
Anhktus  [pembuat] 23 Apr 2015 @ 12:48pm 
i added you in steam, so you can see my world and download it
bluedragnpc 23 Apr 2015 @ 9:58am 
as far as i can tell i have it correct. if i can find a map on workshop with it i can see what im doing wrong, but other wiz no worries.
Anhktus  [pembuat] 23 Apr 2015 @ 2:38am 
in the lcd it just one name on each line. did you set up the groupname right? are all blocks on the same grid. check the names of all the needed blocks pls.
bluedragnpc 22 Apr 2015 @ 12:00pm 
i belive so it might be the LCD setup. how is that suppose to look, just the gate names on each line or add other info too. i say this cause im not a c# type of guy.