Space Engineers

Space Engineers

Not enough ratings
ingame Script "Terminal menu" manual
By Twotwinbrothers
This is the manuel for "Terminal menu" by Twotwinbrothers.
   
Award
Favorite
Favorited
Unfavorite
Introduction
This Script is a manual for a Ingame Script:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=646842098

This script allow you to control most of te terminal action via a menu on a lcd.
In this Manual i try to explain how to modify the menu structuur, how to translate and so on.

A little knowledge of scripting is useful, This is not a plug en play script
You have to modify it to youre needs.

Code are marked like this
Thing to change in code are Underlined

enjoy.

Twotwinbrother
What do you need
2 programmeble blocks:
PB [menu] This one will run this script
PB [multi] (optional)This one will run Multi LCD Config By me

1 Flight Seat or Remote

simple setup:
  1. Run "PB [menu]" whit argument "up" (without quotes)
  2. Run "PB [menu]" whit argument "down" (without quotes)
  3. Run "PB [menu]" whit argument "choose" (without quotes)
  4. (Optional) Run "PB [multi]" whit argument "1" (without quotes)
    will restart the screen(s),after you shut them down

numpad setup:
  1. Run "PB [menu]" whit argument "help" (without quotes)
  2. Run "PB [menu]" whit argument "down" (without quotes)
  3. (Optional) Run "PB [multi]" whit argument "H" (without quotes)
  4. (Optional)
  5. Run "PB [menu]" whit argument "choose" (without quotes)
  6. (Optional)
  7. (Optional) Run "PB [menu]" whit argument "back" (without quotes)
    The way i build the menu sturtuur you dont need "back"
    but the script knows the argument
  8. Run "PB [menu]" whit argument "up" (without quotes)
  9. (Optional) Run "PB [multi]" whit argument "1" (without quotes)
    will restart the screen(s),after you shut them down
Start settings
Tag Lcd
// Tag Name Menu Lcd panel string idtext = "[Menu]";
  • Change ''[Menu]" in whatever you want, work only on lcd/textpanel


Itemname
// Tag ship or station name. Needed to exclude block that are not part of this or unwanted connected grids string itemname ="[STATION] "; //use PB menu Arg "instal" to automatically add this tag to blocks //use PB menu Arg "uninstal" to automatically remove this tag from blocks
  • Change ''[STATION]" in whatever you want,
Whan you run this script whit arg: "instal" it add itemname to all connected blocks ( exept remote)
Whan you run this script whit arg: "uninstal" it remove itemname to all connected blocks ( exept remote)
Use"MMaster LCDs script"
// change "false" in "true"if you want to usemenu on a lcd that also use"MMaster LCD script". ( will slow refress time,ollow menu centering) //for centering look in "TRANSLATION STRINGS" on the bottom string MM = "false"; string Mtag = "[LCD]"; //this wiil slow down the update time (aprox 6sec) of de menu screen

  • Change "false" in "true" when you want it to show whit mmaster info, or centered
  • Change "[LCD]" when it is not the same as the tag you use in the mmaster script

When "true" this script will no longer write to the public text of of the lcd only to the Customdata.
This will replace everything in the Customdata.
and automatically add the "Mtag"
Menu screen settings
// Change Font color menu screen Color fontcolor = new Color(0,60,70); // Change Background color menu screen Color backcolor = new Color(0,0,0); // Change font size menu screen float fontsize = 1.0f; // Change font menu screen string font = "Debug"; //"Monospace" or "Debug"
Crossgrit-comminucation
// This script can be used with crossgrit-comminucation when address is been request with PB it wil show up on off grid screen that is connected with receiving PB string address = "www.station.com";
  • this is related on something i still working on, my seding and request script is not ready for publication yed.
MMaster commands +Top +Help +End
Here you can modifi the text shown on lcd in "top","help","end".
(between quotes,dont remove: \n,\n = enter or new line)
help can be switch on/off
You can add lines to them (example: top += " example \n";)

Do not remove "(M.T["msg"])",this is related to "TRANSLATION STRINGS" on the bottom

Add "//" (without quotes) before the line you dont want to see on the screen.
Everything between "/*" and " */ " (without quotes) will not be seen as code. and will not be seen on the screen.

