Space Engineers

Space Engineers

50 ratings
LCD On Subparts (Framework)
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Script
File Size
Posted
Updated
200.160 KB
16 Jun, 2023 @ 1:55am
8 Jul, 2023 @ 10:27am
5 Change Notes ( view )

Subscribe to download
LCD On Subparts (Framework)

In 1 collection by Digi
Digi's Space Engineers mods
50 items
Description
This is a tool for modders to be able to clone LCDs onto subparts. It does nothing on its own.



Known issues so far:
- (Fixed) Text&Image with no text doesn't work (will be fixed soon)
- (Workaround in place) Sometimes cloned texture remains black for some unknown reason, still investigating...


Player use:

Nothing =)

If a mod uses this, they'll add it as a dependency which will automatically be added to world alongside, does not matter if you're subscribed to this or not.


Modder use
  1. Decide block type to use
    The block must support LCD for this framework to work.

    Any block that has on/off can support LCDs but Keen hasn't properly made them do that. See: Fix LCD support mod

    In that fix mod's description, types marked with "Caution" should be extensively tested with their original function.


  2. Model/material setup
    This framework takes the generated texture from each LCD and applies it to CloneLCD* materials on all subparts (including subparts of subparts, no matter how deep that goes).

    Where * is the surface's number, starting from 0 and it's same order as in sbc or terminal.
    Example: make materials called CloneLCD0 and CloneLCD1 for a block with 2 LCDs.

    Material's technique can be whatever you want, including HOLO or ALPHA_MASKED (framework gives LCD texture as the alphamask texture too, experiment away!)


  3. SBC setup
    You of course need the <ScreenAreas> tag to define LCDs, but aside from that you need a <ModExtensions> tag for the DefinitionExtensionAPI mod to add the gamelogic of this framework to your block.

    Simply add this to every block definition you want this mod to work on:
    <ModExtensions> <ModComponents> <GameLogicComponent Name="LCDOnSubparts" Enabled="true" /> </ModComponents> <Group Name="LCDOnSubparts"> <!-- Debug printing on HUD, default false. --> <Boolean Name="Debug" Value="false" /> <!-- Camera distance from block for cloning to happen, also when force-generated texture first happens. Set it as low as possible. Max 120, default 32. --> <Decimal Name="UpdateDistance" Value="32" /> </Group> </ModExtensions>
    The <Group> section is optional and defaults will be used if not present.


  4. DefinitionExtensions.txt
    Add a DefinitionExtensions.txt in your Data folder.
    Then inside this text file list all the .sbc file names that have the ModExtensions tag in them.

    This is for DefinitionExtensionAPI mod to be able to find them because there's no way in SE API to list files from mods, we can only read specific file paths.

    In more words how the DefinitionExtensionAPI stuff works from a modder-user perspective: https://semref.atlassian.net/wiki/spaces/tools/pages/28999735/ModExtensions

Now it should be ready for testing in game!


This mod can also allow multiple transparent LCDs:

Normally you can only have 1 transparent LCD and no other LCDs, otherwise they don't function properly.

With this mod however you can circumvent that like so:
1. First familiarize yourself how the mod works from the guide above.
2. Use non-transparent LCDs on the main model so that they all function properly.
3. Make one subpart with all your transparent clone LCDs (or more subparts if you want, doesn't matter).
4. The CloneLCD<n> material must be HOLO technique in blender or model xml.
5. Important: This mod includes transparent materials CloneLCD0 to 9, do not declare them in your mod because everyone uses the same names.



mod io?
Please read[gist.github.com]
6 Comments
Krynoc 20 Jun, 2023 @ 4:46am 
This mod is using the framework, if anyone would like to test.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2991494080
Titan Nya 19 Jun, 2023 @ 2:49pm 
Interesting concept! Gonna wait for mods to use it xD
Valderci 19 Jun, 2023 @ 7:07am 
I....am....drooling :selike:
Chipstix213 18 Jun, 2023 @ 11:52am 
i recognise that door!
Cthulhu 17 Jun, 2023 @ 9:09am 
slurp!
kilotick 16 Jun, 2023 @ 5:07pm 
I can already imagine a ton of cool uses for this, especially in animated cockpits.
I can't wait so see this expand!