Space Engineers

Space Engineers

1,346 ratings
SIMPL | Ship Integrity Monitoring Program Lite (A sprite-based ship layout/floor plan script)
24
17
15
9
8
6
5
4
4
4
3
3
2
109
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
865.481 KB
Dec 31, 2020 @ 9:47pm
Oct 23, 2024 @ 10:59am
19 Change Notes ( view )

Subscribe to download
SIMPL | Ship Integrity Monitoring Program Lite (A sprite-based ship layout/floor plan script)

In 1 collection by Whiplash141
Whip's Scripts
22 items
Description

  Features
  • (NEW) Can draw multiple views onto a single display!
  • Can draw across multiple LCD panels
  • Displays cross-sections of your ship and can display destroyed blocks
  • Highlights ship subsystems like thrust, gyros, and power
  • Built in legend
  • Customizable colors
  • Works with screen rotation
  • Cross-section views can be rotated and manually scaled
  • Works with multi-screen blocks like cockpits and consoles
  • Uses sprites for drawing
  • Low performance impact


  Description
Howdy!

This script draws a sprite-based 2D cross-section of your ship and will display destroyed blocks and highlight important ship systems. This script is designed to be as lightweight as possible (hence the name) while still retaining a decent amount of utility.

Larger ships will take longer to scan than smaller ships because the script is designed to only go through a few blocks per run to keep the performance impact low.


  Setup Instructions
  1. Place this script in a programmable block on the grid that you want to display.
  2. Add text panels, LCD screens, and multi-screen blocks to a group named "SIMPL".
  3. Run the program with the argument refresh to process any new screens or Custom Data changes.
  4. Configure the custom data of the programmable block and the blocks with screens to your liking (see below).

If you wish to reset the script for damage or display newly placed blocks, you must recompile the script.


  Configuration
Display Config
You can configure the appearance of the ship view for each display screen in the Custom Data of each block with display screens. For blocks with only one display, the custom data will look like this:
[SIMPL - Text Surface Config] Number of views=1 [SIMPL - Display Config - View 1] ; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ View axis=X Rotation (deg)=0 Scale=auto ; Elements should range from -1 to 1 where 0 indicates centered Position={X:0 Y:0} [SIMPL - Legend Config] Legend Scale=1 ; Elements should range from -1 to 1 where 0 indicates centered Position={X:-1 Y:-1}

For blocks with multiple screens, the custom data will look like this:
[SIMPL - Text Surface Config] Number of views for screen 0=1 Number of views for screen 1=0 Number of views for screen 2=0 Number of views for screen 3=0 [SIMPL - Display Config - Screen 0 - View 1] ; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ View axis=X Rotation (deg)=0 Scale=auto ; Elements should range from -1 to 1 where 0 indicates centered Position={X:0 Y:0} [SIMPL - Legend Config - Screen 0] Legend Scale=1 ; Elements should range from -1 to 1 where 0 indicates centered Position={X:-1 Y:-1}
For multi-screen blocks, you must set "Number of views for screen X" to 1 or larger, then run the argument refresh. After that, the block's Custom Data will be populated with new section(s) where you can configure views for that particular screen, "X".

General Config and Colors
You can configure the colors and general settings used by SIMPL in the Custom Data of the Programmable Block that this script runs from. The Custom Data should look like the following:
[SIMPL - General Config] Group name=SIMPL Auto scan=true ; Colors are in the format: Red, Green, Blue, Alpha. ; If you do not want to see a particular subsystem color ; simply set the Alpha value to 0 and it will be ; omitted from the legend. [SIMPL - Colors] Max block density=50, 50, 50, 255 Min block density=10, 10, 10, 255 Missing block=100, 0, 0, 200 Background=0, 0, 0, 255 Power=0, 100, 0, 100 Gyro=100, 100, 0, 100 Thrust=0, 0, 100, 100 Weapons=100, 50, 0, 100
As mentioned in the comment above, you can omit a certain subsystem from special highlighting and the legend by setting the Alpha of the color to 0.


  Multiscreen Display
You can also combine multiple LCD panels together to create larger surfaces to draw sprites on.

