Space Engineers

Space Engineers

Block Restrictions
 This topic has been pinned, so it's probably important
jTurp  [developer] 3 Dec, 2020 @ 10:12pm
MODDERS: How to add a default restriction setting for mod blocks
If you want to upload your block with a default restriction setting, you can create an EntityComponents.sbc file and Block Restrictions will grab it on start up. Below is an example sbc to get you started.

<?xml version="1.0"?> <Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <EntityComponents> <EntityComponent xsi:type="MyObjectBuilder_InventoryComponentDefinition"> <Id> <TypeId>Inventory</TypeId> <SubtypeId>BlockRestrictions_Test</SubtypeId> </Id> <Description> [?xml version="1.0" encoding="utf-16"?] [DefaultSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"] [DefaultSetting] [Type]MyObjectBuilder_RemoteControl/SmallBlockRemoteControl[/type] [PlayerMaxCount]0[/playermaxcount] [GridMaxCount]0[/gridmaxcount] [FactionMaxCount]0[/factionmaxcount] [AllowedForNPC]true[/allowedfornpc] [AllowedForPlayer]true[/allowedforplayer] [AllowedForUnowned]true[/allowedforunowned] [AllowedForNPCStaticOnly]false[/allowedfornpcstaticonly] [AllowedForPlayerStaticOnly]false[/allowedforplayerstaticonly] [AllowedForUnownedStaticOnly]false[/allowedforunownedstaticonly] [/defaultsetting] [/defaultsettings] </Description> </EntityComponent> </EntityComponents> </Definitions>

To use this, two things are required:
  1. The SubtypeId must start with "BlockRestrictions" and needs to contain a unique value from ALL other entity component ids. Suffix it with _YourModName or whatever to ensure it's good to go. You can have multiple for your mod, as well, just add a number at the end :)
  2. Add a DefaultSetting section (copy / paste and update) for each mod block you want to create a setting for. Note that the section uses brackets instead of arrows - this is required to allow for nesting the xml within the Description field of the entity component container.

That's it! Let me know if you have any issues :)

NOTE: The editor decided to make things lower case that should not be - ensure that the closing tags mirror the open tags, ie "AllowedForPlayer" and not "allowedforplayer"
Last edited by jTurp; 4 Dec, 2020 @ 12:47pm
< >
Showing 1-2 of 2 comments
Zoekoff 4 Oct, 2021 @ 11:59pm 
Would this override what admins write for restrictions?
jTurp  [developer] 5 Oct, 2021 @ 12:00pm 
Originally posted by Zoekoff:
Would this override what admins write for restrictions?

No, this is just a *default* setting. Admins can still alter the config afterward and that will take priority.
< >
Showing 1-2 of 2 comments
Per page: 1530 50