[Help] Change what rocks drop.

Place to get help with not working mods / modding interface.
Post Reply
Angry Panda
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Sep 22, 2020 1:11 pm
Contact:

[Help] Change what rocks drop.

Post by Angry Panda »

Hey,

Still pretty new to modding, been playing with a personal mod, currently I'm stuck trying to change what rocks drop.

if anyone could point me in the right direction on how i can call in the different rocks and tell it what they should drop... i was able to find a mod that will change it for trees... and that works. but it was one of the codes i don't fully understand.

this is the wood code (i have made the change so a tree will drop bugs instead of wood)

Code: Select all

  for _, tree in pairs(data.raw["tree"]) do
       tree.minable = {
         mining_particle = "wooden-particle",
         mining_time = 1.5,
         results = {
		   {
           type = "item",
           name = "bug-male",
           amount_min = 1,
           amount_max = 10,
		   }
		}
		}
      
      end
any explanation on how it works and if there are some things i could change to make it work for the rocks


thanks in advance for any help :)

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

Re: [Help] Change what rocks drop.

Post by darkfrei »

Angry Panda wrote:
Wed Sep 23, 2020 11:52 am
any explanation on how it works and if there are some things i could change to make it work for the rocks
1. See viewtopic.php?t=45107

2. This mod makes this log file:
2020-09-24T19_47_20.png
2020-09-24T19_47_20.png (29.67 KiB) Viewed 566 times
Do you want to change the minable results or loot?


Loot can be added as:

Code: Select all

data.raw["simple-entity"]["rock-huge"].loot = 
{
	{item = "stone", probability = 1, count_min = 25, count_max = 50}, -- vanilla values
	{item = "iron-ore", probability = 1, count_min = 1, count_max = 50}, -- 1 to 50 iron ores
	{item = "copper-ore", probability = 0.5, count = 1} -- one copper ore with probability  50%
}
minable results:

Code: Select all

data.raw["simple-entity"]["rock-huge"].minable.results = 
{
	{name = "stone", amount_min = 24, amount_max = 50}, -- vanilla values
	{name = "coal", amount_min = 24, amount_max = 50}, -- vanilla values
	{name = "uranium-ore", amount = 1} -- added one uranium ore
}	

Angry Panda
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Sep 22, 2020 1:11 pm
Contact:

Re: [Help] Change what rocks drop.

Post by Angry Panda »

Thanks a heap Darkfrei!!

that is awsome info, now lets see if i can implement it :)

Post Reply

Return to “Modding help”