Space Engineers

Space Engineers

Projection Resource Calculator Script
Inigma 2019 年 1 月 20 日 下午 5:08
INSTRUCTIONS
Instructions to use this script:

0. Subscribe to both Automatic LCDs 2 https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=407158161 and HiddenMosquito's Projection Resource Calculator Script https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=608041718

1. Build a Programmable block, call it whatever you want. I usually call it "Programmable block (AutoLCD)" without the quotes. It doesn't matter.

2. From the Programmable block's control panel go to Edit > Browse Scripts > and select Automatic LCDs 2 > Copy to editor. Click Check Code, ok, and then ok again.

3. Build an LCD panel. Set the name to whatever you wish. I call mine Construction LCD.

4. Add "[LCD]" to the beginning or end of your Construction LCD name. This will allow Automatic LCDs 2 to read data from it and compile info to its screen. I set my name to "Construction [LCD]" without the quotes.

5. As soon as you enter the name, you should see your LCD populate with the words "Write commands to Custom Data of this panel." Ignore this instruction. It doesn't apply.

6. Build a projector. Set the name to whatever you wish. I usually call mine "Construction Projector (Name of Blueprint)" without the quotes, so I can find it.

7. Click on Blueprints and select a blueprint to load. Adjust your projection as desired.

8. Build a second Programmable block, call it whatever you want. I usually call it "Programmable block (PCalc).

9. From the Programmable block's control panel go to Edit > Browse Scripts > and select Projection Resource Calculator Script > Copy to editor.

10. Before clicking on Check Code, simply edit the line that says

private string projectorName = "Projector";

to

private string projectorName = "Projector";

mine usually looks like:

private string projectorName = "Construction Projector (Name of Blueprint)";


11. Before clicking on Check Code, simply edit a the line that says

private string lcdName = "PRCS LCD";

to

private string lcdName = "Whatever you named your LCD here";

mine usually looks like:

private string lcdName = "Construction [LCD]";

12. Click Check Code, ok, and then ok again.

13. Crucial final step that some of you may be missing: click on Run. This will actually run the Projection Calculator script and populate your named LCD using the desired projected blueprint.

I hope that helps someone.
最后由 Inigma 编辑于; 2019 年 1 月 20 日 下午 11:47
< >
正在显示第 1 - 6 条,共 6 条留言
Inigma 2019 年 1 月 20 日 下午 5:16 
How this script works: It takes all the components your Projector says it needs (you can see this when you go to the Projector in the control panel, as the output is on the bottom right), this script takes that info, calculates the breakdown of resources for each required component, and outputs that data in your desired LCD's Custom Data area. This obviously does not output to the Edit text field of the LCD though, hence why you don't see it output on the LCD itself until you install MMaster's Automatic LCDs 2 script. If you have MMaster's Automatic LCDs 2, once it finds your LCD named using the tag "[LCD]" it can then start to read the Custom Data that was output from the calculator script, and then translates it and outputs it into the Edit text field of the LCD. Quite a simple setup actually. If ever the game modifies values for components per part, simply edit the calculator script with the correct part count numbers. Enjoy!
最后由 Inigma 编辑于; 2019 年 1 月 20 日 下午 11:47
Inigma 2019 年 1 月 20 日 下午 5:21 
The output on the screen looks like:

<< Projection Requirements >>
<< Components summary >>
[||||||||||||||||||||||'] Construction 331 / 335
[|||||||||||||||||||||||] Metal Grid 80 / 12
[|||||||||||||||||||||||] Interior Plate 386 / 155
[|||||||||||||||||||||||] Steel Plate 912 / 402
[|||||||||||||||||||||||] Small Tube 200 / 103
[|||||||||||||||||||||||] Large Tube 75 / 52
[|||||||||||||||||||||||] Motor 75 / 74
[|||||||||||||||||||||||] Display 53 / 9
[|||||||||||||||||||||||] Bulletp. Glass 80 / 40
[||||||||||||||||||||'''] Computer 111 / 123
[|||||||||||||||||||||||] Reactor 60 / 3
[|||||||||||||||||||||||] Radio-comm 18 / 8
[|||||||||||||||||||||||] Detector 16 / 7


The number on the left is what you have, the number on the right is what the projection needs. If you have less on the left than on the right, then you need to build more of that item before you can weld the projection. You can tell in the example above that you need 4 more Construction Components, but that you have everything else on hand to weld this projection (which is for a hydrogen powered moon miner in this case).
最后由 Inigma 编辑于; 2019 年 1 月 20 日 下午 5:22
Einherjar  [开发者] 2019 年 4 月 9 日 下午 7:51 
Thanks for posting this Inigma. Seems like the script picked up in popularity.
Curse of the Luberry 2021 年 12 月 1 日 上午 5:11 
I would like to point out that this script runs perfectly in vanilla, but if you have DLCs or Modded blocks in your blueprints, the script wont see the blocks unless you manually setup via text editior. Its not that bad to setup but it is tedious.

Example "Sci-Fi Large Atmospheric Thruster for Large Grid Ships"
case "Sci-Fi Large Atmospheric Thruster": steelplateCount = steelplateCount + 230; constructioncomponentCount = constructioncomponentCount + 60; motorCount = motorCount + 1100; metalgridCount = metalgridCount + 40; largesteeltubeCount = largesteeltubeCount + 50; break;
if you do plan on manually setting it up, do make sure to update both Large Grid and Small Grid.

Tip: Copy and paste code into a text editor for easy modifications, helps to find out which section of the code is Large Grid and Small Grid

Good luck ^-^
最后由 Curse of the Luberry 编辑于; 2021 年 12 月 1 日 上午 5:12
Nexeir 2022 年 1 月 7 日 上午 1:29 
I did these steps and my LCD is literally just a cyan screen
pokemanphill 2024 年 11 月 28 日 上午 10:55 
This script works great, but for some reason isn't showing Thruster Components. Anybody know how to easily fix this?
< >
正在显示第 1 - 6 条,共 6 条留言
每页显示数: 1530 50