In order to create a multiscreen display:
  1. Make a wall of LCD panels (They must all be the same type of LCD).
  2. Add only the top left LCD panel to the SIMPL group.
  3. Add the following to the custom data of that top left LCD panel:
    [SIMPL - Multiscreen Config] Screen rows=1 Screen cols=1
    • Change "Screen rows" and "Screen cols" to match the shape of your screen wall.
  4. Recompile (if you added new blocks) or run the argument refresh (if no new blocks were added) to process changes.
This will now be treated as one massive LCD screen!




  Arguments
Arguments are not case sensitive.
Argument
Description
refresh
Reacquires all display screens and reprocesses any Custom Data changes.
scan
Initiates a manual scan for any destroyed blocks. This is only valid when "Auto scan" is set to false in SIMPL - General Config.
force_draw
Forces a redraw of all sprites to clients within sync range. This has a 30 second timeout to reduce the possibility of using this to grief server networking


  Author's Notes
This is my rendition of a Floor Plan type script. Performance was my primary concern when writing this, so I've consciously sacrificed responsiveness for lower performance impact.

Be sensible. Don't attempt to draw 100k block ships on your favorite dedicated server. While the script runtime itself will still stay low, the renderer will ♥♥♥♥ itself and you will quickly get scripts banned. This script utilizes quadtrees to try and minimize the number of sprites drawn to the screen, but please be responsible.

The code currently only draws the grid that the programmable block is on, but perhaps in the future I may add subgrid drawing support. That is only a possibility though and I didn't want to wait as I felt this was still quite useful/neat as is.

I'll continue to add features, bug fix, and optimize, but I figured it was time for me to stop sitting on this and get it out in the wild.

Also, happy new year! :)

- Whiplash141

(Do not reupload without permission, not even to mod.io)


  Ships Used in Example Images
For those interested in the ships I used in my pictures, here is a list in order of appearance:
Popular Discussions View All (3)
111
Feb 15 @ 3:06am
PINNED: Help/Questions (SIMPL)
Whiplash141
1
Nov 27, 2024 @ 7:53am
Tankturret and Hull stable on LCDs
Hailstorm
477 Comments
Whiplash141  [author]
Apr 2 @ 6:36pm 
Does it display at all?

Is the number of views for that screen set to 4 or larger?
Apr 2 @ 12:43am 
I've got my screen setup to show 4 views on one screen, Bottom, Port, and Starboard, and the fourth I want it to show the rear (Aft) but it doesn't seem to want to do that no matter what I tweak.

[SIMPL - Display Config - Screen 0 - View 4]
; View axis values: X, Y, Z, NegativeX, NegativeY, NegativeZ
View axis=NegativeX
Rotation (deg)=180
Scale=6
; Elements should range from -1 to 1 where 0 indicates centered
Position={X:0.8 Y:0}
Whiplash141  [author]
Mar 30 @ 5:42pm 
That is a good tip. I wish the game let you set the grid axes a bit more intuitively...
Mar 30 @ 9:51am 
@Leconite I've always had it working as intended, because I ensure that my grids` X,Y,and Z axes are known and defined. You should do the practice of deliberately setting your grid pivot's coordinate space by setting down a projector block as the very first block for any new grid, because this block tells you the axes, and then cutting and pasting your existing grid onto it to inherit them.

Turn on 'Show grid pivot' in the Info menu to see your ship's actual internal axes, because these are what the script uses to orient itself. Chances are your ship's internal orientation isn't what you are expecting, be it from cut/pasting or removing and rotating the initial block in your design process.
Feb 8 @ 4:05am 
I've never had an axis not work.
What I have found is that my idea of X,Y, and Z axes orientation are different than the script's idea of the same.
The solution has always been to iterate through them and / or their negative counterparts until the screen shows what I want.
Also check spacing and capitalization, I have made the mistakes of `Viewaxis=x` or `view axis=x` and wondered why it wasn't working. :-)
Whiplash141  [author]
Feb 7 @ 7:59pm 
What axis are you setting?
Feb 7 @ 6:57pm 
Why isnt it respecting the axis i set in the custom config?
Whiplash141  [author]
Feb 2 @ 4:29pm 
Nope, sorry
Feb 2 @ 2:31pm 
Hi, possible to see only one side and not all layers ?
Whiplash141  [author]
Jan 13 @ 8:09pm 
"draw multiple views onto a single display?"

Change "Number of views=1" to the number of views you want in the custom data of the block with screens in the SIMPL group. Then run setup and re-open the custom data. You change the draw view by changing the "View axis" setting in the custom data.