Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upDisable items with the mod manager #5993
Conversation
This comment has been minimized.
This comment has been minimized.
|
Woah, this is golden! A great solution to the modularization/personalization problem! |
This comment has been minimized.
This comment has been minimized.
|
I guess it is appreciated if you do the same with monsters, as removing monsters from the monsters-spawns and compile it as a mod is not enough. |
This comment has been minimized.
This comment has been minimized.
|
Will look at the code tonight, but it sounds like we're half way to mod |
This comment has been minimized.
This comment has been minimized.
|
How does this affect probability? Forgive me if it's obvious, but I don't know the spawn generation code that well. If item A had a spawn chance of 10% of the time while items B and C each had a spawn chance of 45%, would item A still only spawn 10% of the time if B and C were blacklisted? |
This comment has been minimized.
This comment has been minimized.
|
Item spawn chances are relative. If the item group contains an item A with chance 10 and an item B with chance 40, item B will be spawned in 4 of 5 invocations. The item removal code respects that. The number of item generated will not chance, but their number is distributed among fewer types. This is inverse to adding an item to the item groups. Edit: wrong button. |
BevapDin
closed this
Feb 6, 2014
BevapDin
reopened this
Feb 6, 2014
This comment has been minimized.
This comment has been minimized.
|
Okay, that makes sense. Thanks! |
KA101
self-assigned this
Feb 7, 2014
This comment has been minimized.
This comment has been minimized.
|
May as well add it for critters, too. Not a merge-blocker, though. |
KA101
merged commit d91d8cc
into
CleverRaven:master
Feb 7, 2014
1 check passed
This comment has been minimized.
This comment has been minimized.
|
It's vitally important to capitalize that blacklist name. Lowercasing it breaks things. Badly. |
BevapDin commentedFeb 6, 2014
Because some items are referenced in the code directly, removing them from the json data is problematic. Similar, but much more serious for other things like skills, terrain, furniture ...
This PR add a new json type: ITEM_BLACKLIST (not the best name for it, any suggestions?)
It will remove the items from all item_groups and all recipes that have this item as result.
If the item appears as component/tool of a recipes it is removed there, too. If this leaves an empty component/tool list (which means item was required and there were no alternatives for it), the recipe is removed, too.
The item definition is not changed, the item will still spawn when the C++ code contains the item id directly (or the mapgen spawns it directly and not as part of an item group). Everything (including saves) will still have the item and the item will work like before (with the exception that it can not be used in crafting directly, but its item quality can still be used in crafting).
Same with construction.
For testing, put this in a json file that is loaded by the game (either something in data/json, or something in save/my-world/mods).
The rock item is in the normal field spawn list and wandering around gives fields that contain strawberries but no rocks. All the stone based tools have no recipe anymore. Recipes that allow a rock as alternatives for a hammer are still there, but with the rock as tool. Burning down a house will still give you rocks as this is coed in C++ and does not refer to a spawn list. The results of deconstruction of furniture/terrain is fixed in the code and not influenced hereby.
The blacklist is applied after loading all mods, so it applies to item groups/recipes from other mods, too. No to prevent that one can make a ITEM_WHITELIST which removes the item from the blacklist. Is this feasible?
Shall I add a similar thing for monsters?