Blockdefinition (moddinghints): Difference between revisions

From Medieval Engineers Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:
    
    
<source lang="xml">
<source lang="xml">
   <Definition xsi:type="MyObjectBuilder_CubeBlockDefinition"> // definition type
   <Definition xsi:type="MyObjectBuilder_CubeBlockDefinition"> <!-- definition type -->
   <Id Type="CubeBlock" Subtype="StoneCube" /> // definition id  
   <Id Type="CubeBlock" Subtype="StoneCube" /> <!-- definition id -->
   <DisplayName>DisplayName_Block_StoneBlockCube</DisplayName> // display name used for the block in-game (mods don't support localization)
   <DisplayName>DisplayName_Block_StoneBlockCube</DisplayName> <!-- display name used for the block in-game (mods don't support localization) -->
   <BlockPairName>StoneBlockCube</BlockPairName> // block pair name is used together with block position (a separate definition) to position the block within the G-screen grid
   <BlockPairName>StoneBlockCube</BlockPairName> <!-- block pair name is used together with block position (a separate definition) to position the block within the G-screen grid -->
   <Public>true</Public> // whether or not the definition is accesible to players (Default: true)
   <Public>true</Public> <!-- whether or not the definition is accesible to players (Default: true) -->
   <Icon>Textures\GUI\Icons\cubes\StoneCube.dds</Icon> // icon(s) used in the gui
   <Icon>Textures\GUI\Icons\cubes\StoneCube.dds</Icon> <!-- icon(s) used in the gui -->
   <CubeSize>Large</CubeSize> // what grid size the block is using (large / small) (Default: Large)
   <CubeSize>Large</CubeSize> <!-- what grid size the block is using (large / small) (Default: Large) -->
   <BlockTopology>TriangleMesh</BlockTopology> // this can be Cube or TriangleMesh (but Cube won't work in ME, it is only useful for SE armor blocks)
   <BlockTopology>TriangleMesh</BlockTopology> <!-- this can be Cube or TriangleMesh (but Cube won't work in ME, it is only useful for SE armor blocks) -->
   <Size x="1" y="1" z="1" /> // how many blocks in each direction does the block occupy (Default: 0,0,0) (Default value will make game sad :P)
   <Size x="1" y="1" z="1" /> <!-- how many blocks in each direction does the block occupy (Default: 0,0,0) (Default value will make game sad :P) -->
   <ModelOffset x="0" y="0" z="0" /> // offset of the model within the block space (Default: 0,0,0)
   <ModelOffset x="0" y="0" z="0" /> <!-- offset of the model within the block space (Default: 0,0,0) -->
   <Model>Models\Cubes\Large\StoneCube.mwm</Model> // model for the fully built block
   <Model>Models\Cubes\Large\StoneCube.mwm</Model> <!-- model for the fully built block -->
   <BuildProgressModels> // building progression models
   <BuildProgressModels> <!-- building progression models -->
   <Model BuildPercentUpperBound="0.5" File="Models\Cubes\large\StoneCube_Construction_1.mwm"> // What block model to use if build integrity is below specified threshold
   <Model BuildPercentUpperBound="0.5" File="Models\Cubes\large\StoneCube_Construction_1.mwm"> <!-- What block model to use if build integrity is below specified threshold -->
   <MountPointOverrides> // overrides for mountpoints, if necessary (To prevent players from attaching to the top of an unfinished block for example)
   <MountPointOverrides> <!-- overrides for mountpoints, if necessary (To prevent players from attaching to the top of an unfinished block for example) -->
   <MountPoint Side="Top" Enabled="false" />  
   <MountPoint Side="Top" Enabled="false" />  
   </MountPointOverrides>
   </MountPointOverrides>
   </Model>
   </Model>
   </BuildProgressModels>
   </BuildProgressModels>
   <MountPoints> // mount points for the block, can specify multiple for each side (Default: all sides have some kind of a mount point)
   <MountPoints> <!-- mount points for the block, can specify multiple for each side (Default: all sides have some kind of a mount point) -->
     <MountPoint Side="Front" StartX="1.0324" StartY="-0.03239999" EndX="-0.032400012" EndY="1.0324" />
     <MountPoint Side="Front" StartX="1.0324" StartY="-0.03239999" EndX="-0.032400012" EndY="1.0324" />
     <MountPoint Side="Back" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
     <MountPoint Side="Back" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
Line 30: Line 30:
     <MountPoint Side="Bottom" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
     <MountPoint Side="Bottom" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
   </MountPoints>
   </MountPoints>
   <MirroringY>Z</MirroringY> // for mirrored building, I don't think is is useful for ME
   <MirroringY>Z</MirroringY> <!-- for mirrored building, I don't think is is useful for ME -->
   <MirroringZ>Y</MirroringZ> // (Default: None)
   <MirroringZ>Y</MirroringZ> <!-- (Default: None) -->
   <BuildTimeSeconds>6</BuildTimeSeconds> // how much time you need to build the block (Default: 10)
   <BuildTimeSeconds>6</BuildTimeSeconds> <!-- how much time you need to build the block (Default: 10) -->
   <Direction>Horizontal</Direction> // I honestly don't know (Default: Both)
   <Direction>Horizontal</Direction> <!-- I honestly don't know (Default: Both) -->
   <Rotation>Vertical</Rotation> // which way the block can be rotated (Default: Both)
   <Rotation>Vertical</Rotation> <!-- which way the block can be rotated (Default: Both) -->
   <BuildType>Cube</BuildType> // used for additional model generators (irrelevant if you don't want to use it as generated block or with generated blocks)
   <BuildType>Cube</BuildType> <!-- used for additional model generators (irrelevant if you don't want to use it as generated block or with generated blocks) -->
   <PhysicalMaterial>Stone</PhysicalMaterial> // physical material of the block (determines the strength of material, contact sounds, particles and maybe something else)
   <PhysicalMaterial>Stone</PhysicalMaterial> <!-- physical material of the block (determines the strength of material, contact sounds, particles and maybe something else) -->
   <Components> // components used for building one of these blocks (every block needs at least a component - integrity / total component count is used to calculate how much integrity the block can have with currently built components)
   <Components> <!-- components used for building one of these blocks (every block needs at least a component - integrity / total component count is used to calculate how much integrity the block can have with currently built components) -->
     <Component Tag="ScrapWood" Count="10" /> // Tag = any item matching the specified tag can be used here
     <Component Tag="ScrapWood" Count="10" /> <!-- Tag = any item matching the specified tag can be used here -->
     <Component Type="InventoryItem" Subtype="LargeStone" Count ="12" /> // item with the specified defintion id needs to be used
     <Component Type="InventoryItem" Subtype="LargeStone" Count ="12" /> <!-- item with the specified defintion id needs to be used -->
   </Components>
   </Components>
   <CriticalComponent Type="InventoryItem" Subtype="LargeStone" Index="0" /> // used to determined at which point in building the block is 'working' (also supports tags)
   <CriticalComponent Type="InventoryItem" Subtype="LargeStone" Index="0" /> <!-- used to determined at which point in building the block is 'working' (also supports tags) -->
   <RandomRotation>true</RandomRotation> // can the block be rotated when placed in line or plane? (Default: false)
   <RandomRotation>true</RandomRotation> <!-- can the block be rotated when placed in line or plane? (Default: false) -->
   <CompoundTemplates> // template for compounding (this only works for Large blocks) - (don't use if you don't want to have compound block)
   <CompoundTemplates> <!-- template for compounding (this only works for Large blocks) - (don't use if you don't want to have compound block) -->
   <Template>Cube</Template>
   <Template>Cube</Template>
   </CompoundTemplates>
   </CompoundTemplates>
   <GeneratedBlocks> // generated blocks when built (for the stone cube and walls it adds the corner stone pillars) (no need to use for block without additional decoration) (no used for small grids)
   <GeneratedBlocks> <!-- generated blocks when built (for the stone cube and walls it adds the corner stone pillars) (no need to use for block without additional decoration) (no used for small grids) -->
   <GeneratedBlock><TypeId>CubeBlock</TypeId>
   <GeneratedBlock><TypeId>CubeBlock</TypeId>
       <SubtypeId>GeneratedStoneSlopeEdgeLeft</SubtypeId>
       <SubtypeId>GeneratedStoneSlopeEdgeLeft</SubtypeId>
   </GeneratedBlock></GeneratedBlocks><MaxIntegrity>21000</MaxIntegrity> // maximum integrity for the block (essentially HP) (Default: 1)
   </GeneratedBlock></GeneratedBlocks><MaxIntegrity>21000</MaxIntegrity> <!-- maximum integrity for the block (essentially HP) (Default: 1) -->
   <NavigationDefinition>Default</NavigationDefinition> // not used by the game at all (was used in legacy AI pathfinding)
   <NavigationDefinition>Default</NavigationDefinition> <!-- not used by the game at all (was used in legacy AI pathfinding) -->
   <BuildProgressToPlaceGeneratedBlocks>0.5</BuildProgressToPlaceGeneratedBlocks> // how much of the block needs to be built for the generated blocks to be placed on it
   <BuildProgressToPlaceGeneratedBlocks>0.5</BuildProgressToPlaceGeneratedBlocks> <!-- how much of the block needs to be built for the generated blocks to be placed on it -->
  </Definition>
  </Definition>
   <UseModelIntersection>true</UseModelIntersection> // (Default: false)
   <UseModelIntersection>true</UseModelIntersection> <!-- (Default: false) -->
   <Mass>20</Mass> // weight of the block (Default: 0)
   <Mass>20</Mass> <!-- weight of the block (Default: 0) -->
   <AvailableInSurvival>true</AvailableInSurvival> // is it buildable in survival? (Default: true)
   <AvailableInSurvival>true</AvailableInSurvival> <!-- is it buildable in survival? (Default: true) -->
   <VoxelPlacement> // rules for placing the block into voxels
   <VoxelPlacement> <!-- rules for placing the block into voxels -->
     <StaticMode>           
     <StaticMode>           
       <PlacementMode>Both</PlacementMode>
       <PlacementMode>Both</PlacementMode>
       // None - Cannot be placed at all
       <!-- None - Cannot be placed at all -->
       // InVoxel - Can only be placed in voxels
       <!-- InVoxel - Can only be placed in voxels -->
       // OutsideVoxel - Can only be placed outside voxels
       <!-- OutsideVoxel - Can only be placed outside voxels -->
       // Both - Can be placed inside or outside voxels
       <!-- Both - Can be placed inside or outside voxels -->
       // Volumetric - Has to be in voxel and must be in voxel sfor a certain percentage
       <!-- Volumetric - Has to be in voxel and must be in voxel sfor a certain percentage -->
       <MaxAllowed>1</MaxAllowed> // maximum of block being inside voxel (0 - 1 maps to 0% - 100%)
       <MaxAllowed>1</MaxAllowed> <!-- maximum of block being inside voxel (0 - 1 maps to 0% - 100%) -->
       <MinAllowed>0</MinAllowed> // minimum of block being inside voxel (0 - 1 maps to 0% - 100%)
       <MinAllowed>0</MinAllowed> <!-- minimum of block being inside voxel (0 - 1 maps to 0% - 100%) -->
     </StaticMode>
     </StaticMode>
     <DynamicMode>
     <DynamicMode>
Line 72: Line 72:
       <MinAllowed>0</MinAllowed>
       <MinAllowed>0</MinAllowed>
     </DynamicMode>
     </DynamicMode>
   </VoxelPlacement>//Dynamic mode is dynamic placement mode (in the air I think) and Static is placing in voxel or on a static grid
   </VoxelPlacement><!--Dynamic mode is dynamic placement mode (in the air I think) and Static is placing in voxel or on a static grid -->
</source>
</source>

Revision as of 22:39, 26 August 2017

This is a "MyObjectBuilder_CubeBlockDefinition" with hints and explanations. This is a community collection. Please feel free to add/correct things. For better readability copy/paste the text into a XML capable programm like notepad++.


   <Definition xsi:type="MyObjectBuilder_CubeBlockDefinition"> <!-- definition type -->
   <Id Type="CubeBlock" Subtype="StoneCube" /> <!-- definition id  -->
   <DisplayName>DisplayName_Block_StoneBlockCube</DisplayName> <!-- display name used for the block in-game (mods don't support localization) -->
   <BlockPairName>StoneBlockCube</BlockPairName> <!-- block pair name is used together with block position (a separate definition) to position the block within the G-screen grid -->
   <Public>true</Public> <!-- whether or not the definition is accesible to players (Default: true) -->
   <Icon>Textures\GUI\Icons\cubes\StoneCube.dds</Icon> <!-- icon(s) used in the gui -->
   <CubeSize>Large</CubeSize> <!-- what grid size the block is using (large / small) (Default: Large) -->
   <BlockTopology>TriangleMesh</BlockTopology> <!-- this can be Cube or TriangleMesh (but Cube won't work in ME, it is only useful for SE armor blocks) -->
   <Size x="1" y="1" z="1" /> <!-- how many blocks in each direction does the block occupy (Default: 0,0,0) (Default value will make game sad :P) -->
   <ModelOffset x="0" y="0" z="0" /> <!-- offset of the model within the block space (Default: 0,0,0) -->
   <Model>Models\Cubes\Large\StoneCube.mwm</Model> <!-- model for the fully built block -->
   <BuildProgressModels> <!-- building progression models -->
   <Model BuildPercentUpperBound="0.5" File="Models\Cubes\large\StoneCube_Construction_1.mwm"> <!-- What block model to use if build integrity is below specified threshold -->
   <MountPointOverrides> <!-- overrides for mountpoints, if necessary (To prevent players from attaching to the top of an unfinished block for example) -->
   <MountPoint Side="Top" Enabled="false" /> 
   </MountPointOverrides>
   </Model>
   </BuildProgressModels>
   <MountPoints> <!-- mount points for the block, can specify multiple for each side (Default: all sides have some kind of a mount point) -->
     <MountPoint Side="Front" StartX="1.0324" StartY="-0.03239999" EndX="-0.032400012" EndY="1.0324" />
     <MountPoint Side="Back" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
     <MountPoint Side="Left" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
     <MountPoint Side="Right" StartX="1.0324" StartY="-0.03239999" EndX="-0.032400012" EndY="1.0324" />
     <MountPoint Side="Top" StartX="-0.03239999" StartY="1.0324" EndX="1.0324" EndY="-0.032400012" />
     <MountPoint Side="Bottom" StartX="-0.03239999" StartY="-0.03239999" EndX="1.0324" EndY="1.0324" />
   </MountPoints>
   <MirroringY>Z</MirroringY> <!-- for mirrored building, I don't think is is useful for ME -->
   <MirroringZ>Y</MirroringZ> <!-- (Default: None) -->
   <BuildTimeSeconds>6</BuildTimeSeconds> <!-- how much time you need to build the block (Default: 10) -->
   <Direction>Horizontal</Direction> <!-- I honestly don't know (Default: Both) -->
   <Rotation>Vertical</Rotation> <!-- which way the block can be rotated (Default: Both) -->
   <BuildType>Cube</BuildType> <!-- used for additional model generators (irrelevant if you don't want to use it as generated block or with generated blocks) -->
   <PhysicalMaterial>Stone</PhysicalMaterial> <!-- physical material of the block (determines the strength of material, contact sounds, particles and maybe something else) -->
   <Components> <!-- components used for building one of these blocks (every block needs at least a component - integrity / total component count is used to calculate how much integrity the block can have with currently built components) -->
     <Component Tag="ScrapWood" Count="10" /> <!-- Tag = any item matching the specified tag can be used here -->
     <Component Type="InventoryItem" Subtype="LargeStone" Count ="12" /> <!-- item with the specified defintion id needs to be used -->
   </Components>
   <CriticalComponent Type="InventoryItem" Subtype="LargeStone" Index="0" /> <!-- used to determined at which point in building the block is 'working' (also supports tags) -->
   <RandomRotation>true</RandomRotation> <!-- can the block be rotated when placed in line or plane? (Default: false) -->
   <CompoundTemplates> <!-- template for compounding (this only works for Large blocks) - (don't use if you don't want to have compound block) -->
   <Template>Cube</Template>
   </CompoundTemplates>
   <GeneratedBlocks> <!-- generated blocks when built (for the stone cube and walls it adds the corner stone pillars) (no need to use for block without additional decoration) (no used for small grids) -->
   <GeneratedBlock><TypeId>CubeBlock</TypeId>
       <SubtypeId>GeneratedStoneSlopeEdgeLeft</SubtypeId>
   </GeneratedBlock></GeneratedBlocks><MaxIntegrity>21000</MaxIntegrity> <!-- maximum integrity for the block (essentially HP) (Default: 1) -->
   <NavigationDefinition>Default</NavigationDefinition> <!-- not used by the game at all (was used in legacy AI pathfinding) -->
   <BuildProgressToPlaceGeneratedBlocks>0.5</BuildProgressToPlaceGeneratedBlocks> <!-- how much of the block needs to be built for the generated blocks to be placed on it -->
 </Definition>
   <UseModelIntersection>true</UseModelIntersection> <!-- (Default: false) -->
   <Mass>20</Mass> <!-- weight of the block (Default: 0) -->
   <AvailableInSurvival>true</AvailableInSurvival> <!-- is it buildable in survival? (Default: true) -->
   <VoxelPlacement> <!-- rules for placing the block into voxels -->
     <StaticMode>           
      <PlacementMode>Both</PlacementMode>
       <!-- None - Cannot be placed at all -->
       <!-- InVoxel - Can only be placed in voxels -->
       <!-- OutsideVoxel - Can only be placed outside voxels -->
       <!-- Both - Can be placed inside or outside voxels -->
       <!-- Volumetric - Has to be in voxel and must be in voxel sfor a certain percentage -->
       <MaxAllowed>1</MaxAllowed> <!-- maximum of block being inside voxel (0 - 1 maps to 0% - 100%) -->
       <MinAllowed>0</MinAllowed> <!-- minimum of block being inside voxel (0 - 1 maps to 0% - 100%) -->
     </StaticMode>
     <DynamicMode>
       <PlacementMode>Both</PlacementMode>
       <MaxAllowed>1</MaxAllowed>
       <MinAllowed>0</MinAllowed>
     </DynamicMode>
   </VoxelPlacement><!--Dynamic mode is dynamic placement mode (in the air I think) and Static is placing in voxel or on a static grid -->