[B18] Storage Crates v1.18.2 (3/23/2018) [Chemfuel Barrels! (now fixed)]

Started by l2evy, April 10, 2016, 03:44:35 AM

Previous topic - Next topic

WaYa

Quote from: mrofa on April 26, 2016, 12:54:05 PM
Regarding the force unpack, it was unfinished feature, dunno why/how it made into realese.
General idea of it was that either you can spend crafting time and retain metal plates from the box, or use force unpack to loose the plates.
So basicly it would just create the resources from the crate on the spot no need for colonist to take it back to bench

Do you have access to the uncompiled dll? if you do have the original project it should be a simple enough fix.  (i'd try doing it myself but I can't get it to decompile in a way that I can recompile it with any changes)

l2evy

Yes the uncompiled dll would be great. I tried to decompile so I could move away from the dll so I could get access to force unpack among other things awhile back. There was other mods I have seen that moved away from DLLs and retained the same features, not sure if that is possible with this but that would be cool and worth doing if so.

I have been meaning to do a new github just not got around to it yet so WaYa (and anyone else) can contribute if they wish, or just look at the changes I do either way. I welcome any and all help.

I recently have had less time to do stuff but I do try and work on it when I can so when I do get time to play the game, the mod will be ready and functioning.

I was ill the past few days and while laying in bed I went over all of the code and cleaned it up ready for github though. All of my sloppy edits and bad spacing. I have fixed the typos mentioned too in the earlier post. I am not sure if that warrants a new version so I will do a small version change just for the cleaner code, typo fixes and github upload in the near future.

Quote from: WaYa on April 24, 2016, 02:30:20 AM
another thing that'd be nice to have but tedious to make is a way to box up all those textiles.  when the defenses take out a few dozen manhunters those tend to build up really fast, or if I build up a massive cattle farm.

Textiles support is planned, as is everything from Alpha 12 and 13 I will get to work on it soon. I may need to do more benches if it goes off the page, maybe it will scroll if it gets that far not sure. I did post in the Mods > Help section but nobody seems to have any idea or the common consensus is just split up the items across different workbenches. I will come up with something, but any ideas are welcome too. I just do not want to end up with like 6 different workbenches people would need to do all the different items, and more as time goes on and new items added.

Maybe if we can get access to the dll we can use how it switches modes to switch item modes too perhaps, switch between textiles, minerals, ect. That would be great and if I know the code right for how packing/unpacking mode works, it just morphs it into another workbench that way. I could just utilize that, make other workbenches and have a mode switch for it. Maybe just use one workbench universal graphic, then a button to switch to all the resource types, then packing/unpack mode for it. Seems that might work in my head at least. Then it would not affect people who like to have workbenches for each thing so it will remember their orders, as you can place them, set them and never change it, then do the same for anything else.
Mod Maintainer/Coder of:

WaYa

Quote from: Ryoichi on April 27, 2016, 05:26:07 AM
Yes the uncompiled dll would be great. I tried to decompile so I could move away from the dll so I could get access to force unpack among other things awhile back. There was other mods I have seen that moved away from DLLs and retained the same features, not sure if that is possible with this but that would be cool and worth doing if so.

I have been meaning to do a new github just not got around to it yet so WaYa (and anyone else) can contribute if they wish, or just look at the changes I do either way. I welcome any and all help.

I recently have had less time to do stuff but I do try and work on it when I can so when I do get time to play the game, the mod will be ready and functioning.

I was ill the past few days and while laying in bed I went over all of the code and cleaned it up ready for github though. All of my sloppy edits and bad spacing. I have fixed the typos mentioned too in the earlier post. I am not sure if that warrants a new version so I will do a small version change just for the cleaner code, typo fixes and github upload in the near future.

Quote from: WaYa on April 24, 2016, 02:30:20 AM
another thing that'd be nice to have but tedious to make is a way to box up all those textiles.  when the defenses take out a few dozen manhunters those tend to build up really fast, or if I build up a massive cattle farm.

Textiles support is planned, as is everything from Alpha 12 and 13 I will get to work on it soon. I may need to do more benches if it goes off the page, maybe it will scroll if it gets that far not sure. I did post in the Mods > Help section but nobody seems to have any idea or the common consensus is just split up the items across different workbenches. I will come up with something, but any ideas are welcome too. I just do not want to end up with like 6 different workbenches people would need to do all the different items, and more as time goes on and new items added.

Maybe if we can get access to the dll we can use how it switches modes to switch item modes too perhaps, switch between textiles, minerals, ect. That would be great and if I know the code right for how packing/unpacking mode works, it just morphs it into another workbench that way. I could just utilize that, make other workbenches and have a mode switch for it. Maybe just use one workbench universal graphic, then a button to switch to all the resource types, then packing/unpack mode for it. Seems that might work in my head at least. Then it would not affect people who like to have workbenches for each thing so it will remember their orders, as you can place them, set them and never change it, then do the same for anything else.

