Jump to content

Custom Workstation Problem


Rizzano

Recommended Posts

Quote

<xui>
    
    <append xpath="/xui" >
    
    <ruleset name="default" scale="1.255" stackpanel_scale="1.05">
    <window_group name="workstation_scholarDeskFap" controller="XUiC_WorkstationWindowGroup">
        <window name="windowCraftingList"/>
        <window name="craftingInfoPanel"/>
        <window name="windowCraftingQueue"/>
        <window name="windowToolsScholarDeskFap" />
        <window name="windowOutput" />
        <window name="windowNonPagingHeader" />
    </window_group>
    </ruleset>
    </append>
    
</xui>

 

When I have the ruleset in, it tells me workstation_scholarDeskFap is not set to an instance of an object.  When I don't have the ruleset I can load in fine, place the desk, it says press E but nothing happens.

 

Quote

<block name="scholarDeskFap">
    <property name="Class" value="Workstation"/>
    <property class="Workstation">
        <property name="Modules" value="tools,output"/>
    </property>
    <property name="CreativeMode" value="Player"/>
    <property name="DescriptionKey" value="scholarDeskFaphDesc"/>
    <property name="DisplayType" value="blockMulti"/>
    <property name="WorkstationIcon" value="ui_game_symbol_workbench"/>
    <property name="WorkstationJournalTip" value="scholarDeskFapTip"/>
    <property name="Stacknumber" value="1"/>
    <property name="Material" value="Mmetal"/>
    <property name="Shape" value="ModelEntity"/>
    <property name="Model" value="@:Entities/LootContainers/deskMetalFullPrefab.prefab"/>
    <property name="Path" value="solid"/>
    <property name="ModelOffset" value="0,.5,0"/>
    <property name="MultiBlockDim" value="2,2,1"/>
    <property name="ImposterDontBlock" value="true"/>
    <property name="WaterFlow" value="permitted"/>
    <property name="CustomIcon" value="scholarDeskFap"/>
    <property name="Place" value="TowardsPlacerInverted"/>
    <property name="OnlySimpleRotations" value="true"/>
    <property name="IsTerrainDecoration" value="true"/>
    <property name="StabilitySupport" value="false"/>
    <property name="Weight" value="0"/>
    <property name="EconomicValue" value="1000"/>
    <property name="TraderStageTemplate" value="midTier1"/>
    <property name="MaxDamage" value="800"/>
    <property name="HeatMapStrength" value="0.5"/>
    <property name="HeatMapTime" value="1200"/>
    <property name="HeatMapFrequency" value="25"/>
    <property name="OpenSound" value="open_workbench"/>
    <property name="CloseSound" value="close_workbench"/>
    <property name="TakeDelay" value="5"/>
    <property class="RepairItems">
        <property name="resourceForgedIron" value="25"/>
        <property name="resourceMechanicalParts" value="20"/>
        <property name="resourceDuctTape" value="25"/>
    </property>
    <drop event="Harvest" name="resourceForgedIron" count="5" tag="allHarvest"/>
    <drop event="Harvest" name="resourceForgedIron" count="5" tag="salvageHarvest"/>
    <drop event="Harvest" name="resourceMechanicalParts" count="8" tag="salvageHarvest"/>
    <drop event="Destroy" count="0"/>
    <drop event="Fall" name="terrDestroyedWoodDebris" count="1" prob="0.75" stick_chance="1"/>
    <property name="SortOrder1" value="B281"/>
    <property name="SortOrder2" value="0300"/>
    <property name="Group" value="Basics,Science"/>
    <property name="FilterTags" value="MC_playerBlocks,SC_decor"/>
</block>

The above is appended in my blocks. The scholarDeskFap uses an existing desk model in the game.

 

Quote

<windows>
    
    <append xpath="/windows" >
    