MMaster commands can be placed like this
if (MM == "true"){ top+= "DateTimec \n"; }
example if mmaster is true it show date and time, else it show "Top"
top += (M.T["MT"])+"------------------------------------------------------------------------------\n"; if (MM == "true"){ top+= "DateTimec \n"; } else{ top += (M.T["MT"])+" Top \n"; } top += (M.T["MT"])+"------------------------------------------------------------------------------\n";
example this part will not be shown on screen because it is between " /* " and " */ "
/* MH"])+" Switch 1 for controls info \n"; help += (M.T["MH"])+" Menu Controls\n"; help += (M.T["MH"])+"\n"; help += (M.T["MH"])+" Simple Setup \n"; help += (M.T["MH"])+" 1 = (M.T["Aup"]) 2= "+ (M.T["Ado"]) +" 3 = "+(M.T["Ach"])+" \n"; help += (M.T["MH"])+"\n"; help += (M.T["MH"])+" For Numpad users \n"; help += (M.T["MH"])+" 7 = "+(M.T["Aba"]) +" 8 = "+(M.T["Aup"]) +" 9 = "+(M.T["Aof"]) +" \n"; help += (M.T["MH"])+" 4 = "+(M.T["Ale"]) +" 5 = "+(M.T["Ach"]) +" 6 = "+(M.T["Are"]) +" \n"; help += (M.T["MH"])+" 1 = "+(M.T["Ahe"]) +" 2 = "+(M.T["Ado"]) +" 3 = "+(M.T["Apa"]) +" \n"; */
example this part will not be shown on screen because it has " // " before it
// help += (M.T["MH"])+"-----------------------------------------------------------------------------\n";
menu will be shown here,menu can be modifid in menu structure.
Start footer, change "int Textheight" in code, can get it up here.

