Jump to content

Turn Water Cooler Into WaterFilter {Just Code}


berticus0001

Recommended Posts

Hey all, it's been a while since i posted anything, RL and all that, but thought I'd share this little proof of concept to turn the water cooler into a water filtration system.

To filter one can or jar of murky water takes five minutes by default (it is a drip filter after all) or add the helmet filter mod (if you have one) to the tool section to decrease the time to 30 seconds.

Why bother when you can just boil it much faster? I hear you ask... this doesn't require fuel and nor does it raise your heat map.

Just remember, as the game stands, when you add the helmet filter mod you have to exit then re-enter the filter for the "quick" recipes to become active.

Like I said, it's PoC so quick and dirty, didn't bother with the localization but if you want to add that help yourselves.

Rejig, rework, repost, it's up to you.

 

bert

 

Edit: Added Modlet

 

Modlet¬

[ATTACH]26625[/ATTACH]

 

CODE¬

 

 

recipes.xml¬

 

<recipe name="drinkJarBoiledWater" count="1" craft_area="waterfilter" craft_time="300">

<ingredient name="drinkJarRiverWater" count="1"/>

</recipe>

 

<recipe name="drinkJarBoiledWater" count="1" craft_area="waterfilter" craft_time="300">

<ingredient name="resourceSnowBall" count="1"/>

<ingredient name="drinkJarEmpty" count="1"/>

</recipe>

 

<recipe name="drinkCanBoiledWater" count="1" craft_area="waterfilter" craft_time="300">

<ingredient name="drinkCanRiverWater" count="1"/>

</recipe>

 

<recipe name="drinkCanBoiledWater" count="1" craft_area="waterfilter" craft_time="300">

<ingredient name="resourceSnowBall" count="1"/>

<ingredient name="drinkCanEmpty" count="1"/>

</recipe>

 

<recipe name="drinkJarBoiledWater" count="1" craft_area="waterfilter" craft_time="30" craft_tool="modArmorWaterPurifier">

<ingredient name="resourceSnowBall" count="1"/>

<ingredient name="drinkJarEmpty" count="1"/>

</recipe>

 

<recipe name="drinkJarBoiledWater" count="1" craft_area="waterfilter" craft_time="30" craft_tool="modArmorWaterPurifier">

<ingredient name="drinkJarRiverWater" count="1"/>

</recipe>

 

<recipe name="drinkCanBoiledWater" count="1" craft_area="waterfilter" craft_time="30" craft_tool="modArmorWaterPurifier">

<ingredient name="drinkCanRiverWater" count="1"/>

</recipe>

 

<recipe name="drinkCanBoiledWater" count="1" craft_area="waterfilter" craft_time="30" craft_tool="modArmorWaterPurifier">

<ingredient name="resourceSnowBall" count="1"/>

<ingredient name="drinkCanEmpty" count="1"/>

</recipe>

 

<recipe name="waterfilter" count="1" craft_area="workbench">

<ingredient name="cntWaterCoolerFull" count="1"/>

<ingredient name="resourceDuctTape" count="5"/>

<ingredient name="resourceCloth" count="20"/>

<ingredient name="resourceCoal" count="10"/>

<ingredient name="resourceMetalPipe" count="5"/>

</recipe>

 

===========

 

blocks.xml¬

 

<block name="waterfilter">

<property name="Class" value="Workstation"/>

<property name="Material" value="Mmetal"/>

<property name="MaxDamage" value="250"/>

<property name="StabilitySupport" value="false"/>

<property name="Shape" value="ModelEntity"/>

<property name="Model" value="Entities/LootContainers/water_cooler_fullPrefab"/>

<property name="CustomIcon" value="cntWaterCoolerFull"/>

<property name="DisplayType" value="blockMulti" />

<property name="MultiBlockDim" value="1,2,1"/>

<property name="ImposterDontBlock" value="true"/>

<property name="Place" value="TowardsPlacerInverted"/>

<property name="OnlySimpleRotations" value="true"/>

<property name="IsTerrainDecoration" value="true"/>

<property name="Stacknumber" value="1"/>

 

<property class="Workstation">

<property name="Modules" value="tools,output"/>

<property name="CraftingAreaRecipes" value="waterfilter"/>

</property>

<property name="WorkstationIcon" value="ui_game_symbol_workbench" />

<property name="OpenSound" value="bucketfill_water" />

<property name="CloseSound" value="bucketfill_water" />

<property name="WorkstationJournalTip" value="workbenchTip" />

 

<property class="RepairItems">

<property name="resourceDuctTape" value="3"/>

<property name="resourceCloth" value="15"/>

<property name="resourceCoal" value="7"/>

<property name="resourceMetalPipe" value="3"/>

</property>

