Page 1 of 1
Questions...
Posted: Fri Sep 25, 2020 5:54 am
by Suf
Hi All
First Question: let's say that i want to make an entity the player puts it diagonally. Can i add a rotation to collision_box or selection_box?
Second Question: When i made a simple-entity it worked fine and everything, but i want to add a line when the player hover their mouse over that entity on the map it tells them what that entity is, but it seems this just for resources only and not for simple-entity?
Third Question: Now this not a new question that i'm asking but since i got no answer i have to ask again here; how to remove the vanilla categories(and yeah Category=nil doesn't work it render that category not there and an error message appears tell me to add it back), it seems the lua pages have no information of how to remove things but add them, so if any tutorial or additional tips regarding the removal would be added to the lua pages that the modder searches for that would be amazing.
Thanks in Advance.
Re: Questions...
Posted: Fri Sep 25, 2020 7:13 am
by darkfrei
Suf wrote: Fri Sep 25, 2020 5:54 am
Hi All
First Question: let's say that i want to make an entity the player puts it diagonally. Can i add a rotation to collision_box or selection_box?
1. This entity must be car, rail or cliff. Maybe also tree, I am not sure.
Re: Questions...
Posted: Fri Sep 25, 2020 9:03 am
by Suf
darkfrei wrote: Fri Sep 25, 2020 7:13 am
Suf wrote: Fri Sep 25, 2020 5:54 am
Hi All
First Question: let's say that i want to make an entity the player puts it diagonally. Can i add a rotation to collision_box or selection_box?
1. This entity must be car, rail or cliff. Maybe also tree, I am not sure.
Yeah usually used for entity that generates in the map like trees and rocks not sure about the car though,but that wasn't my 2nd question,it was can you make the player know what these entities are from the map by hovering their mouse over them?
Re: Questions...
Posted: Fri Sep 25, 2020 10:52 am
by darkfrei
Suf wrote: Fri Sep 25, 2020 9:03 am
darkfrei wrote: Fri Sep 25, 2020 7:13 am
Suf wrote: Fri Sep 25, 2020 5:54 am
Hi All
First Question: let's say that i want to make an entity the player puts it diagonally. Can i add a rotation to collision_box or selection_box?
1. This entity must be car, rail or cliff. Maybe also tree, I am not sure.
Yeah usually used for entity that generates in the map like trees and rocks not sure about the car though,but that wasn't my 2nd question,it was can you make the player know what these entities are from the map by hovering their mouse over them?
https://lua-api.factorio.com/latest/eve ... ty_changed
I am not sure that it works in pixel map or zoom-to-world map. Probably not, but no other way.
Re: Questions...
Posted: Fri Oct 02, 2020 4:06 pm
by Suf
Any other answers to my second question or the others ones that had no answers yet?
i would like to know those things it would help me and other modders who may face those things in the future.
Thanks for all the help.
Re: Questions...
Posted: Fri Oct 02, 2020 4:14 pm
by darkfrei
Suf wrote: Fri Sep 25, 2020 5:54 am
Third Question: Now this not a new question that i'm asking but since i got no answer i have to ask again here; how to remove the vanilla categories(and yeah Category=nil doesn't work it render that category not there and an error message appears tell me to add it back), it seems the lua pages have no information of how to remove things but add them, so if any tutorial or additional tips regarding the removal would be added to the lua pages that the modder searches for that would be amazing.
What category you want to remove?
If you want to remove the fuel category, then you need to remove it from all defined prototypes:
The "nuclear" is defined in:
Code: Select all
data.raw["fuel-category"].nuclear = {type = "fuel-category", name = "nuclear"}
data.raw.reactor["nuclear-reactor"].energy_source.fuel_category = "nuclear"
data.raw.item["uranium-fuel-cell"].fuel_category = "nuclear"
If yo delete the first as
Code: Select all
data.raw["fuel-category"].nuclear = nil
and set the another two to "chemical"
Code: Select all
data.raw.reactor["nuclear-reactor"].energy_source.fuel_category = "chemical"
data.raw.item["uranium-fuel-cell"].fuel_category = "chemical"
then you get no error.
Of coarse another mods can add own prototypes and you are need to check it procedurally.
Code strings are from
viewtopic.php?t=45107
Re: Questions...
Posted: Fri Oct 02, 2020 4:20 pm
by darkfrei
How to remove recipe category:
set the defined
Code: Select all
data.raw["recipe-category"].smelting = {type = "recipe-category", name = "smelting"}
to
Code: Select all
data.raw["recipe-category"].smelting = nil
We are need to find all "smelting" and replace with (for example) "crafting":
Code: Select all
data.raw.furnace["stone-furnace"].crafting_categories = {"smelting"}
data.raw.furnace["electric-furnace"].crafting_categories = {"smelting"}
data.raw.furnace["steel-furnace"].crafting_categories = {"smelting"}
data.raw.recipe["copper-plate"].category = "smelting"
data.raw.recipe["iron-plate"].category = "smelting"
data.raw.recipe["stone-brick"].category = "smelting"
data.raw.recipe["steel-plate"].category = "smelting"
After all changings it must be:
Code: Select all
data.raw.furnace["stone-furnace"].crafting_categories = {"crafting"}
data.raw.furnace["electric-furnace"].crafting_categories = {"crafting"}
data.raw.furnace["steel-furnace"].crafting_categories = {"crafting"}
data.raw.recipe["copper-plate"].category = "crafting"
data.raw.recipe["iron-plate"].category = "crafting"
data.raw.recipe["stone-brick"].category = "crafting"
data.raw.recipe["steel-plate"].category = "crafting"
Code strings are from
viewtopic.php?t=45107
Re: Questions...
Posted: Fri Oct 02, 2020 4:30 pm
by Suf
darkfrei wrote: Fri Oct 02, 2020 4:14 pm
Suf wrote: Fri Sep 25, 2020 5:54 am
Third Question: Now this not a new question that i'm asking but since i got no answer i have to ask again here; how to remove the vanilla categories(and yeah Category=nil doesn't work it render that category not there and an error message appears tell me to add it back), it seems the lua pages have no information of how to remove things but add them, so if any tutorial or additional tips regarding the removal would be added to the lua pages that the modder searches for that would be amazing.
What category you want to remove?
If you want to remove the fuel category, then you need to remove it from all defined prototypes:
The "nuclear" is defined in:
Code: Select all
data.raw["fuel-category"].nuclear = {type = "fuel-category", name = "nuclear"}
data.raw.reactor["nuclear-reactor"].energy_source.fuel_category = "nuclear"
data.raw.item["uranium-fuel-cell"].fuel_category = "nuclear"
If yo delete the first as
Code: Select all
data.raw["fuel-category"].nuclear = nil
and set the another two to "chemical"
Code: Select all
data.raw.reactor["nuclear-reactor"].energy_source.fuel_category = "chemical"
data.raw.item["uranium-fuel-cell"].fuel_category = "chemical"
then you get no error.
Of coarse another mods can add own prototypes and you are need to check it procedurally.
so i guess that why it never worked perfectly with me(usually i just being told to use
Code: Select all
data.raw["fuel-category"].nuclear = nil
as an example and that's why it doesn't work)btw i haven't try your method yet, although im not really sure those actually do what im trying to achieve here what im trying to do here is removing the crafting tabs the players see(like combat tab, or production and replace them with costume ones that have their own items those what im trying to remove or hide; 5dim did that and i actually did use the method but the vanilla ones kept there.
Re: Questions...
Posted: Fri Oct 02, 2020 4:32 pm
by Suf
darkfrei wrote: Fri Oct 02, 2020 4:20 pm
How to remove recipe category:
set the defined
Code: Select all
data.raw["recipe-category"].smelting = {type = "recipe-category", name = "smelting"}
to
Code: Select all
data.raw["recipe-category"].smelting = nil
We are need to find all "smelting" and replace with (for example) "crafting":
Code: Select all
data.raw.furnace["stone-furnace"].crafting_categories = {"smelting"}
data.raw.furnace["electric-furnace"].crafting_categories = {"smelting"}
data.raw.furnace["steel-furnace"].crafting_categories = {"smelting"}
data.raw.recipe["copper-plate"].category = "smelting"
data.raw.recipe["iron-plate"].category = "smelting"
data.raw.recipe["stone-brick"].category = "smelting"
data.raw.recipe["steel-plate"].category = "smelting"
After all changings it must be:
Code: Select all
data.raw.furnace["stone-furnace"].crafting_categories = {"crafting"}
data.raw.furnace["electric-furnace"].crafting_categories = {"crafting"}
data.raw.furnace["steel-furnace"].crafting_categories = {"crafting"}
data.raw.recipe["copper-plate"].category = "crafting"
data.raw.recipe["iron-plate"].category = "crafting"
data.raw.recipe["stone-brick"].category = "crafting"
data.raw.recipe["steel-plate"].category = "crafting"
Code strings are from
viewtopic.php?t=45107
Thanks for the extra information about removing those categories

