Jump to content

Need help with making a custom workbench


kryzzk

Recommended Posts

Until now anything I modded as all been XML mods, this is the first mod I have tried to make that used a new block.  

 

I created a custom workbench, it shows up in game, properly placed, rotated ect. when I walk up to it I get the "press E", I can hold E and pick it up but I can't open the crafting window on it or any other crafting stations. If I pick up my custom workbench the other crafting stations start working again. 

 

Everything in the XML looks correct to me, but I've never made a workstation before so I'm not sure. I also wasn't able to find a list of what Unity tags are needed for what blocks and I could not locate the default workbenches for reference. so I used the A20 Mod Tutorial for what little reference as it gave and selected T_Mesh_B as my tag because that was the only tag I could find on any tutorial video about making a block.

 

Would this be a incorrect tag in unity or have I likely coded something wrong in one of the XML files or do I need another XML that I'm missing?

 

Blocks.xml

<config>
<append xpath="/blocks">

<block name="ResearchTable">
        <property name="Extends" value="workbench"/>
        <property name="Class" value="Workstation" />
        <property name="CreativeMode" value="Player"/>
        <property name="Shape" value="ModelEntity" />
        <property name="Model" value="#@modfolder:/Resources/researchdesk.unity3d?deskprefab"/>
        <property name="SortOrder2" value="0290"/> 
        <property name="MultiBlockDim" value="2,2,1"/>
        <property name="Collide" value="movement,melee,bullet,arrow,rocket"/>
        <property name="FilterTags" value="fdecor,fother,ffurniture"/>  
        <property name="CustomIcon" value="ResearchDesk"/>
        <property class="Workstation">
            <property name="Modules" value="output"/>
            <property name="CraftingAreaRecipes" value="ResearchTable"/>
        </property>  
        <property name="WorkstationIcon" value="ui_game_symbol_wrench" />
        <property name="OpenSound" value="open_workbench" />
        <property name="CloseSound" value="close_workbench" />
        <property name="WorkstationJournalTip" value="workbenchTip" />  
        <property class="RepairItems">
            <property name="resourceForgedIron" value="25" />
            <property name="resourceMechanicalParts" value="20" />
            <property name="resourceWood" value="50" />
        </property>  
        <property name="TakeDelay" value="15" />  
        <property name="DescriptionKey" value="workbenchDesc" />
        <property name="EconomicValue" value="776" />
        <property name="Group" value="Building,advBuilding" />  
    </block>

</append>

</config>

 

XUi.xml 

 

<xui>
<append xpath="/xui/ruleset[@name='default']" >    
        <window_group name="ResearchTable" controller="XUiC_WorkstationWindowGroup" open_backpack_on_open="true" close_compass_on_open="true">
            <window name="windowCraftingList"/>
            <window name="craftingInfoPanel"/>
            <window name="windowCraftingQueue"/>
            <window name="windowOutput" />
            <window name="windowNonPagingHeader" />
        </window_group>                
</append>
</xui>

Edited by kryzzk
Added Blocks and XUi XML's for reference. (see edit history)
Link to comment
Share on other sites

18 hours ago, bdubyah said:

When you try and interact with your workbench, if you hit F1 you likely have an error. Try renaming the window_group to workbench_ResearchTable. I think the code looks for the workbench_ when calling the UI for it.

I spent 3 days going over the Blocks.xml and trying different tags on the block in unity trying to figure out what I had done wrong. I put "workstation_" in front of ResearchTable in the XUi.xml and it works fine.  Such a simple mistake.

 

Thanks for the help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...