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

Custom Component Crash on Crafting

Discussion in 'Modding' started by captainbladej52, Apr 2, 2020.

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

    captainbladej52 Apprentice Engineer

    Messages:
    462
    Like the title hints, I created a custom component for my mod to replace a vanilla component which is based on the reactor component. I can spawn it in, weld it into blocks, and such like normal with no issues. When I pull up the Assembler I can see it in the assembler, and attempt to craft it. Once it comes time for the assembler to spit out the result, it locks up and craps out on me by crashing back to desktop. I've tried comparing the code to vanilla items and similar mods but not spotting the issue. What am I doing wrong here? Code below for reference for the component, blueprint, and blueprint class.

    Code:
    <?xml version="1.0"?>
    <Definitions xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
    	<Components>
    		 <Component>
    			<Id>
    				<TypeId>Component</TypeId>
    				<SubtypeId>GaldaxIonizer</SubtypeId>
    			</Id>
    			<DisplayName>GaldaxianIonizer</DisplayName>
    			<Icon>Textures\GUI\Icons\component\GaldaxIonizer_component.dds</Icon>
    			<Size>
    				<X>0.2</X>
    				<Y>0.2</Y>
    				<Z>0.2</Z>
    			</Size>
    			<Mass>35</Mass>
    			<Volume>8</Volume>
    			<Model>Models\Components\GaldaxIonizer_component.mwm</Model>
    			<PhysicalMaterial>Metal</PhysicalMaterial>
    			<MaxIntegrity>20</MaxIntegrity>
    			<DropProbability>0.3</DropProbability>
    			<Health>14</Health>
    			<MinimumOfferAmount>100</MinimumOfferAmount>
    			<MaximumOfferAmount>1000</MaximumOfferAmount>
    			<MinimumOrderAmount>100</MinimumOrderAmount>
    			<MaximumOrderAmount>500</MaximumOrderAmount>
    			<CanPlayerOrder>true</CanPlayerOrder>
    			<MinimumAcquisitionAmount>10</MinimumAcquisitionAmount>
    			<MaximumAcquisitionAmount>100</MaximumAcquisitionAmount>
    		</Component>
    	  </Components>
    </Definitions>
    
    Code:
    <?xml version="1.0"?>
    <Definitions xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
      <Blueprints>
    	<Blueprint>
    	  <Id>
    		<TypeId>BlueprintDefinition</TypeId>
    		<SubtypeId>GaldaxIonizer</SubtypeId>
    	  </Id>
    	  <DisplayName>GaldaxianIonizer</DisplayName>
    	  <Icon>Textures\GUI\Icons\component\GaldaxIonizer_component.dds</Icon>
    	  <Prerequisites>
    		<Item Amount="15" TypeId="Ingot" SubtypeId="Iron" />
    		<Item Amount="20" TypeId="Ingot" SubtypeId="Stone" />
    		<Item Amount="5" TypeId="Ingot" SubtypeId="Silver" />
    	  </Prerequisites>
    	  <Results>
    	  <Item Amount="1" TypeId="Components" SubtypeId="GaldaxIonizer" />
    	  </Results>
    	  <BaseProductionTimeInSeconds>8</BaseProductionTimeInSeconds>
    	</Blueprint>
      </Blueprints>
    </Definitions>
    
    Code:
    <?xml version="1.0"?>
    <Definitions xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
    	<BlueprintClasses>
    		<Class>
    			<Id>
    				<TypeId>BlueprintClassDefinition</TypeId>
    				<SubtypeId>Components</SubtypeId>
    			</Id>
    			<DisplayName>DisplayName_BlueprintClass_GaldaxExp</DisplayName>
    			<Description>Description_BlueprintClass_GaldaxExp</Description>
    			<Icon>Textures\GUI\Icons\buttons\component.dds</Icon>
    			<HighlightIcon>Textures\GUI\Icons\buttons\component.dds</HighlightIcon>
    			<FocusIcon>Textures\GUI\Icons\buttons\component_focus.dds</FocusIcon>
    			<InputConstraintIcon>Textures\GUI\Icons\filter_ingot.dds</InputConstraintIcon>
    		</Class>
    	</BlueprintClasses>
    	<BlueprintClassEntries>
    	  <Entry Class="Components" BlueprintSubtypeId="GaldaxIonizer" />
    		  <Entry Class="LargeBlocks" BlueprintSubtypeId="Thrust/LargeBlockLargeGaldaxThrustExp" />
    		  <Entry Class="LargeBlocks" BlueprintSubtypeId="Thrust/LargeBlockSmallGaldaxThrustExp" />
    	  <Entry Class="SmallBlocks" BlueprintSubtypeId="Thrust/SmallBlockLargeGaldaxThrustExp" />
    	  <Entry Class="SmallBlocks" BlueprintSubtypeId="Thrust/SmallBlockSmallGaldaxThrustExp" />
    	</BlueprintClassEntries>
    </Definitions>
    
     
  2. Roxette

    Roxette Senior Engineer

    Messages:
    1,546
    Have one of these...

    [​IMG]

    Change :

    <Results>
    <Item Amount="1" TypeId="Components" SubtypeId="GaldaxIonizer" />
    </Results>

    To:

    <Result Amount="1" TypeId="Component" SubtypeId="GaldaxIonizer" />

    The <Results>... format is only valid for deconstructing a component into raw materials. :)
     
    Last edited: Apr 2, 2020
  3. captainbladej52

    captainbladej52 Apprentice Engineer

    Messages:
    462
    Yep I definitely had one of those Picard facepalms with a bit of facedesk mixed in. That did the trick. Much appreciated thanks.
     
  4. Digi

    Digi Senior Engineer

    Messages:
    2,393
    The issue was actually TypeId="Components" .

    Results is just an upgrade for allowing multiple results, Result is there as backwards compatibility only.
     
    • Informative Informative x 1
Thread Status:
This last post in this thread was made more than 31 days old.