Space Engineers

Space Engineers

631 arvostelua
Definition Extension API
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Type: Mod
Mod category: Script, Other
Tiedostokoko
Julkaistu
Päivitetty
186.766 KB
17.2.2022 klo 23.04
28.1.2024 klo 14.38
19 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Definition Extension API

Kuvaus
API mod to add a custom <ModExtensions> Tag to any SBC file. Definitions can then be loaded by any mod using DefinitionExtensionsAPI.cs (included in this mod) and adding this mod as a dependency.

Block mods do not need to add this mod as a dependency, just have a text file named DefinitionExtensions.txt in the root of the Data directory listing every sbc or xml file that contains definition extensions.

Supported definitions:
CubeBlock
Components
PhysicalItems
PlanetGeneratorDefinitions
EnvironmentDefinition

Example tag and tag types below: Multiple tags of the same type are supported, tags with the same "Name" and type will override each other, mods can mod other mod's tags, mod load order determines what is precedent.
<ModExtensions> <Group Name="TestGroup"> <Text Name="sTest" Value="Test String" /> <!-- strings --> <Integer Name="Test" Value="10" /> <!-- integer values (whole numbers) Max value 9223372036854775807--> <Boolean Name="bTest" Value="false" /> <!-- true or false --> <Decimal Name="dTest" Value="1" /> <!-- any decimal number ex. 0.14333333 --> <Vector2I Name="v2iTest" X="1" Y="1" /> <!-- Integer valued 2 axis vector --> <Vector2D Name="v2dTest" X="1" Y="1" /> <!-- Decimal valued 2 axis vector --> <Vector3I Name="v3iTest" X="1" Y="1" Z="1" /><!-- Integer valued 3 axis vector --> <Vector3D Name="v3dTest" X="1" Y="1" Z="1" /> <!-- Decimal valued 3 axis vector --> <Color Name="cTest" R="255" G="0" B="0" A="255" /><!-- Color in R G B A, values can be between 0 and 255--> </Group> </ModExtensions>

Mod now also supports custom gamelogic loading. This still is in the experimental stage, so please report any issues on my discord. Format is below. Mods can register a gamelogic component to the name and it will be loaded for any block that includes the SBC tag with the same name.
<ModExtensions> <ModComponents> <GameLogicComponent Name="TestComponent" Enabled="true" /> <!-- Enabled is by default true, but can be set to false to disable a custom gamelogic component--> </ModComponents> <Group Name="TestGroup"> <Text Name="sTest" Value="Test String" /> <!-- strings --> <!-- etc --> </Group> </ModExtensions>

API also provides an easy method for deploying terminal controls with your MyTSSCommon script! See the API files for details or ask on my discord or in the Keen discord in #modding-programming.


Mods looking to implement this mod and read the assigned values via script can copy Steam\steamapps\workshop\content\244850\2756894170\Data\Scripts\DefinitionExtensions\DefinitionExtensionsAPI.cs into their mod.

Wiki page with examples: SE Wiki[spaceengineers.wiki.gg] (Thanks Digi!)

Questions? Help? Discord link is below.
Discord
Discord[discord.gg]
31 kommenttia
BLM's Strongest Warrior 29.11. klo 23.54 
@DraygoKorvan

Before sending it over, I did a little more debugging and found the source of my crash. I completely forgot that I had pulsar and some plugins running. In my case, it was the 'SEWorldLoadBoost' plugin. Apologies for not catching that sooner.

@chrishoule1366
@jarhead

If you two happen to be running that plugin as well, go ahead and disable it if you want to use mods that require definition expansion api.
DraygoKorvan  [tekijä] 29.11. klo 20.33 
@BLM's Strongest Warrior please submit the crash log on my discord. (spaceengineers.log)
@chrishoule1366 same
chrishoule1366 28.11. klo 9.29 
i can as well it definitly is causing crashes same error code crash code
BLM's Strongest Warrior 18.11. klo 19.13 
Can confirm what Jarhead's saying. The mod causes crashes. I can run a game for a time, but running this mod will inevitably lead to a save becoming unloadable until I uninstall the mod.
jarhead 8.11. klo 14.29 
I have already done the delete and redownload 2x. It needs an update.
jarhead 8.11. klo 14.28 
2025-11-08 16:16:33.529 - Thread: 1 -> Error - Below crash is caused by the API mod being the incorrect version. Delete steamapps\workshop\content\244850\2756894170 to force a redownload
2025-11-08 16:16:33.700 - Thread: 1 -> Error: Error during loading session:System.NullReferenceException: Object reference not set to an instance of an object.
at Draygo.BlockExtensionsAPI.DefinitionExtensionsAPI.recieveModHandlers(Object obj)
at Sandbox.ModAPI.MyAPIUtilities.SendModMessage(Int64 id, Object payload)
at Draygo.BlockExtensionsAPI.DefinitionExtensionsAPICore.LoadData()
at Sandbox.Game.World.MySession.LoadComponent(MySessionComponentBase component)
at Sandbox.Game.World.MySession.LoadDataComponents()
DraygoKorvan  [tekijä] 4.10. klo 17.21 
Thanks digi
FurtherV 20.8.2024 klo 6.11 
The link to SEMREF sems dead, is there any alternative?
DraygoKorvan  [tekijä] 16.4.2024 klo 15.22 
No. Mod isn't compatible for crossplay anyway.