Aluminum Not Loading

Place to get help with not working mods / modding interface.
Post Reply
aeropar
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jun 11, 2018 9:34 pm
Contact:

Aluminum Not Loading

Post by aeropar »

--Not Getting Any Errors, But In-Game the Ore Does Not Spawn

data:extend
({
{
type = "autoplace-control",
name = "aluminum-ore",
icon = "__modbox_0.0.1__/graphics/icons/aluminum-ore.png",
icon_size = 32,
flags = {"placeable-neutral"},
category = "resource",
order="a-b-c",
infinite = false,
highlight = true,
minimum = 50000,
normal = 150000,
infinite_depletion_amount = 10,
resource_patch_search_radius = 10,
minable =
{
hardness = 2.75,
mining_time = 1,
results =
{
{
type = "item",
name = "aluminum-ore",
amount_min = 10,
amount_max = 10,
probability = 1
}
}
},
collision_box = {{ -1.4, -1.4}, {1.4, 1.4}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace =
{
control = "aluminum-ore",
sharpness = 1,
max_probability = 0.02,
richness_base = 240000,
richness_multiplier = 300000,
richness_multiplier_distance_bonus = 3000,
coverage = 0.02, -- Cover on average 2% of surface area.
peaks =
{
{
noise_layer = "aluminum-ore",
noise_octaves_difference = -1,
noise_persistence = 0.4,
}
}
},
stage_counts = {0},
stages =
{
sheet =
{
filename = "__modbox_0.0.1__/graphics/icons/aluminum-ore.png",
priority = "extra-high",
width = 75,
height = 61,
frame_count = 4,
variation_count = 1
}
},
map_color = {r=0.78, g=0.2, b=0.77},
map_grid = false
},
})

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

Re: Aluminum Not Loading

Post by bobingabout »

Use the code encapsulation, standard forum text will remove white space before the first character on a line, removing all indentation, but if you use the [ code ][ /code ](Spaces added so the forum doesn't actually parse it) encapsulation, it will keep this formatting, and even use uni-space font.


Anyway... from what I can tell, you've combined the resource definition's flags into an autoplace control definition... or at least just given it the wrong type.

you need 4 separate definitions. The resource, the auto place control, and the noise layer, plus an item for the mining result.

Look at how the base game does it, but coal, copper, iron and stone are now defined in a function, which makes it harder to read, so... take a look at how Uranium ore and Oil are defined (Mostly uranium, since that's likely more like what you're after, just keep in mind that required fluid is optional).

I believe you need to look in the files... data/base/prototypes/entity/resources.lua, data/base/prototypes/autoplace-controls.lua and data/base/prototypes/tile/noise-layers.lua (that last one I had to search for)
I'm sure you already know how to make an item.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: Aluminum Not Loading

Post by eradicator »

bobingabout wrote: you need 4 separate definitions. The resource, the auto place control, and the noise layer, plus an item for the mining result.
I have no experience with autoplace, so i'd like to ask some questions too :D
a) Is the autoplace_control actually technically required (as opposed to recommended)? I thought it's only to change the values, so if you don't have one it always uses the default values?
b) I can see that some of the decoratives share the same noise-layer. So, what is the difference between shared/seperate noise layer autoplacements?

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

Re: Aluminum Not Loading

Post by bobingabout »

a. You are correct, the autoplace control is simply that, a control. if you don't specify it, you just get whatever the defaults would be.
b. There are other things that help determine this, note biter nests and worms, it all shares the same noise layer. you'll just end up with a mix of it all in the same area, this is determined by the density, or whatever it is called (I'm not looking at code)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

aeropar
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jun 11, 2018 9:34 pm
Contact:

Re: Aluminum Not Loading

Post by aeropar »

