Jump to content
psykikk

rain barrel functions for self made barrels

Recommended Posts

some are probably already annoyed by me, as I am constantly writing about the same crap.. 

anyways : I am stilll trying to make it so that self fabricated metal barrels can be used as water collectors, PLUS act like world objects (being blocks you cannot move through).

 

much like those... except witrh the added funcitonality of the mentioned collector barrels. 

 

 

image.png.ca203f10e338b303ec1e336aff25dd40.png

 

 

I found a metal Drum in the recipes.txt and newitems.txt.

I also found several lua scripts, mainly

SMetalDrumSystem.lua, SMetalDrumGlobalObject.lua, ISMetalDrum.lua, 

CMetalDrumGlobalObject.lua, CMetalDrumSystem.lua

 

I suck at lua and have no clue, but it seemed to me those functionalities are already in the scripts. only thing blocking us using those is the fact that the recipoy requires blacksmithing, which is not in the game (yet ? )

 

so I though heck, lets try it out. 

I changed the recipe to a welding one. 

added some stuff, subtracted some stuff. 

 

and it works.

image.png.f0180eab1c28e7ebb91f6e0aadfd97f1.png

kind of. 

the object is created, YET

it cannot be placed int he world. and it cannot be created via GUI. 

it certainly does not have the right attributes...

image.png.e29e8c6acf4974041be41a9933baf553.png

 

it inherited all icons and weight and such. 

but it simply is not a world object but just somethign on the floor. 

 

 

so

if anyone is actually reading down to here, PLEASE, help me out here. 

 

what am I missing ? 

thank you guys so much in advance

 

 

 

 

 

Share this post


Link to post
Share on other sites

I'm new to modding in lua and haven't revisited my amateur Java skills but you might have to call a method that tracks the coords of your mouse, call a method to return those coords to a variable and then send those coords into another function that calls methods to make it an item you can place and collide with.  You really might have to decompile the source code and track down the mthods that allow you to do the things you want to do. I hope this helps.

Share this post


Link to post
Share on other sites

Hmm, I can test this out and play around with lua code to spawn in a metal drum barrel now that I figured out how to do the recipe modifications you did. I'll post back if I have any results.

Share this post


Link to post
Share on other sites
Posted (edited)

There we go, after playing around with the lua coding for a bit, I managed to get the Metal Drum to spawn and be placed down.

They can be interacted with.

They can also be disassembled. (Disassembling the Drums will put them back in your inventory or on the ground)

 

I'll PM you the mod folder which contains all of the recipes and lua scripts.

 

If you have any questions about the mod, feel free to ask me.

Here's some screenshots:

599885309_2020-03-05(14).thumb.png.553598f22b302d8eae76419b5b5e1404.png876363446_2020-03-05(7).thumb.png.bfcb8546f110845d240dbbdeda5bfd87.png

image.thumb.png.c79d06fda5c69f566209ca8b054be829.png

605748119_2020-03-05(19)-C.png.8d1fa623314b5cae028bb5a334793462.png

1062694728_2020-03-05(21).jpg.6bc49ab3be1002dfb1d9b2e0fd618927.jpg

 

 

Edited by ATPHHe

Share this post


Link to post
Share on other sites
Posted (edited)

Had to add this in because build 40 doesn't show the water percentage inside the metal drums.

 

 

2020-03-06.thumb.png.2cb21de3de2004789bbace9fb3f15716.png1594513902_2020-03-06(1).thumb.png.eda60ab7dc612790c8ef1e7923da3f0e.png

 

 

Other images:

image.thumb.png.23b228dd85307be57d63d04fc41d12b1.png

 

Edited by ATPHHe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...