Space Engineers

Space Engineers

180 ratings
Floor Plan Script Mk1 Setup Guide
By Alysius
Setup Guide for Floor Plan Script Mk1
   
Award
Favorite
Favorited
Unfavorite
General
This script draws the Floor Plan Layout of your ship to a Text Panel. It is customizable with zooming, panning and manipulation of ship layout. Now drawn with Monospace Font.


This is a Vanilla Script. NO MODS are required.


NOTE: Script is heavy in processing. Not recommended to keep it running on MP/DS.


See Demonstration World at:
http://steamcommunity.com/sharedfiles/filedetails/?id=780912602
How To Setup
1) Create a Programmable Block and load this Floor Plan Script.
Note: You may get warnings when clicking Check Code or Compile, but that is totally fine. As long as it is not red box.


`

2) Create Text Panel and put a name tag "L_PANEL" to its Name, and set the Font to "Monospace". You can have more than one Text Panel to show different views.

`

3) Go to Programmable Block and enter RESET in the Argument field, then click Run.

`
`

5) Last but not least. Ensure ALL Ownership are properly set (e.g. Easiest is to set all to the same).

`


IMPORTANT NOTE: When the first time L_PANEL is populated, the ship's dimension and view settings (side view top view etc) are populated to the Title of the L_PANEL. After that first load, subsequent loading do not have this initial detection. In case you paste your onto other grid (or changed grid pivot point), floor plan may draw weird. You can fix this by clearing the Title of the L_PANEL -OR- Run the command ZOOM_RESET.



New Minor Features!

1) If you used half grinded Terminal Blocks (e.g. LCD Panels, Corner Lights etc) for decoration, it will show up as Yellow (i.e. Damaged) on the Floor Plan. To avoid this, add the line bExcludeHiddenBlocks=true to the Custom Data of the script's PB:

`

Then set Show block in terminal to Off for all those decoration blocks you do not want it to flag out as damaged:

`
One Floor Plan Across Multiple Panels

1) Put additional Text Panels beside the top left most "L_PANEL". Ensure the following rules are met:

- Only the Top Left most needs the "L_PANEL" name tag. DO NOT tag the others.
- All Text Panels are upright, of the same type and no gaps between them.
- All Text Panels have their Font set to Monospace.


`

2) Write the following settings to the Custom Data of the Programmable Block to define the Horizontal Count and Vertical Count of the number of panels (e.g. For 3 by 4 panels, set value to 3 and 4).

`
Setting Up Floor Plan Menu

1) Create Text Panel and put a name tag "L_MENU" to its Name (Can have more than one menu).

`

2) Setup buttons (on cockpits, button panels etc) to control the Floor Plan Menu.
The buttons trigger the Run Action of the Programmable Block with Argument as:
- UP
- DOWN
- ENTER
- BACK


`

3) Use the above actions to navigate the Floor Plan Menu.

`

NEW! Menu now shows the current value of each settings if specific Panel is chosen.

`
Setting Up Status Report

1) Create Text Panel and put a name tag "L_REPORT" to its Name (Can have more than one menu). Put in keywords to specify which status to display.

`

Enter the status type to be displayed into the Title of the L_REPORT in the following format:

<STATUS1>,<STATUS2>,<STATUS3> ... ... so on.

Example: HULL,TERM,TURRET (Shows the Hull Integrity, Terminal Integrity and Number of Shooting Turrets)

`

Group Status Feature

You can also display health of specific groups by name tag:

FUNCP/<Name Tag>/<Optional Label>

Example: FUNCP/LeftTurret/Left Side Turrets

(Shows functional verses total number of blocks with name containing "LeftTurret". Percentage bar also displayed)

Types of Group Status:

FUNC - Displays functional vs total number of blocks (Functional means enough health to function properly).
FUNCP - Displays functional vs total number of blocks, with percentage bar.
WORK - Displays working vs total number of blocks (Working means it is functional, powered and turned on).
WORKP - Displays working vs total number of blocks, with percentage bar.

`
Setting Up Alarm Events
Name your alarm block to be triggered in the following format (After renaming them, you MUST use RELOAD command to re-detect the alarm blocks you have just created):

L_ALARM_<EVENT>_<VALUE>

Example: L_ALARM_HULL_75 (Triggers when Hull Integrity falls below 75%)

