1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Collision breaks after placing CubeBlock and rejoining

Discussion in 'Modding' started by NbdY, May 21, 2020.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. NbdY

    NbdY Trainee Engineer

    Messages:
    1
    Hello!

    I'm trying to create a simple mod reusing the official tree/foliage models. Most of the earth like trees work as I would expect. However some of them and most of the alien 'trees' do not work properly. And even worse they break the collision of the grid its placed on once I reload the save.

    I created a video to better detail what is going on. Ill add a summary below it as well:

    • I load a world with a simple armor block grid. With my minimal repro mod (see code block below).
    • I place the tree and check the collision. Initially it seems to collide with like a 1x1x1 cube block even though its set to 1x7x1. Or if that isn't how it works, it does not collide like the trees already in the scene either (which should be the same mwm file?).
    • I close the game, save yes.
    • Immediately continue the game again.
    • And then the collision is of the grid where the tree is placed on is "gone".

    Anyone know why this happens and If I can solve it? I have also tried creating a new own MWM model from the original FBX files in the SDK and use those from within my mod. But even with custom created collision, it keeps doing the same thing.

    Regards!

    This is my current minimal reproducible example mod (wont need any additional assets):
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Definitions xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
    	<CategoryClasses>
    		<Category>
    			<Id>
    				<TypeId>GuiBlockCategoryDefinition</TypeId>
    				<SubtypeId/>
    			</Id>
    			<DisplayName>Foliage</DisplayName>
    			<Name>Foliage</Name>
    			<ItemIds>
    				<string>CubeBlock/IDN_AlienLeafTree_L</string>
    			</ItemIds>
    		</Category>
    	</CategoryClasses>
    
    	<CubeBlocks>
    		<Definition>
    			<Id>
    				<TypeId>CubeBlock</TypeId>
    				<SubtypeId>IDN_AlienLeafTree_L</SubtypeId>
    			</Id>
    			<DisplayName>Alien Leaf Tree</DisplayName>
    			<Icon>Textures\GUI\Icons\Help.dds</Icon>
    			<CubeSize>Large</CubeSize>
    			<BlockTopology>TriangleMesh</BlockTopology>
    			<Size x="1" y="7" z="1" />
    			<ModelOffset x="0" y="-8.5" z="0" />
    			<Model>Models\Environment\Trees\AlienLeafTree.mwm</Model>
    			<!-- Models\Environment\Trees\AlienLeafTree_broken -->
    			<PhysicalMaterial>Wood</PhysicalMaterial>
    			<Components>
    				<Component Subtype="SteelPlate" Count="10" />
    			</Components>
    			<CriticalComponent Subtype="SteelPlate" Index="0" />
    			<BuildTimeSeconds>6</BuildTimeSeconds>
    		</Definition>
    	</CubeBlocks>
    </Definitions>
    
     
Thread Status:
This last post in this thread was made more than 31 days old.