Page 1 of 1

[1.4.16] Mod stash chance and value?

Posted: 27 Nov 2016, 21:35
by mkari37
Hi! Is it possible to mod both the chance of a stash being non-empty, and the value of the stash? I've played around in coc_treasure_manager.script, with the sections

Code: Select all

for i=1, math.floor(caches_count/2) do
   create_random_stash(true,"stash")
end
and

Code: Select all

local max_weight = math.random(80,130)
but it doesn't seem to have had much effect - still loads of poor or empty stashes.

Also, in coc_treasure_manager.script, at the top it says
To debug the actual results, start a new game. Then while in the loadscreen menu ctrl+left-click on the new 'autosave'. You
will find the <filename>.lua in your savegame folder. Search the file for 'caches'
but there is no mention of the word 'cache' in the resulting .lua file.

Thanks!

Re: [1.4.16] Mod stash chance and value?

Posted: 28 Nov 2016, 00:19
by Alundaio
What do you mean by empty stashes? Stashes should never be empty, unless you mean empty storage chests?

Code: Select all

for i=1, math.floor(caches_count/2) do
   create_random_stash(true,"stash")
end


This code creates a stash in one half of all the existing inventory boxes (storage chests) in the entire game. If you want all storage chests to be a stash then you just change the code to:

Code: Select all

for i=1, caches_count do


Increase max_weight will increase the amount of items in a stash. Value of an item is determined by it's cost and no real way to modify this without re-writing the stash system.

Re: [1.4.16] Mod stash chance and value?

Posted: 28 Nov 2016, 04:03
by mkari37
Ah... I think my terminology might be wrong.

What I mean by 'stash' is the containers you find in tree stumps, or pipes, or rotten logs, or safes, or backpacks, or green or blue chests you find in bases. So, what I'm after is that every time I look in a stump or log or safe, or whatever, even if I haven't been given the coordinates, I find something (and something better than a mouldy loaf and a bandage). Currently about 80% of the time they're empty (when I haven't been given the coordinates. If I have the coordinates, there's always some goodies in there).

I made the changes you suggested, and started a new game, but I'm still finding empty containers.

I'm running Warfare as well, but I'm pretty certain that it doesn't touch containers. I'll check though.

Re: [1.4.16] Mod stash chance and value?

Posted: 01 Dec 2016, 14:26
by mkari37
Ah, whoops. I accidentally dropped a ; in there. Working fine now!