Questions...

Place to get help with not working mods / modding interface.
Post Reply
Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Questions...

Post 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.

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

Re: Questions...

Post 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.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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?

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

Re: Questions...

Post 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.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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.

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

Re: Questions...

Post 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
Last edited by darkfrei on Fri Oct 02, 2020 4:23 pm, edited 1 time in total.

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

Re: Questions...

Post 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

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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 :)

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 768
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Questions...

Post 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.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Questions...

Post 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

Post Reply

Return to “Modding help”