Page 1 of 2

[REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sat Jan 06, 2018 6:12 pm
by nuhll
Hi,
i would suggest a mod which adds a "private buffer chest" which is actually automatic requesting all the items the player requests, so you can place them where u often visit your factory without waiting long for deliveries... :-)

besides the automtaic requesting what player requests, the chest should behave like a normal buffer chest.

Re: Private Buffer chest

Posted: Wed Jan 10, 2018 9:50 am
by nuhll
push this is a good idea :D please someone make it, shouldnt be hard!

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sat Jan 13, 2018 2:13 pm
by darkfrei
Some pseudo code for this mod (I haven't factorio right now)

Code: Select all

On player built entity event
And if entity is Private Buffer Chest then
Global.chests_amount = chests_amount + 1
Global.chests[chests_amount].entity = entity
Global.chests[chests_amount].player = player
End event

On tick event
If Global.chests_amount = 0 then return end
If not tick_index then tick_index = 1 end
If tick_index > chests_amount then tick_index = 1 end
Call function set_requester (tick_index)
Global.tick_index = tick_index + 1
End event

Function set_requester (tick_index)
-- Take all player's  requests Global.chests[tick_index].player and set to chest's request  Global.chests[tick_index].entity
End function
This code runs every tick only one chest and on next tick operates with next chest. So, you can have 10000 chests and performance will be always same.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sat Jan 13, 2018 2:34 pm
by nuhll
thanks for this.

But i dont know how to build factorio mods xD

I hope someone can use your code to create a mod :)

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sat Jan 13, 2018 11:56 pm
by darkfrei
Here is realization of your nice idea. Please test it enough.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:00 am
by nuhll
hmm, i added it to my mod dir, it shows ingame, its activated, but i cant find the item in the list?

I have ger client, if that matters?

Translation would be "Private Bufferkiste"
Much thanks

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:24 am
by darkfrei
Forgot this part:

Code: Select all

script.on_configuration_changed(function(data)
  for i, force in pairs (game.forces) do
    if force.technologies["construction-robotics"].researched then
      force.recipes["private-chest-buffer"].enabled = true
    end
  end
end)

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:36 am
by nuhll
Yes, works perfetly, now it just need the same request slots as the player :)

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:39 am
by darkfrei
nuhll wrote:Yes, works perfetly, now it just need the same request slots as the player :)
It's now have update from lowest: player filter and chest filter. Did you need 36 slots? Why 12 is not enough?

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:43 am
by nuhll
I usually request everything i need, so 36 is already really limiting :D (so i dont need to add and remove everytime). I just go back to base and i know i have everything i need.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:50 am
by darkfrei
nuhll wrote:I usually request everything i need, so 36 is already really limiting :D (so i dont need to add and remove everytime). I just go back to base and i know i have everything i need.
36 for request, 36 total?

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 12:56 am
by nuhll
yeah, atm im requesting 35 items :> Would show you a screenshot, but it seems like u cant screenshot "E" :(

Seems like u cant place it via bots, or nothing gets requestet. Besides that, working perfectly. Many thanks.

Thanks for the fix.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 14, 2018 1:08 am
by darkfrei
nuhll wrote:yeah, atm im requesting 35 items :> Would show you a screenshot, but it seems like u cant screenshot "E" :(
Why 35? It must be 36.
nuhll wrote:Seems like u cant place it via bots, or nothing gets requestet. Besides that, working perfectly. Many thanks.
This chests are for player supply, so tou must place it by youself, one for big part of factory is enough.

Please post any error or when you haven't, then please post about after few weeks.

Grüße
darfrei

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sat Jan 20, 2018 11:32 pm
by darkfrei
The mod is submitted to mod portal: https://mods.factorio.com/mod/PrivateBufferChest

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 21, 2018 12:02 am
by nuhll
Thanks! So far didnt noticed bugs.

Does the chest automatic have the same slot amount as the player?

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 21, 2018 12:23 am
by darkfrei
nuhll wrote:Thanks! So far didnt noticed bugs.

Does the chest automatic have the same slot amount as the player?
You are welcome! The same, but not more than 36.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 21, 2018 12:36 am
by nuhll
Perfect.

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Sun Jan 21, 2018 3:17 am
by nuhll
okay first crash, i put accidently for one second a - in it. Instant crash to main menu.

Also, could you make the chest bigger? Maybe via research? Not all my requestet items fit into it :/

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Tue Jan 23, 2018 8:57 am
by Xelan
Very very nice idea. Just gave it a try though and it doesn't seem to work :?
Yes, the mod is enabled and yes I placed the chest by hand. Heavily modded game though with full suit of bobs and pyanodons coal+fusion, which might be the issue.
Oh and also, is it possible for the private chest to be a seperate entity? I also use the chests to buffer large amounts of concrete and ammo, which wouldn't be possible if all buffer chests always request my stuff.

And a bigger chest would be nice indeed with bobs, since you can request more then 36 items in the lategame. I for one play with the warehousing mod too, so there might be a possible optional variant with a private buffer store-/warehouse

Re: [REQUEST] [NICE IDEA] Private Buffer chest

Posted: Tue Jan 23, 2018 2:26 pm
by nuhll
I guess the chest should scale with how much a player can request and scale with the inventory a player has.

If that is poissible, just let us place multiple near, and they become one bigger chest?