Re: Questions...
Posted: Sat Oct 03, 2020 6:07 am
by Suf
So i've tried something like this
Code: Select all
data.raw.armor["heavy-armor"].type="armor"
data.raw.armor["heavy-armor"].subgroup =nil
data.raw.recipe["heavy-armor"]=nil
data.raw.technology["heavy-armor"]=nil
data.raw.armor["heavy-armor"].order = "b"
as you may guessed im trying to remove everything related to the item or at least hide it until i decide where would i put it in the mod, but that doesn't work
it gives me this error : Error in assignID: technology with name 'heavy-armor' does not exist. It was removed by my mod.
apparently i have to assign a new technology to the heavy armor in this example, but what if i don't want to put that item in my mod, yeah that is my goal here total removal
thanks for help btw your method worked with items that has no technology like light-armor.
Re: Questions...
Posted: Sat Oct 03, 2020 7:37 am
by ickputzdirwech
The problem with just removing the heavy armor technology is that there might be other technologies that are dependent on it. In this case modular armor. The modular armor technology is also dependent on advanced electronics. So one way of dealing with this should be
Code: Select all
data.raw.technology["modular-armor"].prerequisites = {"advanced-electronics"}
This will override the existing table and therefore modular armor will only be dependent on advanced electronics.
Re: Questions...
Posted: Sat Oct 03, 2020 8:53 am
by Suf
ickputzdirwech wrote: Sat Oct 03, 2020 7:37 am
The problem with just removing the heavy armor technology is that there might be other technologies that are dependent on it. In this case modular armor. The modular armor technology is also dependent on advanced electronics. So one way of dealing with this should be
Code: Select all
data.raw.technology["modular-armor"].prerequisites = {"advanced-electronics"}
This will override the existing table and therefore modular armor will only be dependent on advanced electronics.
Thanks for help that indeed fixed the error

i'll be paying attention next time to anything related to the items technology-wise as well. thanks again