<window name="windowToolsScholarDeskFap" width="228" height="121" panel="Right" cursor_area="true" >
    <panel style="header.panel">            
        <sprite style="header.icon" sprite="ui_game_symbol_pen"/>
        <label style="header.name" text="TOOLS" text_key="xuiTools" />
    </panel>

        <rect name="content" depth="0" pos="0,-46" height="75" disablefallthrough="true" on_press="true">

        <grid name="inventory" rows="1" cols="1" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true" allow_sort_order="false" required_tools="scholarPenFap" required_tools_only="true">
            <required_item_stack name="0"/>
        </grid>        

        
    </rect>
</window>
    
    </append>
    
</windows>

I have this in my windows.xml. Do I need this? 

Any help is appreciated

Edited by Rizzano
fixed a naming error (see edit history)
Link to comment
Share on other sites

<xui>

<append xpath="/xui/ruleset">
  <window_group name="workstation_scholarDeskFap" controller="XUiC_WorkstationWindowGroup" open_backpack_on_open="true" close_compass_on_open="true">
        <window name="windowCraftingList"/>
        <window name="craftingInfoPanel"/>
        <window name="windowCraftingQueue"/>
        <window name="windowToolsScholarDeskFap" />
        <window name="windowOutput" />
        <window name="windowNonPagingHeader" />
    </window_group>
 </append>
    
</xui>

See if that is functional for the xui.xml

 

As for the windows.xml, if you want to use that, it will need to be referenced in the xui.xml, right?

In the same way <window name="windowToolsForge" /> is used with workstation_forge.

 

This is not really an area of the game I am very familiar with but these are possibilities to amend.

Link to comment
Share on other sites

I still get an error with the new xui you posted.  

I am completely new to xml, and am using Max Fox's xml tutorials.   I also have been trying a reverse engineering method (looking at vanilla xml for example for the forge, and trying to use that as a basis for my scholarDeskFap.)  I get the below error loading into the main menu, not even loading into the game yet.  And I still cannot interact with the desk.  It just says Press E, but nothing still happens. I tried removing the modified windows.xml, in case I didn't need that, and I tried loading with it.  Both produce the same result.

image_2023-08-17_135500338.png

Edited by Rizzano
forgot to close my parenthesis (see edit history)
Link to comment
Share on other sites

Ok a few things to note here.

In the xui xml append you don't need the ruleset appended to it. And you will want the open backpack and close compass bits as well. So it should be like below.

<xui>

	<append xpath="/xui/ruleset" >

	<window_group name="workstation_scholarDeskFap" controller="XUiC_WorkstationWindowGroup" open_backpack_on_open="true" close_compass_on_open="true">
		<window name="windowCraftingList"/>
		<window name="craftingInfoPanel"/>
		<window name="windowCraftingQueue"/>
		<window name="windowToolsScholarDeskFap" />
		<window name="windowOutput" />
		<window name="windowNonPagingHeader" />
	</window_group>

    </append>
</xui>

 

In the blocks xml you will want to set a crafting area recipes. So something like below.

<blocks>

<append xpath="/blocks">

