Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Yes that was it, I see it before in Mmasters CAL script, but ditnot now why he dit this
Thanks aggain, script work
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();
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
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.
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
They have a list of what changed here: http://forums.keenswh.com/threads/changes-to-the-modapi-16-03-2016.7381306/
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?
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.
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=646376158
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
Is there a way That i can turn a group on/off, something like this:
new EasyMenuItem("G:Doors", toggleon, Statuson),
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);
}
This keep me busy for awhile. Now I know how the doors work, I can do this also in other situations
Get well soon
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;
}),
new EasyMenuItem("Cancel", delegate(EasyMenuItem item) {
IMyProgrammableBlock PB = GridTerminalSystem.GetBlockWithName("PB easy menu [lcd]") as IMyProgrammableBlock;
PB.TryRun("back");
return false;
}),
}
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");
}
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)
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.
Thanks for the support do youre a great help, Sorry for my bad english is not my native language
That tutorial uses EasyAPI, but as you can see in the example below EasyAPI is not required.
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
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");
Can you change privatetitle to argument voor a Programable blok, so it can be used whit this script: ''Multi LCD config Version 2.4''
You two should colab on things!