Page 1 of 4 123 ... LastLast
Results 1 to 15 of 54

Thread: Workstations - how to

  1. #1
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1

    Workstations - how to

    WORKSTATIONS

    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 Workstation
    So 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..

    Code:
    <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...

    Code:
    <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.

    Code:
    <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.

    Code:
    <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>
    Code:
    <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.
    Last edited by DieTillDay7; 12-31-2015 at 05:00 AM.

  2. #2
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    XUI

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

    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..

    Code:
    <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..

    Code:
    <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!

    Code:
    <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>
    Code:
    <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>

  3. #3
    Community Moderator OzHawkeye's Avatar
    Join Date
    Sep 2014
    Location
    Australia
    Posts
    3,429
    Rep Power
    1
    Good tutorial!

    I'll be referring to this once SDX7 is released and I can complete my Cannery mod.

  4. #4
    Tracker
    Join Date
    Nov 2014
    Posts
    204
    Rep Power
    0
    Is it possible to mix forge-type materials with non-forge items? For example could you "forge" an axe by using up unit_iron from the forge and wood from the user's inventory?

  5. #5
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    good question - this i have yet to test my self - but i shall do so and let you know - if not all you need to do is add wood to the list and make a units_wood and it will do same, but let me check on that for you!

  6. #6
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    Well tested and the answer would be - you cannot - you would need to make a unit_wood to do such a trick

    - - - Updated - - -

    how ever you could make the AXE head in the forge and craft it in a campfire or just on person

  7. #7
    Tracker mythan's Avatar
    Join Date
    Jan 2015
    Location
    http://oz.nz
    Posts
    230
    Rep Power
    0
    Hi DieTillDay7, thanks for this. Will be comparing this to a forge we created for our mod to make sure we covered everything.

    Did you find that if this is used on a dedicated server, the players will have to manually copy the "windows.xml" and "xui.xml" to their clients as it doesn't automatically get it from the server?

  8. #8
    Colony Founder h0tr0d's Avatar
    Join Date
    May 2014
    Location
    So Cal
    Posts
    3,386
    Rep Power
    1
    Quote Originally Posted by zackss View Post
    Is it possible to mix forge-type materials with non-forge items? For example could you "forge" an axe by using up unit_iron from the forge and wood from the user's inventory?

    You can change any recipe to or create a recipe for the forge; however, as he stated, the materials must be units on the right inside the forge (inputs).


    If you want I could show you how to add a material as something else you can smelt in the forge as well as change the fireaxe recipe to one for the forge.

    The gist is to create a unit as a base weight of 1 and forge input, then create a scrapIron type block that serves as the base scrap weight (of 5).

    Then it is all about altering the forge windows in the .xmls so it shows.

    Oh, and changing the forge entry to amend the inputs allowed.

    Quote Originally Posted by mythan View Post
    Did you find that if this is used on a dedicated server, the players will have to manually copy the "windows.xml" and "xui.xml" to their clients as it doesn't automatically get it from the server?
    No, they do not. Only the server.xmls need the changes.

    Another thing to note:

    If you change a block to be a workstation and it wasn't before, or you change the forge to have new inputs, I have found you need a new game/seed/map whatever your term is.
    Last edited by Roland; 12-31-2015 at 07:51 AM. Reason: removed fanboy comment

  9. #9
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    Quote Originally Posted by mythan View Post
    Hi DieTillDay7, thanks for this. Will be comparing this to a forge we created for our mod to make sure we covered everything.

    Did you find that if this is used on a dedicated server, the players will have to manually copy the "windows.xml" and "xui.xml" to their clients as it doesn't automatically get it from the server?
    im not aware of this because i always have my mod on client and on server , so id actually have to test this myself - but as far as i know and im no expert here - server always pushes all xml's to client , except rare things. they say recipes and items go from server to client, but i have found that to be untrue with certain items. Now that was back in 12.5, they may have fixed it by now im sure!

    - - - Updated - - -

    also, would like to say to everyone, that this is basic "GET YOU STARTED", there is much more to workstations i have not supplied the info here. I will, but i wanted a good starter for the people trying to make them, and i thought maybe one of my basic campfires and forges would help in that.

  10. #10
    Colony Founder Valmar's Avatar
    Join Date
    Jan 2015
    Posts
    4,121
    Rep Power
    1
    I just want to point out that there might be some confusing information about servers and workstations.

    The clients DO need the xui.xml file to use custom workstations. Without them they will not be able to interact with the workstation. It doesn't push to players. That being said the server will still need it to work.

    Depending on how deeply you've modified the workstation they may also need the windows.xml. In short, if you modified a window for that workstation then they'll need it. Though, in my experience anyway, you can make workstations, new campfires or new forges fine without touching the windows.xml




    Btw, great topic. Very informative. Nice looking out.

  11. #11
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    thx for your post

  12. #12
    Nomad
    Join Date
    Sep 2014
    Posts
    390
    Rep Power
    0
    awesome I will come in handy thank you.

  13. #13
    Colony Founder DieTillDay7's Avatar
    Join Date
    Oct 2015
    Posts
    1,221
    Rep Power
    1
    not a problem, hope it helps everyone!

  14. #14
    Colony Founder TSBX's Avatar
    Join Date
    Nov 2014
    Location
    "Welcome to Costco, I love you."
    Posts
    1,597
    Rep Power
    1
    Awesome tutorial!

    I have a question. Has anybody gotten <property name="MeltTimePerUnit" value="1" /> to reflect changes made to it? I tried a range of values from .01-1000 and saw no discernible change. I also reduced the <property name="Weight" value="5" /> to 1 to see if that would help, but no dice.

  15. #15
    Colony Founder Mortelentus's Avatar
    Join Date
    Jan 2015
    Location
    Portugal
    Posts
    1,364
    Rep Power
    1
    Hi,

    There's no way to force a workstation to accept only a certain type of fuel (let's say, coal), is there?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •