Hello,
I have added a new resource to my mod. I'm still working on the details. But the first thing I noticed is, that the icon is not shown in the map generation dialogue. Where is this icon taken from? I would've guessed it is the icon specified in 'icon' of the resource prototype.
A reduced example code is attached.
Adding a new ressource to the game
Adding a new ressource to the game
- Attachments
-
- data.lua
- (1.38 KiB) Downloaded 48 times
Re: Adding a new ressource to the game
The things listed there are the resources that are placed on the map. So my guess is that you didn't add an icon for the autoplace-control prototype, just for the resource itself. The oil patch doesn't have the liquid black oil drop as icon, right? It has the sprite of oil pool that you see on the ground. So look for how sprite/icon references are handled for the prototypes of the other resources.
So I just checked in my Factorio/data/base/prototypes/autoplace-controls.lua file
and see things like
Look at localised_name. If you want an icon in the name, add an icon in the name. Add as many icons as you want. You can make it completely out of icons if you want.
So I just checked in my Factorio/data/base/prototypes/autoplace-controls.lua file
and see things like
Code: Select all
{
type = "autoplace-control",
name = "uranium-ore",
localised_name = {"", "[entity=uranium-ore] ", {"entity-name.uranium-ore"}},
richness = true,
order = "b-e",
category = "resource"
},
{
type = "autoplace-control",
name = "crude-oil",
localised_name = {"", "[entity=crude-oil] ", {"entity-name.crude-oil"}},
richness = true,
order = "b-f",
category = "resource"
},
Re: Adding a new ressource to the game
Wow, the icon is part of the name! Thanks, it's working now.
Re: Adding a new ressource to the game
Is it possible to prevent grass on a resource? Grass growing on top of a sunflower don't look right
Re: Adding a new ressource to the game
It is not possible to change the render_layer of a resource, correct? Sunflower on top of grass would be nice.
So the only way is to have no grass placed on the resource field. I already set 'remove_decoratives' to true. But this doesns't seem to work either.
Any ideas?
So the only way is to have no grass placed on the resource field. I already set 'remove_decoratives' to true. But this doesns't seem to work either.
Any ideas?
Re: Adding a new ressource to the game
If you are comfortable with control.lua scripting, you could add a simple-entity on top of each resource with the render_layer you want.
You would have to handle on_chunk_generated and on_resource_depleted events.
You would have to handle on_chunk_generated and on_resource_depleted events.
Re: Adding a new ressource to the game
Thanks for the idea! I'll take this in consideration, when starting to implement the control stage features. Do you thinks it is also possible to implement the richness based variations of the graphic?