Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove valid crafting categories from the dummy entities. #28

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

nekizalb
Copy link
Contributor

this will prevent planning mods from considering the dummy machines

this will prevent planning mods from considering the dummy machines
@nekizalb
Copy link
Contributor Author

Hello. This is an attempt at fixing the issue I reported here: https://mods.factorio.com/mod/GhostOnWater/discussion/639e8cb611f3609bf9fa582b

The goal was to make the dummy entities invisible to factory planning mods such as Factory Planner. This accomplishes that goal by removing all valid crafting categories from the copied machines, such that they no longer have any valid recipes they can complete. This successfully hid the machines from Factory Planner's interface.

Please let me know if i did not follow a convention accurately. I have no modded factorio before...

Copy link
Owner

@KeinNiemand KeinNiemand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not every entity has a crafting category, only crafting machines have one (assembly machines for example) so there'd need to be a check to check if crafting category is set at all. Tough it seems like the game probably just ignores the crafting category fo entitys that dont have one.
Also constants.dummyPrefix should probably be used for the name of the category rather then just dummy since dummy is to generic and might be used by other mods.
Also this crashes the game becouse categorys.lua dosn't get loaded, there needs to be a require in data.lua tough I have done that.

@nekizalb
Copy link
Contributor Author

nekizalb commented Dec 24, 2022 via email

…entities are crafters)

Change to using the dummy prefix constant for the fake crafting group
@nekizalb
Copy link
Contributor Author

Ok, should be aligned to your requests. I initially wasn't sure whether the dash in the prefix would be an issue, but the game seems to have accepted it just fine. I was able to place ghosts on water for both crafters and non crafters, and Factory Planner still doesn't show the dummies as available for use.

@KeinNiemand KeinNiemand merged commit bac9aff into KeinNiemand:master Jan 9, 2023
@nekizalb nekizalb deleted the removeCraftingCategories branch January 10, 2023 21:55
@nekizalb nekizalb restored the removeCraftingCategories branch January 10, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants