Welcome to Die Till Day 7 - Gaming Group - We pride ourselves on doing the best we can to make your experience in gaming worth your time.

Forum Thread
  Posts  
Tutorial #1 (Groups : Die Till Day 7 : Forum : Workstation : Tutorial #1) Locked
Thread Options
Apr 11 2016 Anchor

*Tutorial was made in A13, Still can be useful*

Description
So, let me explain what i will be teaching you guys... We will be learning about workstations - other people have come out with help in this subject, but id thought id say something about it as well. I will update the OP when i release more how to's on this!

Workstation
First, you need to make your workstation - so you wanna go to the blocks.xml and you can copy the campfire or the forge. Bellow i will show you both and explain both to you.


Campfire WorkstationSo for this type of workstation - the items needed for the recipes are from your inventory. Easier to use because you dont have to mess with the forges units. Example bellow..

<block id="1706" name="FarmersCampfire">
    <property name="Class" value="Campfire" />
    <property name="Material" value="coal" />
    <property name="Shape" value="ModelEntity" />
	<property name="Model" value="Entities/Crafting/campfirePrefab" />
    <property name="IsTerrainDecoration" value="true" />
    <property name="ParticleName" value="campfire" />
    <property name="ParticleOffset" value="0.5,0,0.5" />
	<property name="HeatMapStrength" value="2"/>
	<property name="HeatMapTime" value="1200"/>
	<property name="HeatMapFrequency" value="25"/>
	<property name="BuffsWhenWalkedOn" value="burningSmall"/>
	<property name="ActiveRadiusEffects" value="+heatSource(3)"/>
	<drop event="Destroy" name="FarmersCampfire" count="1" />
	<drop event="Fall" name="FarmersCampfire" count="1" />
    <property name="Group" value="Food/Cooking,Basics" />
    <drop event="Destroy" name="[recipe]" count="0" />	
	<property class="Workstation">
		<property name="Modules" value="tools,output,fuel,input"/>
	</property>
	<property name="DescriptionKey" value="campfireDesc"/>
  </block>

Forge Workstation

This is more of a difficult type of workstation, it becomes easy once you learn it. but this type needs alot of modifying and adding items just to make it the way you want... Example below...

<block id="1707" name="SoldierWorktable">
    <property name="Class" value="Forge" />
    <property name="Material" value="brick" />
    <property name="Shape" value="ModelEntity" />
    <!-- <property name="Mesh" value="models" /> -->
    <property name="Model" value="Entities/Crafting/forgePrefab" />
    <property name="Place" value="TowardsPlacerInverted" />
    <property name="ParticleName" value="forge" />
    <property name="ParticleOffset" value="0.5,0,0.5" />
	<property name="HeatMapStrength" value="2"/>
	<property name="HeatMapTime" value="1200"/>
	<property name="HeatMapFrequency" value="25"/>
	<property name="ActiveRadiusEffects" value="+heatSource(3)"/>
    <drop event="Destroy" name="SoldierWorktable" count="1" />
	<drop event="Fall" name="SoldierWorktable" count="1" />
    <property name="Group" value="Basics,Building" />
	<property class="Workstation">
		<property name="Modules" value="tools,output,fuel,material_input"/>
		<property name="InputMaterials" value="brass,clay,lead,gunparts"/>
	</property>
	<property name="DescriptionKey" value="forgeDesc"/>	
  </block>

As you see the highlighted area of the code - Ill explain bellow , but thats what you can change, best to do so.

Windows
This is the place you wanna go if you want to change things from default to custom. This is the spot for new tools or fuel or just anything you wanna change about it. So here are some examples i did and you can see what im talking about, i will also explain. This file is located in the XUI folder and windows.xml.

<window name="windowToolsCampfireFarmer" width="228" height="79" anchor="CenterTop" panel="Right">
		<panel style="header.panel">			
			<sprite style="header.icon" sprite="ui_game_symbol_cookware"/>
			<label style="header.name" text="TOOLS"/>
		</panel>
		
		<panel name="content" depth="0" pos="0,-46" backgroundcolor="[black]">
			<grid name="inventory" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true">
				<item_stack name="0"/>
			</grid>		
			
			<grid name="slot_preview" depth="1" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="SlotPreview">
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" color="[white_quarter_alpha]" sprite="FarmersCookingPot" atlas="ItemIconAtlasGreyscale"  pos="35,-30" pivot="center" foregroundlayer="true" />
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" color="[white_quarter_alpha]" sprite="FarmersCookingGrill" atlas="ItemIconAtlasGreyscale"  pos="35,-30" pivot="center" foregroundlayer="true"/>
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" color="[white_quarter_alpha]" sprite="Bowl of Water" atlas="ItemIconAtlasGreyscale"  pos="35,-30" pivot="center" foregroundlayer="true"/>
				</rect>
			</grid>
		</panel>
	</window>