Yeah.  I can mostly get it to decompile but it's imperfect.   From what I can see on the function for the forced unpack, it appears that it was originally designed so if you forced it open you'd not only not get back the materials but it intended to loose some of the contents.  the bug that makes it loose anything in the stack is how the game handles stacks to begin with.  a stack is really a single object with a counter, and the bug in the dll is that it runs a command to destroy the object where what it needed was a check to see if there is more than one in a stack so it'd reduce the stack by one if it's over 1.

from what i'm getting on how it'd loose materials when forcing it to unpack is it was based on all stacks being 75.  it'd first generate a random number 1-100, and if it was over 75 it'd change to another random number from half the stack to the full stack and the unpacked value being the result from that. 

if I were to rewrite that part i'd either add to the crate the function that makes it degrade over time if outside and base on how much you get from forcing it open on how far it has degraded, or change the randomizer so the return value is anything from 30% to 100% of the initial stack.  using the system of degrading it over time would actually make more sense and the purpose of the workbench would be to get a full return back and not a partial.

the problem with decompilers from what I can see is it messes up how it deals with a lot of variables and how the operators are called.  like, instead of being what it supposed to be it'd change it to base.whatever.  among other oddities.

As far as switching modes go on the workbench that is something i'd probably change how it functions entirely.  I'd change it so you have a single workbench with two initial options:  pack or unpack, then like say the smith bench, you'd check off the different items.  it'd simplify the workbench in any coding and give it more functionality.  (like say you want it to crate everything within a short range you can just have all the boxes checked and let it go on endless)  Unlike doing the canning, the shipping workbench had a LOT of animation detail put into it.  to retain the detail you'd be forced to using the workbench switching option or rewriting it to having 2 separate workbenches. and to say, most of the small details in it is overlooked.

if I were to rewrite it (I havn't done dll mods before) i'd change it so you'd only have a workbench for packing.  i'd also add in the feature so it slowly degrades if left outside, or can spoil if it's a perishable food item.
I'd change the unpacking to work similar to how the current force unpack works.  The difference is that the unpacking results would be based on how far it has degraded.  (if it's degraded less than 10% you'd get 100% back, otherwise you'd get back a percentage based on the hp minus the first 10%) and it'd have to unpack food giving it the value from the spoilage tracker if it's perishable. finally it'd have to require a pawn to go to the crate to do the unpacking.  (right now force unpacking is like having the hand of got reaching down and opening the crate)

WaYa

#33
another small balance thing I noticed:  all values on crates should be increased by 60:  need to include the value of the 6 steel plates.

also be good to add crates of steel plates, and crates of cans, and recipe's that can melt down the two back into steel. (if 4 steel makes 5 plates maybe 3 plates could be melted down to 2 steel so there's a slight metal loss? and something similar for the cans?)

Ipushnoobs

#34
great mod thanks for it but I seem to notice that when a colonist can't carry 75 items or more at once then they only use use their max carry limit when crating the items and when its opened you get 75. In my case I was getting an extra 10 every time it happened


[attachment deleted by admin - too old]

pktongrimworld


l2evy

#36
Quote from: pktongrimworld on August 24, 2016, 01:08:39 PM
anychance this gets updated to A14? :D

Working on it currently, I got the DLL took apart and going through all the code now.

There have been a few tricky changes from 13 > 14. Special meat is now a label tag put on standard meat so I have no idea how to work that into storage or if it is possible with the current code. For example the way I think it will work currently is you can pack up 75 Insect meat into a crate, when you unpack it (provided no crash) it will just give you back 75 normal meat, losing the insect label. That would make putting meat in a crate mostly worthless. For now I am just trying to get the main bulk of the mod working, I can disable specialty meat for now.

I would say I am 90% done to a first real playtest for bug finding. Maybe I will get it finished today and mostly updated to 14. If I do release the new version for 14 with special meat disabled, future update to fix should (in theory) not affect previous saves so you can just update the mod when it's complete finished and start packing/unpacking meat again as per normal, no need to restart.

Also with the next release I will be dumping everything onto github (including the decompiled DLL) so if anyone wants to help contribute they can and will be credited accordingly. I may even do that early ahead of time...since I keep getting sidetracked.

Quote from: WaYa on April 27, 2016, 08:55:54 PM
another small balance thing I noticed:  all values on crates should be increased by 60:  need to include the value of the 6 steel plates.

also be good to add crates of steel plates, and crates of cans, and recipe's that can melt down the two back into steel. (if 4 steel makes 5 plates maybe 3 plates could be melted down to 2 steel so there's a slight metal loss? and something similar for the cans?)

Noted down to be edited and fixed! Thanks for the report. I will check into a slight loss and maybe melting plates back into steel at a later date when I get support for 14 working.

