How to create a tech to modify chest sizes?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 24
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

How to create a tech to modify chest sizes?

Post 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

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 24
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

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

Post 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...

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

Post by darkfrei »

You can make new prototypes and replace old chests with new by the script.

User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 24
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

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

Post 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.

Post Reply

Return to “Modding help”