As you see here i only added to the farmers campfire - new tools - The camp fire is still used as normal, but with a new set of items you need to make it work. Recipes is actually the place you will need to link items to this workstation. I will explain farther down.

<window name="windowToolssoldierworktable" width="228" height="79" anchor="CenterTop" panel="Right">
		<panel style="header.panel">			
			<sprite style="header.icon" sprite="ui_game_symbol_cookware"/>
			<label style="header.name" text="TOOLS"/>
		</panel>
		
		<panel name="content" depth="0" pos="0,-46" backgroundcolor="[black]">
			<grid name="inventory" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true">
				<item_stack name="0"/>
			</grid>		
			
			<grid name="slot_preview" depth="1" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="SlotPreview">
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" foregroundlayer="true" color="[white_quarter_alpha]" sprite="BulletTipMold" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center"/>
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" foregroundlayer="true" color="[white_quarter_alpha]" sprite="BulletCasingMold" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center"/>
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" foregroundlayer="true" color="[white_quarter_alpha]" sprite="toolAndDieSet" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center"/>
				</rect>
			</grid>
		</panel>
		
	</window>
<window name="windowForgeInputsoldierworktable" width="228" height="154" anchor="CenterTop" panel="Right" 
		controller="WorkstationMaterialInputWindow" materials_accepted="brass,clay,lead,gunparts">
		<panel style="header.panel">			
			<sprite style="header.icon" sprite="ui_game_symbol_campfire"/>
			<label style="header.name" text="INPUT"/>
		</panel>
		
		<sprite depth="2" name="backgroundMain" sprite="menu_empty3px" pos="0,-46" color="[black]" type="sliced" fillcenter="false" />	
		<panel name="content" depth="0" pos="0,-46">
			
			<grid rows="2" cols="1" pos="3,-3" cell_width="75" cell_height="75" 
				controller="WorkstationMaterialInputGrid" repeat_content="true">
				<item_stack name="0"/>
			</grid>
		</panel>
		
		<panel name="content2" depth="1" pos="78, -49" width="147" height="148">
			
			<grid rows="6" cols="1" pos="3,-3" cell_width="147" cell_height="24"  repeat_content="true">
				<forge_material name="0"/>
			</grid>
		</panel>
	</window>

As you can already see, the soldier's workstation is more involved because its using a forge. There is more to a forge, but the outcome can be awesome if done correctly. the tools are the same as the campfire, however the input is different. Forge uses its own items that you can add into the forge and use later. Awesome idea! So as you can see the colored code you will see that its different then a regular forge. I will explain how you add new ones in a second. But for now make sure the types of input are the same as the workstation in blocks.xml.

XUI
So this is pretty easy, you first need to open the xui.xml - In here you will add the following code

<window_group name="workstation_FarmersCampfire" controller="XUiC_WorkstationWindowGroup">
			<window name="windowCraftingList"/>
			<window name="craftingInfoPanel"/>
			<window name="windowCraftingQueue"/>
			<window name="windowToolsCampfireFarmer" />
			<window name="windowFuel" />
			<window name="windowOutput" />
			<window name="windowNonPagingHeader" />
		</window_group>
		<window_group name="workstation_SoldierWorktable" controller="XUiC_WorkstationWindowGroup">
			<window name="windowCraftingList"/>
			<window name="craftingInfoPanel"/>
			<window name="windowCraftingQueue"/>
			<window name="windowToolssoldierworktable" />
			<window name="windowFuel" />
			<window name="windowForgeInputsoldierworktable" />
			<window name="windowOutput" />
			<window name="windowNonPagingHeader" />
		</window_group>

The colored code above is actually the name of the workstation block - not because i chose it to be like that - its because the game automatically uses it as the link between these files. So if you use different names, make sure this file as well is different to the name you changed it to.
You will also notice that the inputs and maybe tools as well have been changed to connect to the new area instead of the default. This is how you use new tools or change fuel or which ever you want to make different.

Units
When your using a forge as a workstation, you must make units items. So what you need is a material you want to add - like above under windows - So to make those materials work with the forge. So first go to materials.xml and add in the material you want to add..