bobingabout wrote:Use the code encapsulation, standard forum text will remove white space before the first character on a line, removing all indentation, but if you use the [ code ][ /code ](Spaces added so the forum doesn't actually parse it) encapsulation, it will keep this formatting, and even use uni-space font.


Anyway... from what I can tell, you've combined the resource definition's flags into an autoplace control definition... or at least just given it the wrong type.

you need 4 separate definitions. The resource, the auto place control, and the noise layer, plus an item for the mining result.

Look at how the base game does it, but coal, copper, iron and stone are now defined in a function, which makes it harder to read, so... take a look at how Uranium ore and Oil are defined (Mostly uranium, since that's likely more like what you're after, just keep in mind that required fluid is optional).

I believe you need to look in the files... data/base/prototypes/entity/resources.lua, data/base/prototypes/autoplace-controls.lua and data/base/prototypes/tile/noise-layers.lua (that last one I had to search for)
I'm sure you already know how to make an item.

Code: Select all

data:extend
({
	{
	type = "item",
	name = "aluminum-ore",
	icon = "__modbox__/graphics/icons/aluminum.png",
	icon_size = 32,
	stack_size = 64,
	flags = 
		{
			"goes-to-main-inventory"
		},
	},
})
look decent?

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

Re: Aluminum Not Loading

Post by bobingabout »

aeropar wrote:

Code: Select all

data:extend
({
	{
	type = "item",
	name = "aluminum-ore",
	icon = "__modbox__/graphics/icons/aluminum.png",
	icon_size = 32,
	stack_size = 64,
	flags = 
		{
			"goes-to-main-inventory"
		},
	},
})
look decent?
That's the item definition at least. You were having trouble with making the ore field itself though, right?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

aeropar
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jun 11, 2018 9:34 pm
Contact:

Re: Aluminum Not Loading

Post by aeropar »

bobingabout wrote:
aeropar wrote:

Code: Select all

data:extend
({
	{
	type = "item",
	name = "aluminum-ore",
	icon = "__modbox__/graphics/icons/aluminum.png",
	icon_size = 32,
	stack_size = 64,
	flags = 
		{
			"goes-to-main-inventory"
		},
	},
})
look decent?
That's the item definition at least. You were having trouble with making the ore field itself though, right?
Correct, but with the help you gave me I got it working: https://gyazo.com/33e33aef7547828cf8a13a2b1f5539d9 Still need to adjust some colors, start adding recipes and so on.

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

Re: Aluminum Not Loading

Post by bobingabout »

aeropar wrote:
bobingabout wrote:
aeropar wrote:

Code: Select all

data:extend
({
	{
	type = "item",
	name = "aluminum-ore",
	icon = "__modbox__/graphics/icons/aluminum.png",
	icon_size = 32,
	stack_size = 64,
	flags = 
		{
			"goes-to-main-inventory"
		},
	},
})
look decent?
That's the item definition at least. You were having trouble with making the ore field itself though, right?
Correct, but with the help you gave me I got it working: https://gyazo.com/33e33aef7547828cf8a13a2b1f5539d9 Still need to adjust some colors, start adding recipes and so on.
Awesome, if you need any more help, just do what you've been doing and ask. I personally check the forums (I check my personal subforum a little more often) at least once a day several days of the week. (maybe 4 or 5 visits a week)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

aeropar
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jun 11, 2018 9:34 pm
Contact:

Re: Aluminum Not Loading

Post by aeropar »

Awesome, I am a pretty big fan, although my mod seems a bit un-needed since 5Dim adds what I was working on, so I installed 5Dims, and Yours, AAI, Yuoki, and Angels Mods to make sure im not making something already made.

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

Re: Aluminum Not Loading

Post by bobingabout »

aeropar wrote:Awesome, I am a pretty big fan, although my mod seems a bit un-needed since 5Dim adds what I was working on, so I installed 5Dims, and Yours, AAI, Yuoki, and Angels Mods to make sure im not making something already made.
My mod actually already has Bauxite (Aluminium ore), but I wasn't going to say anything. You were learning how to mod, I didn't want to spoil the experience.

My library mod also offers easier ways to add ores (unless something changed, 5Dim uses my library to make it's ores). There are plenty of options out there.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Modding help”