Quote from: Ipushnoobs on May 19, 2016, 07:53:25 AM
great mod thanks for it but I seem to notice that when a colonist can't carry 75 items or more at once then they only use use their max carry limit when crating the items and when its opened you get 75. In my case I was getting an extra 10 every time it happened


Ah Interesting, Soon as I get support for 14 in place I will take a quick look at this! Thanks for the report.
(Edit: I have looked into this issue and determined it is a core bug with numerous reports of this and other variations already. Tynan and crew will fix it in time.)

*Edit*: I changed my name to l2evy to match my Github.

*Edit #2: Shaped up the main topic abit, Fixed and added Github. While I was messing around coding and ready to push a Alpha 14 Test ...Alpha 15 was released...lol. Looks like I got more work to do but for now, relax and sleep and let any hotfixes for the new alpha get situated. If all goes well, Alpha 15 update for the mod tomorrow!
Mod Maintainer/Coder of:

l2evy

#37
Alpha 14 I setup and put it in the new Dropbox Archive Folder link (For people who do not want to come to Alpha 15 yet but still wanna store things) and updated the current main 3 links to Alpha 15.

Sorry for my long absence from 13 > Now, Had alot on my plate I hope to have more time to play around with the mod and overhaul the graphics for the crates and add more item support.

I tossed both the code and decompiled dll on GitHub so if anyone wants to tinker around feel free.

I had a little to drink and rather tired so my testing was quick and wanted to finish getting it released...if I missed a bug I am sorry please report and I will get on it soon as I wake up. Testing was done on the latest as of now ( 0.15.1280 ) AKA Alpha 15b

NOTE: Need to fix the bug Ipushnoobs mentioned about colonist with lower than full carry limit of 75 and opening crates.

------Changes----------
8/29/16 1.14.0 > 1.15.0
-Updated Mod for Alpha 15

8/29/16 1.03 > 1.14.0
-Updated Mod for Alpha 14
-Version number change, 1.XX.Y, XX= Game Version, Y=Mod Version Number
-Removed option to pack/unpack mega scarab meat due to Alpha 14 meat system slight change, may be fixed in later update
Mod Maintainer/Coder of:

TuefelHundenIV

#38
Just a heads up. In the mod loader it still says it is for version .14. 

I did make sure to download from one of the top three links.  The file is labeled as .15 after download.

Deimos Rast

#StopPluginAbuse

l2evy

Quote from: TuefelHundenIV on August 30, 2016, 02:10:46 AM
Just a heads up. In the mod loader it still says it is for version .14. 

I did make sure to download from one of the top three links.  The file is labeled as .15 after download.

Oh yep, sorry about that, it is actually 15 I fixed the links now (was pointing to the wrong file that I missed the version edit on), all should be working now if you redownload. Sorry for the inconvenience.
Mod Maintainer/Coder of:

TuefelHundenIV

That seems to have cleared it up.  Thanks.

l2evy

#42
After abit more indepth testing just now I found a bug with reloading saves. It causes both benches for Normal and Food to lose the texture, but they still function just fine.

I would guess this happens on both Alpha 14 and 15.

I will be pushing out a fix for it as I think I know what it is, might take me some time though as I think it is in the DLL.

I have been working on support for the new Drugs but ran into this bug. I will make the bugfix a priority ASAP.

*Edit* I am done mostly with fixing one of the bugs, the other needs the next game hotfix Tynan is already aware of it.
I will update the links, new reply and changelog when I get everything together shortly.
Mod Maintainer/Coder of:

l2evy

8/31/16 1.15.0 > 1.15.1
-WARNING: This release will work ONLY for Alpha 15C and Forward! It will not work with Alpha 15 or 15b.
-Fixed issue in the DLL which caused textures to bug when reloading from a save (BIG THANKS to mrofa and others on the mod help topic)
-Added Support for Drugs


If anyone has any issues let me know. I do not own the game on steam to test with the unstable branch. I will be around a few more hours for if anyone has any feedback if something should go wrong. (Until 1AM ET or so most likely)

The reason for incompatibility for 15 and 15b is a bug in the core game which should be fixed in 15c and going foward.
Mod Maintainer/Coder of:

Deimos Rast

steam bro here; will test with unstable branch. I'm looking for "textures that bug on reloading a save" ?

EDIT:
Tested it with the Unstable branch on Steam, and I have bad news: I don't think it worked.
- Loading with just this mod active and Core (in dev mode) gives a long list of errors: "AgaveCrate already has short hash" for what seems every crate (see first two screenshots).
- BeaverMeatCrate is spelled BeverMeatCrate.
- Things seem to work fine in game. However, on reloading a save, the icon for "Force Unpack" becomes the "RedX" until you spawn a new crate in, at which point it updates and correctly displays the proper icon. (see last screenshot)

This is with the latest version, from the changelog: 1.15.1.

http://imgur.com/LcKo9ZZ
http://imgur.com/nWseg8u
http://imgur.com/TZZRdRJ
#StopPluginAbuse