<material id="gunparts">
      <property name="damage_category" value="metal" />
      <property name="surface_category" value="metal" />
      <property name="forge_category" value="gunparts" />
      <property name="Hardness" type="float" value="1" />
      <property name="stepsound" value="metal" />
      <property name="stability_glue" value="320" />
      <property name="Mass" type="int" value="20" />
	  <property name="MaxDamage" value="250" />
   </material>

make sure forge category is the same as the material. Now that you have done that you can open up your items.xml and do the following..

<item id="1126" name="unit_gunparts">
		<property name="CustomIcon" value="scrapIron" />
		<property name="Meshfile" value="Items/Misc/sackPrefab" />
		<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab" />
		<property name="Material" value="gunparts" />
		<property name="HoldType" value="45" />
		<property name="Stacknumber" value="500" />
		<property name="Weight" value="1" />
		<property name="Group" value="Resources" />
		<property name="ResourceUnit" value="true" />
		<property name="MeltTimePerUnit" value="1" />
		<property name="UserHidden" value="true" />
	</item>

so this items always needs unit_ thats automatic - so as you can see the colored code - the name of the material goes right after. Then your good to go and use other materials in a forge!

Recipes
Adding recipes are pretty easy, name of the workstation and name of tool if you want one used on the recipes. Bellow is how!

<recipe name="9mmCasing" count="1" scrapable="False" craft_area="SoldierWorktable" craft_tool="BulletCasingMold" material_based="true">
        <ingredient name="unit_brass" count="1"/>
		<ingredient name="unit_clay" count="1"/>
    </recipe>
<recipe name="venisonStew" count="1" scrapable="False" craft_area="FarmersCampfire" craft_tool="FarmersCookingPot" >
        <ingredient name="Bowl of Water" count="1"/>
        <ingredient name="venison" count="1"/>
        <ingredient name="potato" count="1"/>
        <ingredient name="corn" count="1"/>
    </recipe>

you can add or change fuel windows like this in windows.xml

<window name="windowFuelFarmer" width="228" height="166" anchor="CenterTop" panel="Right">
		<panel style="header.panel">			
			<sprite style="header.icon" sprite="ui_game_symbol_fire"/>
			<label style="header.name" text="FUEL"/>
			<label style="header.timer"/>
		</panel>
		
		<panel depth="0" pos="0,-46" height="79" backgroundcolor="[black]">			
			
			<grid rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationFuelGrid" repeat_content="true">
				<item_stack name="0"/>
			</grid>
			
			<grid name="slot_preview" depth="1" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="SlotPreview">
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" sprite="coal" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center" foregroundlayer="true"/>
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" sprite="water" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center" foregroundlayer="true"/>
				</rect>
				<rect>
					<sprite name="slot" depth="2" width="70" height="50" sprite="wood" atlas="ItemIconAtlasGreyscale" pos="35,-30" pivot="center" foregroundlayer="true"/>
				</rect>
			</grid>
		</panel>
		
		<panel name="buttonContent" depth="0" pos="0, -121" height="40" backgroundcolor="[black]" bordercolor="[black]">
			<sprite depth="5" name="backgroundMain" sprite="menu_empty3px" color="[black]" type="sliced" fillcenter="false" />
			<rect depth="1" pos="3,-3" width="225" height="34">
				<sprite depth="1" name="button" sprite="ui_game_select_row"  type="sliced" on_press="true" on_hover="true" width="222" />
				<sprite depth="2" name="windowIcon" style="icon32px" pos="5,0" sprite="ui_game_symbol_fire"/>
				<label depth="2" name="onoff" pos="0,-6" justify="center" text="TURN ON" font_size="26" />
			</rect>
		</panel>
	</window>

The colored code is what you change to a block that you want to use for fuel, i dont believe this will stop other fuel types from being stopped from use but if you have a type here most people will just use what they see.

then make sure you add this fuel window to your xui.xml

<window_group name="workstation_FarmersCampfire" controller="XUiC_WorkstationWindowGroup">
			<window name="windowCraftingList"/>
			<window name="craftingInfoPanel"/>
			<window name="windowCraftingQueue"/>
			<window name="windowToolsCampfireFarmer" />
			<window name="windowFuelFarmer" />
			<window name="windowOutput" />
			<window name="windowNonPagingHeader" />
		</window_group>

replace your fuel for the workstation with the colored code!

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.