<drop event="Harvest" name="resourceDuctTape" count="3" tag="Disassemble"/>

<drop event="Harvest" name="resourceCloth" count="15" tag="Disassemble"/>

<drop event="Harvest" name="resourceCoal" count="7" tool_category="Disassemble"/>

<drop event="Harvest" name="resourceMetalPipe" count="3" tag="Disassemble"/>

<drop event="Destroy" count="0"/>

<drop event="Fall" name="terrDestroyedWoodDebris" count="0" prob="0.0" stick_chance="0"/>

<property name="TakeDelay" value="15"/>

<property name="DescriptionKey" value="workbenchDesc"/>

<property name="EconomicValue" value="776"/>

<property name="Group" value="Building,Science"/>

<property name="FilterTags" value="fdecor,fother,ffurniture"/>

<property name="SortOrder1" value="70i0"/>

</block>

 

===========

 

xui.xml¬

 

<window_group name="workstation_waterfilter" controller="XUiC_WorkstationWindowGroup">

<window name="windowCraftingList"/>

<window name="craftingInfoPanel"/>

<window name="windowCraftingQueue"/>

<window name="windowToolsFilter" />

<window name="windowOutput" />

<window name="windowNonPagingHeader" />

</window_group>

 

===========

 

windows.xml¬

 

<!--#$-IGS BEGIN: Adding cursor area. -$#-->

<window name="windowToolsFilter" width="228" height="121" panel="Right" cursor_area="true" >

<!--#$-IGS END.-$#-->

<panel style="header.panel">

<sprite style="header.icon" sprite="ui_game_symbol_wrench"/>

<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="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true" allow_sort_order="false"

required_tools="modArmorWaterPurifier" required_tools_only="true">

<required_item_stack name="0"/>

</grid>

 

</rect>

 

</window>

 

Water Filter.zip

Link to comment
Share on other sites

Hey stallionsden, thanks a lot!

Wouldn't say I'm "back", I've always been keeping an eye on the forums whenevr I can and just had a bit of free time lately so been following A17 Exp and found the cooler which reminded me of this idea, wanted something like this way back when but we didn't have access to enough of the code. Now I can throw a ton of jars in to filter and head out for the day knowing I'll have some nice fresh water ready to brew a cuppa when I get home from a hard days zombie-killin'.

Link to comment
Share on other sites

Great idea berticus0001 :) I made it into a modlet, and works great :) I also added an items.xml to increase stacksize of the cans from 1 to 15.

Also changed the recipe for the filter to use a bucket and ScrapPolymers instead of the watercooler. Will maybe look at making the watercoolers pickupable instead, but have to go walk the dog now. Just got home from celebrating christmas with family.

Also will look at making one recipe for each off the clean waters, instead of separate recipes for when using the purifier vs not using it. If I can add a modifier in the recipe that checks for the purifier, not sure how or if that works. ( I'm pretty new to both xml and xpath).

I can post it as a mod in a new post after I come back if you want, crediting you of course. I have a couple other modlets I should release too anyways. Or if you want, feel free to post it yourself, is 99% your code after all :)

Here's the current version I made if you wanna have a look :)

 

[ATTACH]26624[/ATTACH]

WaterFilter.zip

Link to comment
Share on other sites

:smile-new: No, the block is the new version of the cooler/filter, not sure you can get the game to ignore that there's no claim block around to pick up the in-game ones so you have to buy from the trader for a whole 1 duke, lol

As for the cans, well, as I said, it's proof of concept at the end of the day but as it requires a workbench to make you're probably beyond cans by that point though I suppose you can find a working bench in the world and the other parts are easy enough to find as long as your local trader has a cooler for sale you could make it almost straight away and still, six cans should be ok if thats where you're at in the game.

Like I said, rejig, rework, repost, variety is never a bad thing in my opinion! ;)

Also, as for getting it to not show the "quick" recipes if you don't have the helmet filter yet or vice-versa for the "slow" versions when you do I think the only way would be to have 2 distinct versions, each with it's own set or recipes but that would mean using the helmet filter as an upgrade item which you would then lose.

 

Edit, just thought, of course you can set the originals to be picked up, just like chairs, doh! But tbh I'm not a huge fan of text popups whenever you look at stuff, maybe "smack" it up? As in, when destroyed it drops itself.

Should be an easy edit if you want to add that to yours.

Link to comment
Share on other sites

I'm pretty sure you can make them drop when destroying one you find in the world, like GuppyCur did with his lights mod. I think its the adding of a dropevent on destroy, and a unity3d file with a usable version of the block that then drops when you destroy one. But then again I am pretty new to both modding xml files and xpath. I'll be using one with a recipe either way tho, just as I do with his lights mod. I just prefer being able to make them myself from resources thats available to gather and make without having to hunt down a trader that has one, but thats just personal preference:) And is the nice thing with modded, make stuff work the way you want :) Might be an idea having two recipes tho, one that uses the watercooler so its possible to make it easy if you find at trader as you say.

