Space Engineers

Space Engineers

Menu for Configurable Automatic LCDs
37 Comments
Tiro 26 Jan, 2018 @ 3:20pm 
you sir! are a god <3
rockyjvec  [author] 26 Jan, 2018 @ 1:04am 
Fixed for latest version of the game.
Tiro 23 Jan, 2018 @ 2:30pm 
will this ever be fixed to work on the current version of the game? or can someone point me in the direction of one that works? so many ideas but cant find a working script.
PineCone227 17 Jun, 2017 @ 10:46am 
Doesnt work for me :(
Twotwinbrothers 20 Mar, 2016 @ 11:25am 
Hi @rockyjvec

Yes that was it, I see it before in Mmasters CAL script, but ditnot now why he dit this

Thanks aggain, script work
rockyjvec  [author] 20 Mar, 2016 @ 11:05am 
Hi @twotwinbrothers,

Those are broken due to a bug that was introduced that Keen is working on. You can work around the problem by putting the following just before the writePublicText call:
lcd.ShowTextureOnScreen();
lcd.ShowPublicTextOnScreen();
Twotwinbrothers 20 Mar, 2016 @ 11:02am 
Hi @rockyjvec

Any luck, to fix These.

https://raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/EasyMenu.cs
ttps:/raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/examples/PBMenu.cs

Only thing that is not working is wen a argument is given, it wil not update the screen
rockyjvec  [author] 18 Mar, 2016 @ 9:33am 
@twotwinbrothers, thanks I'll take a look at those later today. There were some LCD bugs introduced in yesterdays update: http://forum.keenswh.com/threads/lcds-only-update-when-not-being-rendered-after-update-01-126.7381377/

A Keen developer is looking into it. It could be that is what broke those scripts but I will check them later to make sure.
Twotwinbrothers 18 Mar, 2016 @ 9:23am 
Hoi @rockyjvec

lcd.SetShowOnScreen(Sandbox.Common.ObjectBuilders.ShowTextOnScreenFlag.PUBLIC);
solf it by looking in the Cal code by MMaster
for text = lcd.ShowPublicTextOnScreen();
for textures = lcd.ShowTexturesOnScreen()

and these dont work any more

https://raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/EasyMenu.cs
ttps:/raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/examples/PBMenu.cs
rockyjvec  [author] 18 Mar, 2016 @ 8:01am 
@twotwinbrothers, try Sandbox.Common -> VRage.Game

They have a list of what changed here: http://forums.keenswh.com/threads/changes-to-the-modapi-16-03-2016.7381306/
Twotwinbrothers 18 Mar, 2016 @ 7:00am 
Hoi @rockyjvec

Keen made some changes. After that this code is not working any more. I use this to change between Texture and Text

lcd.SetShowOnScreen(Sandbox.Common.ObjectBuilders.ShowTextOnScreenFlag.PUBLIC);

Do you now what they change?
rockyjvec  [author] 16 Mar, 2016 @ 3:44pm 
@twotwinbrothers, looks cool!

Adding me as co-creator is not necessary. If you want to credit me you can just add a note to your description or something. Most of my scripts are designed for people to use/copy them into their own scripts. :-)

I've had trouble uploading my script before. What I ended up doing is deleting the thumb.png file in my workshop item's directory and then resaving it. Every time I have had trouble it was that file that caused it. You might be able to find out what is causing it in your case by looking in the space engineers log file. That's how I figured out it was thumb.png.
Twotwinbrothers 16 Mar, 2016 @ 2:41pm 
also i try to upload my script for two days without succes. Did you have trouble to update new script aswel.
Twotwinbrothers 16 Mar, 2016 @ 2:38pm 
Can i add as friend so i can add yo as co- creator, i cat a lot if codes from you.
Twotwinbrothers 16 Mar, 2016 @ 2:30pm 
I can try that, by the way i add a update to my script + Example world you can see where i am working on. Can find it here:

