Disabling vanilla ore generation

Place to get help with not working mods / modding interface.
Post Reply
Prapor
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 22, 2016 7:38 pm
Contact:

Disabling vanilla ore generation

Post by Prapor »

What are some ways to remove vanilla ore from the game? I tried to figure out how Arch666Angel does it, but his LUA kung fu is better than mine. I basically understand how to do it, but this is only in principle, how to implement it at LUA, I don’t understand (especially considering that LUA I know is lousy)

P.S. Maybe I will come back with the question of how to turn off vanilla technologies and recipes, but I hope I will deal with it myself

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Disabling vanilla ore generation

Post by orzelek »

You can find it in data-final-fixes.lua in RSO. It disables spawning but leaves ore items etc.
There are few potential ways to do it tho - it depends if you want the resourcecs to still show up in map setup menu for example.

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

Re: Disabling vanilla ore generation

Post by darkfrei »

Just look into data.raw: here is data.raw.resource, you can just delete autoplace from it.
Something like that (not tested):

Code: Select all

for i, resource in pairs (data.raw.resource) do
  resource.autoplace = nil
end

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Disabling vanilla ore generation

Post by eradicator »

Also be sure to only remove the autoplace (placement rules) for vanilla ores, and not the ores themselfs. Removing the ore (entity/item) itself would cause problems with many other mods.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Disabling vanilla ore generation

Post by bobingabout »

And if you remove the autoplace, don't forget to remove the autoplace control too. There's no point in it showing up on the map if you can't place it.
Though, that may require removing those controls from the difficulty presets.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Prapor
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 22, 2016 7:38 pm
Contact:

Re: Disabling vanilla ore generation

Post by Prapor »

Thanks ta all...

This, as I understand it, should be placed in data_update.lua?

Code: Select all

for i, resource in pairs (data.raw.resource) do
resource.autoplace = nil
resource.autoplace.control = nil
end

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

Re: Disabling vanilla ore generation

Post by darkfrei »

Prapor wrote:
Tue Oct 16, 2018 8:40 am
Thanks ta all...

This, as I understand it, should be placed in data_update.lua?

Code: Select all

for i, resource in pairs (data.raw.resource) do
resource.autoplace = nil
resource.autoplace.control = nil
end
If resource.autoplace is nil, then all inside of it is also nil, you MUST delete resource.autoplace.control = nil from your code.

First will be run all data.lua, then data-updates.lua, then data-final-fixes.lua. You cannot write it with "_".
https://lua-api.factorio.com/latest/Data-Lifecycle.html

Prapor
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 22, 2016 7:38 pm
Contact:

Re: Disabling vanilla ore generation

Post by Prapor »

darkfrei wrote:
Fri Oct 12, 2018 7:08 am
Just look into data.raw: here is data.raw.resource, you can just delete autoplace from it.
Something like that (not tested):

Code: Select all

for i, resource in pairs (data.raw.resource) do
  resource.autoplace = nil
end

I tried, but it doesn't work. I've tried putting this code in data.lua and data-update.lua-no effect.

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

Re: Disabling vanilla ore generation

Post by darkfrei »

Prapor wrote:
Tue Oct 16, 2018 10:47 am
I tried, but it doesn't work. I've tried putting this code in data.lua and data-update.lua-no effect.
You are need to restart the game after every data changing.

You can also start the game with this mod viewtopic.php?f=135&t=45107 and just open log file with Notepad++.

Prapor
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 22, 2016 7:38 pm
Contact:

Re: Disabling vanilla ore generation

Post by Prapor »

darkfrei wrote:
Tue Oct 16, 2018 10:57 am
Prapor wrote:
Tue Oct 16, 2018 10:47 am
I tried, but it doesn't work. I've tried putting this code in data.lua and data-update.lua-no effect.
You are need to restart the game after every data changing.

You can also start the game with this mod viewtopic.php?f=135&t=45107 and just open log file with Notepad++.
I forget changing a game version in info...
but now it give me a error
error.JPG
error.JPG (22.29 KiB) Viewed 3715 times

Prapor
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 22, 2016 7:38 pm
Contact:

Re: Disabling vanilla ore generation

Post by Prapor »

I solve it. Typo detection :)))

how do I remove deleted resources from the start menu?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Disabling vanilla ore generation

Post by eradicator »

By removing the autoplace control

Code: Select all

for i, resource in pairs (data.raw.resource) do
  resource.autoplace = nil
  data.raw["autoplace-control"][resource.name] = nil 
  end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: Disabling vanilla ore generation

Post by darkfrei »

Prapor wrote:
Tue Oct 16, 2018 11:22 am
but now it give me a error
error.JPG
Sorry, here is plural:

Code: Select all

for i, resource in pairs (data.raw.resources) do
  resource.autoplace = nil
end
Just one "s" more.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Disabling vanilla ore generation

Post by bobingabout »

Yes, I did say to remove the autoplace control. It is it's own thing, not part of the resource.

All the information has already been said in replies since my last message, but I can see why you got confused.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Disabling vanilla ore generation

Post by Arch666Angel »

bobingabout wrote:
Wed Oct 17, 2018 8:11 am
Yes, I did say to remove the autoplace control. It is it's own thing, not part of the resource.

All the information has already been said in replies since my last message, but I can see why you got confused.
:lol:

Post Reply

Return to “Modding help”