Agree about the cans tho, it just bugs me that they dont stack, even if I never use them :p

About the filter, shouldnt it be able to use that like you use cooking pots in a campfire, so it doesnt get consumed. Maybe make a custom purifier based off one of the tools thats used in other crafting stations and are craftable without needing to find/learn the mod recipe. I think I will look into that, and use the icon for the purifier and just change the color tint to differentiate them.

 

Edit: Just saw your edit. That should be possible I would think. Since its not supposed to be placed or anything it wont have to have any other properties than the one you destroy. Although having it drop a version that is placeable and with a modslot could be an idea. Just place and require a purifier installed in modslot for it to work..

Link to comment
Share on other sites

It is built to use the helmet filter the same as the campfire cooking pot, you only need it if you want it to be faster, so 30 seconds instead of 5 minutes without it, filtering water through cloth & coal (and technically there should be gravel and grades of shale (rock not oil)) does take ages hence the 5 mins without the more advanced helmet filter.

And yes, smack it so it drops itself as the generic bag so you don't need any extra models, you'll still get the correct icon while it's in your inventory, but a new recipe to make it yourself is easy enough.

Link to comment
Share on other sites

I was thinking of what you said about using it as an upgrade item which you would then lose. Thought you meant it would then use one for each clean water :p Maybe possible to add a modifier to the purifier that directly affects craftspeed? Not sure if that's possible. Would still need to be a new item, based off the purifier mod I assume. Or if I can add the purifier as a variable so the normal recipe will get a speed buff if purifier is present.

Of course it isn't that big of a deal that there's what looks like duplicate recipes, as they are different after all. Would just look nice if I could make it so there's one for each instead. And if I try and either make it, or fail but with understanding why, then that's one more step forward in the learning process ;)

I do feel I am seriously overthinking this now tho :p

Link to comment
Share on other sites

@berticus0001 I added a recipe into your recipe.xml so you can also craft a watercooler. Currently there is no craftable ingame recipe for it...

Did this to complement to your mod.

 

Add the following lines to your mod recipe.xml if you want:

 

------------------------------------------------

 

<recipe name="watercooler" count="1" craft_area="workbench">

<ingredient name="cntWaterCoolerBottle" count="1"/>

<ingredient name="resourceDuctTape" count="5"/>

<ingredient name="resourceScrapPolymers" count="10"/>

<ingredient name="resourceMetalPipe" count="5"/>

</recipe>

 

-------------------------------------------------

 

cheers

Link to comment
Share on other sites

@berticus0001 I added a recipe into your recipe.xml so you can also craft a watercooler. Currently there is no craftable ingame recipe for it...

Did this to complement to your mod.

 

Add the following lines to your mod recipe.xml if you want:

 

------------------------------------------------

 

<recipe name="watercooler" count="1" craft_area="workbench">

<ingredient name="cntWaterCoolerBottle" count="1"/>

<ingredient name="resourceDuctTape" count="5"/>

<ingredient name="resourceScrapPolymers" count="10"/>

<ingredient name="resourceMetalPipe" count="5"/>

</recipe>

 

-------------------------------------------------

 

cheers

 

The one I posted a few posts back is with a craftingrecipe that don't require a watercooler ;) And apparently you can buy watercooler at traders sometimes.

But a good option to do it that way aswell :)

Link to comment
Share on other sites

I updated my code because the previous one didn't worked... now it does :smile-new:

 

Here's the file if someone wants it.

[ATTACH]26673[/ATTACH]

 

 

@Quasimiyao I prefer to be able to craft an watercooler also... just in case i need it... :p

And i like it more to be realistic if you use an actual watercooler for it... When it comes to an apocapyse, you have to be inventive at times.

Waterfilterandcoolercraftable.zip

Link to comment
Share on other sites

@Quasimiyao I prefer to be able to craft an watercooler also... just in case i need it... :p

And i like it more to be realistic if you use an actual watercooler for it... When it comes to an apocapyse, you have to be inventive at times.

 

Thats why mine is made of a bucket, plastic, duct tape and some other stuff. McGyver style :cool-new:

Link to comment
Share on other sites

Thats why mine is made of a bucket, plastic, duct tape and some other stuff. McGyver style :cool-new:

 

Good old MacGyver! He made a bomb out of a match box! :p hahaha

Loved those series! That's why i became a big fan of Stargate SG-1, Richard Dean Anderson is such a great actor! (sorry i know, bit off-topic here!)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...