http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=646376158
rockyjvec  [author] 16 Mar, 2016 @ 2:24pm 
@twotwinbrothers,

I think there is a GridTerminalSystem command to get a group of blocks. I don't remember what it is. You probably have to loop through each block in the group and turn them on/off individually.

If you use EasyAPI you can do it with this:
Blocks.InGroupsNamed("Doors").ApplyAction("Open"); // Toggle all doors in Doors group open/closed
Twotwinbrothers 16 Mar, 2016 @ 4:42am 
Hoi @rockyjvec

Is there a way That i can turn a group on/off, something like this:

new EasyMenuItem("G:Doors", toggleon, Statuson),
Twotwinbrothers 14 Mar, 2016 @ 11:00am 
:steamhappy:Solf my problem whit updating i used the same timer block that update Cal script

IMyTimerBlock tupdate = GridTerminalSystem.GetBlockWithName("T [update]") as IMyTimerBlock;

List<IMyTerminalBlock> list = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfType<IMyTextPanel>(list, Menu);
for(int i = 0; i < list.Count; i++){
IMyTextPanel lcd = list as IMyTextPanel;

if(arg == "back"){
lcd.SetCustomName("Center [0] [2] [Menu] "); lcd.SetShowOnScreen(Sandbox.Common.ObjectBuilders.ShowTextOnScreenFlag.PUBLIC);
lcd.SetValue("FontColor", new Color(255, 255, 255));
lcd.SetValue("FontSize", 1.0f );
tupdate.ApplyAction("Start");
}
if(arg == "update"){
lcd.WritePublicText(menu.Draw(), false);
}
lcd.WritePublicText(menu.Draw(), false);
}
The Enclave 10 Mar, 2016 @ 7:30am 
Hi there i'm getting an error using the script. It compiles ok but gives "Caught exception during execution of script:Common langauge runtime detected an invalid program. The demo world one works ok. Running it on a DS if that makes a difference.
Twotwinbrothers 7 Mar, 2016 @ 4:35am 
@rockyjvec

This keep me busy for awhile. Now I know how the doors work, I can do this also in other situations

Get well soon
rockyjvec  [author] 6 Mar, 2016 @ 6:33pm 
I have oral surgery to remove 4 wisdom teeth tomorrow morning so I will probably not be responding much until later in the week.
rockyjvec  [author] 6 Mar, 2016 @ 6:31pm 
@twotwinbrothers,

This is an EasyAPI command and wont work if you don't include EasyAPI in your script:
EasyBlock door = Blocks.Named(item.Text).FindOrFail(item.Text + " not found!").GetBlock(0)

Use this instead:

public bool toggleDoor(EasyMenuItem item)
{
IMyDoor door = GridTerminalSystem.GetBlockWithName(item.Text) as IMyDoor;

door.ApplyAction("Open");

return false;
}

public string doorStatus(EasyMenuItem item)
{
IMyDoor door = GridTerminalSystem.GetBlockWithName(item.Text) as IMyDoor;

return item.Text + ": " + ((door.Open)?"Open":"Closed");
}

I don't think calling itself will work, however, you can just call the menu directly like this:
new EasyMenuItem("Cancel", delegate(EasyMenuItem item) {
menu.Back();
return false;
}),
Twotwinbrothers 6 Mar, 2016 @ 9:53am 
i want to add it to this script: ''Multi LCD config Version 2.4'' it is on the workshop
Twotwinbrothers 6 Mar, 2016 @ 9:48am 
Also it will not run is own arguments.

new EasyMenuItem("Cancel", delegate(EasyMenuItem item) {
IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("PB easy menu [lcd]") as IMyProgrammableBlock;
PB.TryRun("back");
return false;
}),
Twotwinbrothers 6 Mar, 2016 @ 9:42am 
i now i have to use somthing like this, but wen i copy it in the argument script it will not work

}

public bool toggleDoor(EasyMenuItem item)
{
EasyBlock door = Blocks.Named(item.Text).FindOrFail(item.Text + " not found!").GetBlock(0);

if(door.Open())
door.ApplyAction("Open_Off");
else
door.ApplyAction("Open_On");

return false; // don't go to a sub-menu if one is available
}

