Page 1 of 1

How to create a tech to modify chest sizes?

Posted: Sat Mar 04, 2017 10:45 pm
by ShadowScaleFTL
Hi, im stuck with idea to create a mod with tech tree which will add slots for existing storages. And i dont know how.

i dont find any modifyer for such thing, so i find advize to create sript in control to make this, but i dont know how


Here some code so tech

Code: Select all


{
		type = "technology",
		name = "warehouse-bonus-1",
		icon = Mod_Name .. "/graphics/technology/warehouse_tech_bonus.png",
		icon_size = 128,
                order = "b[warehouse-bonus-1]-c",
		prerequisites = {},
		unit =
		{
			count = 20,
			ingredients =
			{
				{"science-pack-1", 300},
			},
			time = 20
		},
	},
and code for control.lua

Code: Select all

script.on_event(defines.events.on_research_finished, function(event) 

	local name = research.name

    if name == "warehouse-bonus-1" then warehouse_size = 80 end  
but it didnt work. So i need help with this idea

Re: How to create a tech to modify chest sizes?

Posted: Sat Mar 04, 2017 10:57 pm
by Rseding91
You can't change container inventory sizes runtime. Doing that requires special backing logic in the C++ code which doesn't exist for container entities.

Re: How to create a tech to modify chest sizes?

Posted: Sat Mar 04, 2017 11:17 pm
by ShadowScaleFTL
Rseding91 wrote:You can't change container inventory sizes runtime. Doing that requires special backing logic in the C++ code which doesn't exist for container entities.
its sad, but i find this topic https://www.reddit.com/r/factorio/comme ... ty_trough/ with almost same issue

So ppl adviese to change all stuff on map with new one after reserching. It would looks the same what i want, but i dont understand how to create such script/function for my idea. I need some help with it...

Re: How to create a tech to modify chest sizes?

Posted: Sat Mar 04, 2017 11:23 pm
by darkfrei
You can make new prototypes and replace old chests with new by the script.

Re: How to create a tech to modify chest sizes?

Posted: Sat Mar 04, 2017 11:24 pm
by ShadowScaleFTL
darkfrei wrote:You can make new prototypes and replace old chests with new by the script.
can you help me with such script? i dont fine understand how to write it.