example if Me.CustomData.Contains "[help]" on it showthe argument , else it show "Switch 1 voor menu controls"
end += (M.T["ME"])+"-----------------------------------------------------------------------------\n"; //end += (M.T["ME"])+" end/Footer\n"; if (Me.CustomData.Contains("[help] on")){ end += (M.T["MH"])+" 1 = "+(M.T["Ahe"])+" 2 = "+(M.T["Ado"])+ " 5 = "+(M.T["Ach"])+"\n 7 = "+(M.T["Aba"])+" 8 = "+(M.T["Aup"]+"\n" ); } else{ end += (M.T["ME"])+" Switch 1 voor menu controls \n\n"; } end += (M.T["ME"])+"-----------------------------------------------------------------------------\n";
Menu structure
here i will show how to start buildeng your menu sructure
menu title
if(menu == null){ menu = new EasyMenu("Menu Index", new [] {
menu index = Title of the menu
Sub menu
Sub menu

Begin
new EasyMenuItem("Sub menu", new[] {
place here new EasyMenuItem
}), <-- add these to the endof the sub menu
  • sub menu = Title of the sub menu

now it should look like this we added a sub menu
if(menu == null){ menu = new EasyMenu("Menu Index", new [] { new EasyMenuItem("Sub menu", new[] {
}),
}),
Go back via menu

new EasyMenuItem("Back /n", delegate(EasyMenuItem item) { menu.Back(); return false; }),
  • Back /n = Here you can change the name that it shows in the menu

now it should look like this, we added a back action
if(menu == null){ menu = new EasyMenu("Menu Index", new [] { new EasyMenuItem("Sub menu", new[] { new EasyMenuItem("Back /n", delegate(EasyMenuItem item) {
menu.Back();
return false;
}),
}), }),
Run another Programmeble block whit argument
new EasyMenuItem("Turn off ", delegate(EasyMenuItem item) { IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("PB [multi]")as IMyProgrammableBlock; PB?.TryRun("argument"); return false; }),
  • turn off = Here you can change the name that it shows in the menu
  • PB [multi] = name of the PB
  • argument = The argument you will run in the other PB

now it should look like this, we added a PB run action
if(menu == null){ menu = new EasyMenu("Menu Index", new [] { new EasyMenuItem("Sub menu", new[] { new EasyMenuItem("Back /n", delegate(EasyMenuItem item) { menu.Back(); return false; }), IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("PB [multi]")as IMyProgrammableBlock;
PB?.TryRun("argument");
return false;
}), }), }),
Make Pages(new in update 2.61)
after the menu stuctuur you can make predefined pages.
so you see your power with the mmaster script instat off the menu.

pages allow to do de same thing i did whit this script "Multi Lcd Config" manual bud whit this same PB, handy for small ships.

// Lcd List List<IMyTerminalBlock> list = new List<IMyTerminalBlock>(); GridTerminalSystem.GetBlocksOfType<IMyTextPanel>(list); for(int i = 0;i < list.Count;i++){ IMyTextPanel lcd = list i as IMyTextPanel;
This make a list of all lcd panel you don't have to change anything in this part.

if(lcd.CustomName.Contains("[0]")){ //place pages commands here example: lcd.CustomData = (" DateTimec ");// for the mmaster script }<--dont forget to close
  • [0] = here you can place a name for another screen.

if(lcd.CustomName.Contains(idtext)){
in this code is look for the menu lcd. if you want to contol another screen whit pages do this before this line.
  • idtext = predefined for the menuscreen.

if(Me.CustomData.Contains("<")){ if(!lcd.CustomName.Contains("[LCD]")){ lcd.CustomName= (lcd.CustomName+" [LCD]"); } }

as long "<" is in the page name it automaticly add the "[LCD]" tag to the menu screen.

more option to lcd i suggest reading this guide: "Multi Lcd Config" manual
Switch page ( new in 2.61)
Whit page you can switch between preset pages in te "Make Page" more on this
new EasyMenuItem(" Page name",delegate(EasyMenuItem item){ Me.CustomData = (Me.CustomData.Replace("[page] menu","[page] <2>")); return false; }),

  • Page name = name of page dont do anything
  • <2> = page reference
  • < = this add MMaster lcds tag to lcd name, don use wen de page not refere to mmaster lcd
Block + Action+ Status
new EasyMenuItem("Terminal block name",First Agrument ,Second Agrument ),
  • Terminal block name = Block name or part of it
  • First argument = Action
  • Second argument = Shows Action name, Status and/or Details on screen
see Agrument list for action status names

Now it should look like this, we added a block action
if(menu == null){ menu = new EasyMenu("Menu Index", new [] { new EasyMenuItem("Sub menu", new[] { new EasyMenuItem("Back /n", delegate(EasyMenuItem item) { menu.Back(); return false; }), IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("PB [multi]")as IMyProgrammableBlock;
PB?.TryRun("argument");
return false;
}), new EasyMenuItem("Terminal block name",First Agrument ,Second Agrument ), }), }),
argument list
ALL TERMINAL BLOCKS ( 2 new in update 2.61)
First Agruments

A = Do nothing
Aon = On Block
Aoff = Off Block
Aonoff = Switch On/Off Block
Ause = useconveyer On/Off ( new in update 2.61)

Second argument

D = Show Details only
Son = Show On
Soff = Show Off
Sonoff = Show On/Off
SonoffD = Show On/Off + Details
Suse = useconveyer On/Off ( new in update 2.61)
DOOR
First Agruments

AdoorO = Open Door
AdoorC = Close Door
AdoorOC = Switch Open/Close Door

Second argument

SdoorO = Show Open
SdoorC = Show Close
SdoorOC = Show Open/Close
SdoorOCO = Show Open/Close/Off
CONNECTORS
First Agruments

AswitchL = Switch lock Connector
Alock = Lock Connector
Aunlock = Unlock Connector
Athrow = Switch Throw On/Off
ACol = Switch Collect On/Off

Second argument

SconULR = Show Unlock/Lock/Ready
SconULRO = Show Unlock/Lock/Ready/Off
Sthrow = Show Throw On/Off
Scol = Show Collect On/Off
LANDINGGEAR (1 new in update 2.61)
First Agruments

AswitchL = Switch lock Landinggear
Alock = Lock landinggear
Aunlock = Unlock landinggear
NEW !! AautoL = Switch autolock On/Off

Second argument

SlandULRO = Show Unlock/Lock/Ready/Off ( autolock status in update 2.61)
NEW !! SautoL = Show action name ( status in update 2.61)
PRODUCTIE
First Agruments

Aonoff = On/Off Block

Second argument

SprodWI = Show Working/Idle
SprodWIO = Show Working/Idle/OFF
COCKPIT + Remote (3 new in update 2.61)
COCKPIT

First Agruments

Awheels = Set control weels
Atrust = Set control Trusters
Ahand = Handbraek on/off
Adam = Dampeners on/off
Amain = Main cockpit on/off
new AmainR = Main remote on/off (new in 2.61)

Second argument

Swheels = Show control wheels On/Off
Strust = Show control Trusters On/Off
Shand = Show Handbraek On/Off
Sdam = Show Dampeners On/Off
Smain = Show action Name Main cockpit (inproverd status in 2.61)
SmainR = Show action Name Main Remote (New status in 2.61)
TIMER
First Agruments

Astartstop = Swits Start/Stop
Astart = Start
Astop = Stop
Atrig = Trigger

Second argument

Stime = Show Counting down / stop
StimeD = Show Counting down + Details / stop
ROTOR / PISTON ( 2 new in update 2.61)
First Agruments

AincreaseV = Increase velosity
AstopV = Stop velosity
AdecreaseV = Degrease velosity
AreverseV = Reverse velosity
Aattach = switch between Attach detach( new in update 2.61)

Second argument

SincreaseV = Show Incraese
SstopV = Show Stop
SdecreaseV = Show Decrease
SreverseV = Show Reverse
Sattach = Show attach status ( new in update 2.61)
AIRVENT
AIRVENT

First Agruments

AventD = Depressurize on/off

Second argument

SventDO = Show Depressurize on/off

SORTER

First Agruments

AsortD = Drain All on/off

Second argument

SsortDO = Show Drain All on/off
SORTER
First Agruments

AsortD = Drain All on/off

Second argument

SsortDO = Show Drain All on/off
BATTARY (new in update 2.61)
First Agruments

AbatRDSN = Switch between Recharge - Discharge - Semi-Auto - none

Second argument

SbatRDSN = Show Recharge - Discharge - Semi-Auto - none
How to translate
It is now possible to translate the script to your own language. You need to only translate messages at the bottom of the script. and names menu structuur