<block name="scholarDeskFap">
	<property name="Class" value="Workstation"/>
	<property class="Workstation">
		<property name="Modules" value="tools,output"/>
		<property name="CraftingAreaRecipes" value="player,workbench"/>
	</property>
	<property name="CreativeMode" value="Player"/>
	<property name="DescriptionKey" value="scholarDeskFaphDesc"/>
	<property name="DisplayType" value="blockMulti"/>
	<property name="WorkstationIcon" value="ui_game_symbol_workbench"/>
	<property name="WorkstationJournalTip" value="scholarDeskFapTip"/>
	<property name="Stacknumber" value="1"/>
	<property name="Material" value="Mmetal"/>
	<property name="Shape" value="ModelEntity"/>
	<property name="Model" value="@:Entities/LootContainers/deskMetalFullPrefab.prefab"/>
	<property name="Path" value="solid"/>
	<property name="ModelOffset" value="0,.5,0"/>
	<property name="MultiBlockDim" value="2,2,1"/>
	<property name="ImposterDontBlock" value="true"/>
	<property name="WaterFlow" value="permitted"/>
	<property name="CustomIcon" value="scholarDeskFap"/>
	<property name="Place" value="TowardsPlacerInverted"/>
	<property name="OnlySimpleRotations" value="true"/>
	<property name="IsTerrainDecoration" value="true"/>
	<property name="StabilitySupport" value="false"/>
	<property name="Weight" value="0"/>
	<property name="EconomicValue" value="1000"/>
	<property name="TraderStageTemplate" value="midTier1"/>
	<property name="MaxDamage" value="800"/>
	<property name="HeatMapStrength" value="0.5"/>
	<property name="HeatMapTime" value="1200"/>
	<property name="HeatMapFrequency" value="25"/>
	<property name="OpenSound" value="open_workbench"/>
	<property name="CloseSound" value="close_workbench"/>
	<property name="TakeDelay" value="5"/>
	<property class="RepairItems">
		<property name="resourceForgedIron" value="25"/>
		<property name="resourceMechanicalParts" value="20"/>
		<property name="resourceDuctTape" value="25"/>
	</property>
	<drop event="Harvest" name="resourceForgedIron" count="5" tag="allHarvest"/>
	<drop event="Harvest" name="resourceForgedIron" count="5" tag="salvageHarvest"/>
	<drop event="Harvest" name="resourceMechanicalParts" count="8" tag="salvageHarvest"/>
	<drop event="Destroy" count="0"/>
	<drop event="Fall" name="terrDestroyedWoodDebris" count="1" prob="0.75" stick_chance="1"/>
	<property name="SortOrder1" value="B281"/>
	<property name="SortOrder2" value="0300"/>
	<property name="Group" value="Basics,Science"/>
	<property name="FilterTags" value="MC_playerBlocks,SC_decor"/>
</block>

</append>

</blocks>

The above uses two crafting area recipe lists as an example. This can be changed to whatever you like and be just one list if wanted as well. To have recipes use a custom craft area recipes list you will also need to make recipes that use the same craft area tag. Just checkout some of the vanilla recipes in the recipes xml for the vanilla workstations and how they use the craft area tag.

 

 

The grid in your tool window in the windows xml doesn't need repeat content set to true if using only 1 tool, also might double check tool spelling as well, any typo can throw everything off. So should be something like below.

<windows>

	<append xpath="/windows">

	<window name="windowToolsScholarDeskFap" width="228" height="121" panel="Right" cursor_area="true">
		<panel style="header.panel">
			<sprite style="header.icon" sprite="ui_game_symbol_pen"/>
			<label style="header.name" text="TOOLS" text_key="xuiTools"/>
		</panel>
		<rect name="content" depth="0" pos="0,-46" height="75" disablefallthrough="true" on_press="true">
			<grid name="inventory" rows="1" cols="1" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="false" allow_sort_order="false" required_tools="scholarPenFap" required_tools_only="true">
				<required_item_stack name="0"/>
			</grid>
		</rect>
	</window>

	</append>

</windows>

 

 

 

And then lastly you may need to make an entry for your workstation in the ui_display xml, check the vanilla xml and look for the crafting stations towards the bottom of the file for examples.

 

Hopefully this helps, come on back and let us know.

 

Edited by RevenantWit (see edit history)
Link to comment
Share on other sites

I modified my files with the changes above, keeping the original just in case. Nothing changed. Still the same error when loading into the main menu, and still cannot interact with the workstation.

 

I did not make an entry in ui_display, I will do that next.

EDIT: Actually yes, I already had an entry for ui_display.xml.  

 

Quote

<append xpath="/ui_display" >

            <crafting_category_list display_type="scholarDeskFap">
                <crafting_category name="Science" icon="ui_game_symbol_science" display_name="lblCategoryScience" />
            </crafting_category_list>

</append>

 

I only wanted the one category for books, schematics, recipes, skill books, etc.

Edited by Rizzano (see edit history)
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...