Question for invisible resources.

Topics and discussion about specific mods
Post Reply
KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Question for invisible resources.

Post by KaraUL! »

Have a strange question, i begin to think, its impossible, SO how to change resource\entity parameters while catching certain event? Example i have zero selection boxes for coal at the game start. I need to change parameters of coal (type=resource) when event onbuiltentity (for example) is catched. I tried to call

Code: Select all

data.raw.resource["coal"].selection_box = ...
in "control.lua" but game said glob "data" is nil. Can u help me, any ideas how to solve this

Degraine
Filter Inserter
Filter Inserter
Posts: 281
Joined: Wed Aug 13, 2014 10:49 am
Contact:

Re: Question for invisible resources.

Post by Degraine »

This should be in the Modding Help subforum. As to the question...I'm not sure what you're trying to do. You can't alter the selection box of an entity ingame as far as I know, all that data is loaded and locked in at startup.

KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Re: Question for invisible resources.

Post by KaraUL! »

Degraine wrote:This should be in the Modding Help subforum. As to the question...I'm not sure what you're trying to do. You can't alter the selection box of an entity ingame as far as I know, all that data is loaded and locked in at startup.
Maybe we can change autoplace settings?

Code: Select all

game.entityprototypes.autoplace

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

Re: Question for invisible resources.

Post by Rseding91 »

KaraUL! wrote:Have a strange question, i begin to think, its impossible, SO how to change resource\entity parameters while catching certain event? Example i have zero selection boxes for coal at the game start. I need to change parameters of coal (type=resource) when event onbuiltentity (for example) is catched. I tried to call

Code: Select all

data.raw.resource["coal"].selection_box = ...
in "control.lua" but game said glob "data" is nil. Can u help me, any ideas how to solve this
You can't change the selection box runtime. You would need to make 2 different coal entities and swap them out when a drill is placed.
If you want to get ahold of me I'm almost always on Discord.

KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Re: Question for invisible resources.

Post by KaraUL! »

Rseding91 wrote:
KaraUL! wrote:Have a strange question, i begin to think, its impossible, SO how to change resource\entity parameters while catching certain event? Example i have zero selection boxes for coal at the game start. I need to change parameters of coal (type=resource) when event onbuiltentity (for example) is catched. I tried to call

Code: Select all

data.raw.resource["coal"].selection_box = ...
in "control.lua" but game said glob "data" is nil. Can u help me, any ideas how to solve this
You can't change the selection box runtime. You would need to make 2 different coal entities and swap them out when a drill is placed.

nice idea, it helps, thanks

Post Reply

Return to “Mods”