`

You can also stack multiple events on one alarm block in the following format:

L_ALARM_<EVENT1>_<VALUE1>_<EVENT2>_<VALUE2>

Example: L_ALARM_HULL_75_HACK_2 (Triggers when Hull Integrity falls below 75% -OR- At least 2 blocks are Hacked)

You can also set as AND condition (i.e. All must satisfy in order to trigger) by using & instead of _ character:

Example: L_ALARM&HULL&75&HACK&2 (Triggers when Hull Integrity falls below 75% -AND- At least 2 blocks are Hacked)

However, you cannot mix OR and AND conditions together in the same alarm block at the moment.


You MUST use the RELOAD command to refresh the alarm blocks whenever you named a block L_ALARM. This is for the script to re-detect and pick them up (Script does not constantly poll for alarm blocks and must be explicitly reloaded via command, for performace purposes).


Types of Events:

HULL - Ship Hull Integrity. Triggers when it falls below the specified <VALUE> percentage.
TERM - Terminal Blocks Integrity. Triggers when it falls below the specified <VALUE> percentage.
VENT - Triggers when there are more than X number of Leaked Air Vents.
SENSOR - Triggers when there are more than X number of Sensor Objects Detected.
HACK - Triggers when there are more than X number of Blocks Hacked.
TURRET - Triggers when there are more than X number of Shooting Turrets (Works in Survival only).
Custom Data Configuration

You can set the Custom Data of the Programmable Block to specify various settings or change script variables, avoiding the need to edit the script everytime when updating to newer script versions.

Note: You MUST recompile the script everytime you changed the Custom Data in order for it to be effective.

Each variable must be specified in the following format, with each one on a new line:

<VARIABLE1>=<VALUE1>
<VARIABLE2>=<VALUE2>
<VARIABLE3>=<VALUE3>


Example:

REFRESH_INTERVAL=30
INSTRUCTION_PERCENT_LIMIT=0.1f


Example means: Refresh only at a maximum frequency of once every 30 ticks. Only use 10% (i.e. 0.1f) of the instruction limit before halting and waiting for next tick (to lighten CPU load).

Note: DO NOT put the C# keywords like "static float" in front. There must be NO semicolon behind each values. Also DO NOT enclose the values with " quotes.


Variable List

The available variables are exactly the same set as those available for editing in the script:

REFRESH_INTERVAL
Minimum number of ticks for each refresh (Def: 15. Note: 60 ticks = 1 second). This is the minimum number, since refresh rate may be reduced by script instruction count limit.

INSTRUCTION_PERCENT_LIMIT
Percentage number of maximum instruction count to use per tick (Def = 0.9f, which is 90%). You can reduce this to lighten the load on the CPU. Do not exceed 0.9f or lower than 0.01f.

HORIZONTAL_COUNT
Maximum number of tiled horizontal LCD Panels, for One Floor Plan Scross Multiple Panels (Def: 1). If there are multiple floor plans, set this to the Floor Plan with the largest array.

VERTICAL_COUNT
Maximum number of tiled vertical LCD Panels, for One Floor Plan Scross Multiple Panels (Def: 1). If there are multiple floor plans, set this to the Floor Plan with the largest array.

strDisplayPanelTag
Tag name of the Floor Plan Layout Panel (Def: L_PANEL).

strReportPanelTag
Tag name of the Floor Plan Panel (Def: L_REPORT).

strStatusPanelTag
Tag name of the Status Display Panel (Def: L_STATUS).

strMenuPanelTag
Tag name of the Floor Plan Menu Panel (Def: L_MENU).

strAlarmTag
Tag name of the Alarm Events Block (Def: L_ALARM).

bUseAlarmSystem
Whether to use Alarm System (Def: true). If set to false, script will not search for alarm blocks.

bOptimizedRender
Whether to use techniques to reduce pixel drawing, such as skipping empty lines (Def: true).

bExcludeHiddenBlocks
Whether to exclude processing of Terminal Blocks that have their Show block in terminal set to Off (Def: false). This is used for excluding Greebles (e.g. Half welded decoration blocks), as incomplete blocks will show as Yellow (damaged).

strExcludeAlertKeyword
Tag name to mark a Block to be excluded from triggering alerts on the Floor Plan (Def: [NOALERT]). Example, if a sensor has this tag in its name, it will not show as blinking red on the Floor Plan even if triggered.

strAlertBlockTypes
Types of block to track for alerts. This is expert settings, do not change if not clear (Def: AirVent,SensorBlock,Door,AirtightHangarDoor,AirtightSlideDoor,LargeGatlingTurret,LargeMissileTurret,InteriorTurret).
Run Commands (Expert)

To execute a command, add the script's Programmable Block to the Toolbar and set Action as Run, with the command as Argument.

The format of the command is:

<COMMAND>:<PANEL_ID>

If <PANEL_ID> is not specified, the command is applied to ALL LCD Panels. Commands REDRAW, RELOAD and RESET have no <PANEL_ID> and it will be triggered for all LCD Panels.

Example:

SPIN_CW:2 ---------- Spins Clockwise the layout of LCD Panel 2
ZOOM_IN ---------- Zoom In the layout of ALL LCD Panels

The list of available commands are listed below:

REDRAW
Trigger a redraw of the screen. This is used when the Panel Parameter is changed and a redraw is required. For manipulation commands (e.g. ZOOM_IN, PAN_LEFT etc), there is no need to trigger this as it is automatic.

RELOAD
Re-detects all Text Panels again (L_PANEL, L_REPORT, L_MENU, L_STATUS). This can be used for reloading newly replaced Text Panels without reseting script.

RESET
Trigger a full recalculation. This has the same effect as recompiling the script. Usually not used unless full reset is required.

DENSE
Show density.

NO_DENSE
Hide density.

TOGGLE_DENSE
Toggle show/hide density.

RELDENSE
Use relative density. Script will calculate density based on how much gap there is instead of how many blocks are occupying that screen pixel.

NO_RELDENSE
Do not use relative density. Script will calculate density based how many blocks are occupying that screen pixel instead of on how much gap there is.

TOGGLE_RELDENSE
Toggle between using relative density.

TERMDENSE
Include terminal blocks when calculating density.

NO_TERMDENSE
Exclude terminal blocks when calculating density.

TOGGLE_TERMDENSE
Toggle between including of terminal blocks when calculating density.

SMOOTH
Draw edges as slanted for a better and less jagged look.

NO_SMOOTH
Draw edges as cube boxes.

TOGGLE_SMOOTH
Toggle between drawing edges as slanted and drawing edges as cube boxes.

TERM
Show terminal blocks.

NO_TERM
Hide terminal blocks.

TOGGLE_TERM
Toggle show/hide terminal blocks.

ALERT
Show functional block alerts.

NO_ALERT
Hide functional block alerts.

TOGGLE_ALERT
Toggle show/hide functional block alerts.

BLINK
Show alerts as blinking.

NO_BLINK
Show alerts as static solid box.

TOGGLE_BLINK
Toggle between showing alerts as blinking and static solid box.

CROSS
Draw alert blocks as cross.

NO_CROSS
Draw alert blocks as solid blocks.

TOGGLE_CROSS
Toggle between drawing alert blocks as cross and solid blocks.

TOGGLE_MARKER
Show of You Are Here Location Marker.

NO_MARKER
Hide of You Are Here Location Marker.

TOGGLE_MARKER
Toggle Show/Hide of You Are Here Location Marker.

TOGGLE_AL_VENT
Toggle between showing of Leaking Air Vents (Alert blocks must be enabled). This manipulates the AL_MASK to achieve this.

TOGGLE_AL_SENSOR
Toggle between showing of Sensor Detected Objects (Alert blocks must be enabled). This manipulates the AL_MASK to achieve this.

TOGGLE_AL_TURRET
Toggle between showing of Shooting Turrets (Alert blocks must be enabled). This manipulates the AL_MASK to achieve this.

TOGGLE_AL_DOOR
Toggle between showing of Opened Doors (Alert blocks must be enabled). This manipulates the AL_MASK to achieve this.

TOGGLE_AL_HACKED
Toggle between showing of Hacked Blocks (Terminal blocks must be enabled). This manipulates the AL_MASK to achieve this.

DEFAULT_VIEW
Load the Panel Parameters saved in Custom Data into the Title. This is a reload function in case you mess up.

REMEMBER_VIEW
Save current Panel Parameters into Custom Data. This allows use of DEFAULT_VIEW later to load state.

ZOOM_IN
Zoom in the display.

ZOOM_OUT
Zoom out the display.

ZOOM_IN_FAST
Zoom in the display fast.

ZOOM_OUT_FAST
Zoom out the display fast.

ZOOM_RESET
Reset zoom. Display shows full ship again.

FLIP_LEFT
FLIP_RIGHT
FLIP_UP
FLIP_DOWN
Flip the display to see the respective side (e.g. FLIP_LEFT will rotate the current view to show the left side)

SPIN_CW
Spin clockwise.

SPIN_CCW
Spin counter clockwise.

SHRINK_SLICE
Decrease the Z-Axis (Depth). This is similar to Zoom In, except it is for Z-Axis.

EXPAND_SLICE
Increase the Z-Axis (Depth). This is similar to Zoom Out, except it is for Z-Axis.

INC_HDENSITY
Increase the number of blocks to be shaded as High Density, by decreasing the High Density threshold (Lesser blocks/depth required to be calculated as high density).

DEC_HDENSITY
Decrease the number of blocks to be shaded as High Density, by increasing the High Density threshold (More blocks/depth required to be calculated as high density).

INC_MDENSITY
Increase the number of blocks to be shaded as Medium Density, by decreasing the Medium Density threshold (Lesser blocks/depth required to be calculated as medium density).

DEC_MDENSITY
Decrease the number of blocks to be shaded as Medium Density, by increasing the Medium Density threshold (More blocks/depth required to be calculated as medium density).

INC_LDENSITY
Increase the number of blocks to be shaded as Low Density, by decreasing the Low Density threshold (Lesser blocks/depth required to be calculated as low density).

DEC_LDENSITY
Decrease the number of blocks to be shaded as Low Density, by increasing the Low Density threshold (More blocks/depth required to be calculated as low density).

PAN_LEFT
PAN_RIGHT
PAN_UP
PAN_DOWN
Pan the display respectively.

PAN_FORWARD
PAN_BACKWARD
Pan the display depth respectively.

PLUS_LEFT
PLUS_RIGHT
PLUS_UP
PLUS_DOWN
PLUS_FORWARD
PLUS_BACKWARD
Add grid value to the respective side (e.g. PLUS_LEFT will increase the grid value of the left side display. The axis value added depends on which Grid Axis is shown on screen).

MINUS_LEFT
MINUS_RIGHT
MINUS_UP
MINUS_DOWN
MINUS_FORWARD
MINUS_BACKWARD
Subtract grid value to the respective side (e.g. MINUS_LEFT will decrease the grid value of the left side display. The axis value subtracted depends on which Grid Axis is shown on screen).

LIGHTEN
Lighten the display.

DARKEN
Darken the display.

TOGGLE_IMAGE
Toggle between showing floor plan and showing image.

SHOW_HIDE_NUMBER
Toggle between showing floor plan and panel number (For multiple panels, to identify which panel is which number).
Panel Parameters (Expert)

If the script is executed without a parameter string specified, it will output the full setting to the Title of L_PANEL. This is for ease of editing.
To edit the parameter string, input the string to the Title of L_PANEL and execute Run Command called REDRAW (See Run Commands Section for more information).

The parameter string is specified in the following comma delimited format:

<PARAM1>,<PARAM2>,<PARAM3> ...

Where PARAM is one of the following:

A_X:<Value> (e.g. A_X:Y) {Value can be: X, -X, Y, -Y, Z, -Z}
Use the specified Grid Axis as the horizontal display.

A_Y:<Value> (e.g. A_Y:-Z) {Value can be: X, -X, Y, -Y, Z, -Z}
Use the specified Grid Axis as the vertical display.

X1:<Value> (e.g. X1:-3)
Set the lower boundary of the Grid Axis X.

X2:<Value> (e.g. X2:5)
Set the upper boundary of the Grid Axis X.

Y1:<Value> (e.g. Y1:-3)
Set the lower boundary of the Grid Axis Y.

Y2:<Value> (e.g. Y2:5)
Set the upper boundary of the Grid Axis Y.

Z1:<Value> (e.g. Z1:-3)
Set the lower boundary of the Grid Axis Z.

Z2:<Value> (e.g. Z2:5)
Set the upper boundary of the Grid Axis Z.

SMOOTH
Draw edges as slanted for a better and less jagged look.

NO_SMOOTH
Draw edges as cube boxes.

RELDENSE
Use relative density. Script will calculate density based on how much gap there is instead of how many blocks are occupying that screen pixel.

NO_RELDENSE
Do not use relative density. Script will calculate density based how many blocks are occupying that screen pixel instead of on how much gap there is.

TERMDENSE
Include terminal blocks when calculating density.

NO_TERMDENSE
Exclude terminal blocks when calculating density.

DENSE
Display block density. Higher block depth will be shown as fuller solid box.

NO_DENSE
Do not display block density.

TERM
Display terminal blocks.

NO_TERM
Do not display terminal blocks.

ALERT
Show functional block alerts.

NO_ALERT
Hide functional block alerts.

BLINK
Show alerts as blinking.

NO_BLINK
Show alerts as static solid box.

CROSS
Draw alert blocks as cross instead of solid blocks.

NO_CROSS
Draw alert blocks as solid blocks.

MARKER
Show You Are Here Location Marker.

NO_MARKER
Hide You Are Here Location Marker.

AL_MASK
Mask to indicate which alert blocks to capture (1 byte = 8 bits. Only the least significant 5 is used). 00000001 = Show Leaking Air Vents. 00000010 = Show Sensor Detected Objects. 00000100 = Show Shooting Turrets (Survival only). 00001000 = Show Opened Doors. 00010000 = Show Hacked Blocks. Example: 00001001 = Show Opened Doors and Leaking Air Vents.

THR_HDENSE
High Density Threshold. The high the number, the more percentage blocks/depth required for that position to be drawn as high Density. Max is 1.

THR_MDENSE
Medium Density Threshold. The high the number, the more percentage blocks/depth required for that position to be drawn as medium Density. Max is 1.

THR_LDENSE
Low Density Threshold. The high the number, the more percentage blocks/depth required for that position to be drawn as low Density. Max is 1.

PIXEL
Set pixel size. Pixel size 1 = font size 0.1f, pixel size 2 = font size 0.2f and so on. Max is pixel size 10.


Example

A_X:-X,A_Y:Z,X1:1,X2:5,Y1:-10,Y2:-6,TERM,NO_BLINK

Meaning:

A_X:-X => Use the reverse of the ship's Grid Axis X as the horizonal display.
A_Y:Z => Use ship's Grid Axis Z as the vertical display.
X1:1 => Limit Grid Axis X to minimum value of 1.
X2:5 => Limit Grid Axis X to maximum value of 5.
Y1:-10 => Limit Grid Axis Y to minimum value of -10.
Y2:-6 => Limit Grid Axis Y to maximum value of -6.
TERM => Display terminal blocks.
NO_BLINK => Do not display blinking alerts.

Note: Grid axis values do not neccessary start at 0. This is highly dependend on how the Griv Pivot is position on your ship.
< >
107 Comments
Seven of Thr4wn Apr 13 @ 3:10pm 
@Alysius what types of alarm blocks Are there?
[πrat] Medic Jan 29 @ 6:51pm 
@SmikkelAiden I know you can use NetWork as a middleman between scripts to accomplish that but as of right now I don't know if it's been updated in the 3 years since I've used it.
SmikkelAiden Jan 29 @ 8:06am 
How does this work with parts of ships (like wings) on rotors? Any way of showing those on the same LCD aswell?
KagedDeamon Jan 25 @ 2:54pm 
So anyone know why even when I use the refresh command my lcds don't update?
ДѴДЯЦS LЦЖ Jan 1 @ 5:19am 
i am trying to have the L_REPORT panel to give feedback on my interior turrets, but it doesn' t seem to see them?

HULL,,TERM,,VENT,,FUNCP//Total Functional blocks,,FUNCP/TURRETS/Functional Turrets,,TURRET,,FUNCP/SOLARP/Functional Solar panels,,

the first FUNCP works just fine, but the second and third doesn't seem to work and it doesn't seem to matter which block group i try to assign be it doors, turret's, solar panels... etc.

what i found is if i type in a term as if it is a search query it works... is this intentional?

also, if i grind one turret down it still shows it as functional as 7/7, even though on the floorplan it is indicated yellow.

EDIT: i think this L_REPORT function is pretty much broken, damaged (grinder) hull blocks or turrets aren't affecting hull integrity or functional block count... vent count seems to work though...
CrazyLegoMan Oct 12, 2020 @ 1:40pm 
What blocks does this work on?
CrazyLegoMan Oct 12, 2020 @ 1:15pm 
i put alarm events on doors and even when the hull is lower than what i put the doors/ gates do not close.
[πrat] Medic Aug 29, 2020 @ 4:04am 
Actually, better question(and I found a way around my previous question), how do I make it keep my rotations when pasting a new ship in or constructing a new one from a projector?
[πrat] Medic Aug 29, 2020 @ 12:48am 
Is there a way to keep certain LCD groups to show specific angles? I have a small grid with transparent LCDs and they are all right next to each other(pretty cramped ship) and the one that is suppose to show the 1x2 image is trying to show a 2x2 image and is causing the lcd next to it to stutter back and forth between one image and another. Is there also a way to exempt LCDs from this script? I have some LCDs I don't want to be showing diagnostics.
mcbobbo Apr 28, 2020 @ 8:56pm 
I was able to get it in a console block by mirroring an LCD using LCDTransfert