Space Engineers

Space Engineers

336 ratings
Whip's Missile Status Script (for WHAM)
2
3
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
557.403 KB
14 Nov, 2020 @ 7:33pm
8 Apr, 2024 @ 12:54am
12 Change Notes ( view )

Subscribe to download
Whip's Missile Status Script (for WHAM)

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


  Description
This script provides a graphical display of the status of WHAM missiles on LCD panels or blocks with multiple display surfaces like cockpits. When a particular missile is detected by the script, it will display a green missile icon and, when it is missing, it will display a red icon instead (by default). You can customize things like color and position in the custom data of the programmable block and display screens.


  Setup Instructions
General Instructions
  1. Place this script into a programmable block
  2. Add text panels, LCDs, and/or blocks with multiple display screens to a group named "Missile Status"
  3. In the Custom Data of the display screen blocks, configure their custom data to display the missile icons that you want. See the section Custom Data Config - Display Screens below for more details.
  4. To process any block changes or Custom Data changes, you must recompile the script

Custom Data Config - Display Screens
This section covers the configuration of the Custom Data of the display screen blocks.
  1. To add a missile icon to a display screen, open the Custom Data of the block and add the WHAM missile group name in brackets. For example:
    [Missile 1]
    The name needs to match a WHAM missile name tag exactly for the script to properly detect the missile.

  2. Recompile the code and then re-open the Custom Data of the block.

    If the block has multiple display screens, the Custom Data should now look like this:
    [Missile 1] Sprite location=0, 0 Sprite scale=1 Sprite rotation (deg)=0 Screen index to display on=0
    Set the "Screen index to display on" to the particular screen that you want to display the icon on.

    If the block has a single display screen, the "Screen index to display on" key will not be present:
    [Missile 1] Sprite location=0, 0 Sprite scale=1 Sprite rotation (deg)=0

    Note: The "Sprite location" coordinates range from -1, -1 (top left of the screen) to 1, 1 (bottom right of the screen). You can use decimals to place it somewhere in-between. The first number is the horizontal (X) offset, the second number is the vertical (Y) offset.

  3. Recompile the script to process any Custom Data changes.
  4. Repeat this process for all the missiles you wish to display.

Custom Data Config - Programmable Block
This section covers the configuration of the Custom Data of the programmable block that runs this script.
Note: A programmable block can also be used for its display screens as well.

Programmable block Custom Data will automagically be populated with the following default config the first time it is compiled:
[Missile Status Screens - General Config] Status screen group name=Missile Status Missile group name tag=Missile Show title bar=false Title scale=1 Missile ready color=0, 75, 0, 255 Missile inactive color=75, 75, 0, 255 Missile fired color=25, 25, 25, 255 Title bar color=25, 25, 25, 255 Title text color=150, 150, 150, 255 Background color=0, 0, 0, 255 Global sprite scale=0.25 ; You can create your own sprites using the SE Sprite Builder ; https://gitlab.com/whiplash141/spritebuilder/-/wikis/home Sprite list=
You can change these if you desire, then recompile the code to process changes.

If you want to use a custom sprite for the missile icon, you can use the custom data export of the Sprite Builder[gitlab.com] app to set the Sprite list key accordingly. If you do not care, just leave it blank.


  Author's Notes
If you have issues are need help, please leave a comment in the "Help/Questions" discussion thread for this script.

Ship pictured in the thumbnail is the Komodo Guided Missile Destroyer Mk 2.

(Do not reupload without permission, not even to mod.io)
Popular Discussions View All (1)
31
29 Jan, 2022 @ 5:59am
PINNED: Help/Questions
Whiplash141
55 Comments
mhwyoshi 8 Jan @ 5:00pm 
How do I put custom data config into the screens of the fighter cockpit?
mhwyoshi 8 Jan @ 4:59pm 
So I got it showing on one screen, but I only have the cockpit and I wanted to show all the missiles on the upper left screen. It says that there’s one available, but it doesn’t show where it is. I tried adding “Missile Status” the cockpit name but that doesn’t seem to do anything. I’ve tried putting it in the custom data of the programmable block below the current data of it, and that didn’t seem to do anything. I also tried putting it in the custom data of the cockpit above and below the current lamp information and it still doesn’t show anything. I tried messing with the numbers and that didn’t do anything. What exactly am I doing wrong? I did also recompile the programmable blockevery time I change things.
Whiplash141  [author] 12 Aug, 2023 @ 8:40pm 
I literally just spawned that ship and the screens work fine. The script is not broken, I'm actively using it.

If there is no valid custom data config in the screens themselves, they will not be registered as a text surface.
Da_MLG_man 12 Aug, 2023 @ 5:45pm 
Da_MLG_man 12 Aug, 2023 @ 5:44pm 
I should mention the script is broken in the Kimodo Missile Destroyer as well, which was an example craft you linked in at the end of the guide to set up a WHAM/LAMP missile launcher.
(this is the ship)https://steamproxy.net/sharedfiles/filedetails/?id=2108857776
Da_MLG_man 12 Aug, 2023 @ 5:06pm 
Yes, I put the config in custom data. The script is Echoing "0 text surfaces detected" but not the "block group <name> not found" error, indicating it did find the block group but apparently could not find the text surfaces inside the block group.
Whiplash141  [author] 12 Aug, 2023 @ 12:43pm 
Did you put the custom dara config in the custom data and *not* the text?
Da_MLG_man 12 Aug, 2023 @ 12:11pm 
I copy-pasted the LCD Setup exactly from the example ship and it is not working. Not sure why, it seems to detect the group i set up but not the LCDs in the group. Renamed all of the and everything but it still does not detect them
Siam 17 Apr, 2023 @ 7:54am 
Thank you keen ^^
Whiplash141  [author] 17 Apr, 2023 @ 6:49am 
There is literally nothing to work with. Those blocks are black boxes with very little useful API.