public string doorStatus(EasyMenuItem item)
{
EasyBlock door = Blocks.Named(item.Text).GetBlock(0);

return item.Text + ": " + ((door.Open())?"Open":"Closed");
}
Twotwinbrothers 6 Mar, 2016 @ 9:39am 
@rockyjvec

this is out of the easy Api door menu can i use someting like this, wil show the door status as well. and it wil not take so muts space.

// Create menu
this.menu = new EasyMenu("Test Menu", new [] {
//new EasyMenuItem("Play Sound", playSound),
new EasyMenuItem("Door Status", new[] {
new EasyMenuItem("Door 1", toggleDoor, doorStatus),
new EasyMenuItem("Door 2", toggleDoor, doorStatus),
new EasyMenuItem("Door 3", toggleDoor, doorStatus),
new EasyMenuItem("Door 4", toggleDoor, doorStatus)
rockyjvec  [author] 5 Mar, 2016 @ 4:10pm 
Oops, spelled your username wrong, I meant @twotwinbrothers :-)
rockyjvec  [author] 5 Mar, 2016 @ 4:08pm 
@twotwinborthers, to control a door, you can add a menu item like this:
new EasyMenuItem("Toggle Door", delegate(EasyMenuItem item) {
IMyDoor PB = GridTerminalSystem.GetBlockWithName("Door") as IMyDoor;

PB.ApplyAction("Open");
return false;
})

The "Open" action will toggle the door open and closed each time the menu item is selected.
You can also use the "Open_On" and "Open_Off" actions to specifically open or close the door instead of toggling it.
Twotwinbrothers 5 Mar, 2016 @ 1:12pm 
Thanks works great, Whit both codes, It wil not work Easy api menu for the doors, it says that "TryRun" not existed, i want to control doors and the screen in one menu is this posible

Thanks for the support do youre a great help, Sorry for my bad english is not my native language
rockyjvec  [author] 4 Mar, 2016 @ 5:59pm 
Oh, and you can find a tutorial about EasyMenu here: http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=434446653

That tutorial uses EasyAPI, but as you can see in the example below EasyAPI is not required.
rockyjvec  [author] 4 Mar, 2016 @ 5:53pm 
@twotwinbrothers, you may want to just use my EasyMenu script for this and build it into your script. Just add this class to your script:

https://raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/EasyMenu.cs

Then, here is very basic example menu that calls PBs like you wanted (the example depends on the above class):

https://raw.githubusercontent.com/rockyjvec/EasyAPI/master/modules/EasyMenu/examples/PBMenu.cs
Twotwinbrothers 4 Mar, 2016 @ 8:33am 
Ho rockyjvec@

i want to run another PB whit argument whit youre menu, like this code does:

IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("Cal") as IMyProgrammableBlock;

PB.TryRun("boot");
rockyjvec  [author] 3 Mar, 2016 @ 5:38pm 
@twotwinbrothers, I'll be happy to add whatever you need. I'm not sure what you mean, though.
Twotwinbrothers 3 Mar, 2016 @ 11:22am 
wow ,want to do this a long time whit easy api menu, but whit more then one screen. so i wrote a script that allow me to do that, now i only need a menu, so that i can swiths between them whit 4 button

Can you change privatetitle to argument voor a Programable blok, so it can be used whit this script: ''Multi LCD config Version 2.4''
EnjoyCoke 1 Mar, 2016 @ 6:12am 
This is awesome.
You two should colab on things!
rockyjvec  [author] 29 Feb, 2016 @ 9:55am 
Thanks! Great idea! Definitely possible, maybe later today I'll see what I can come up with :)
MMaster 29 Feb, 2016 @ 9:37am 
This is excellent. Wonder if it would be possible to cover everything that CAL can do into menu system like this so people can configure their LCDs without knowing all the commands :)