Momo +(30)Science Mod deprecated


Add more complex crafting for science. An overhaul mod make for 30 new Science Pack(MSP) Bob's, Angel's. Reintroduce Bob'sExtended Item. >> Include MOD PACK <<

5 years ago
0.16 - 0.17
17

a Retaining MSP config compatibility

6 years ago

I wanted to address something i saw on the page about MSP requiring all packs be enabled as this was a feature designed to enable various scenarios of incompatibility with any variety of mods past,present,or future.

In it's current method: setting the result count to 0 is how a pack is "disabled". Really, it just has it's recipe output set to nothing, and this is later checked by the function when scanning the tech tree. if any pack has a 0 as the config, it skips the step of adding that science to the technology and moves on.

This has the benefit of allowing vanilla+MSP play alongside a mod that say: removes all modules or all military equipment (who in their right mind would want this, i don't know). Or perhaps future mods that remove/replace/rename items and i simply don't have the time or energy to insert a 100 case scenarios for each vanilla change.

Your mod uses science packs as recipe ingredients. so my current method means this is no good.
If i were to set up new configs (separate from the result_count settings) to enable/disable packs from being added to technology alone (the recipe remains unaltered and the item is still unlocked/craftable as normal)

This should resolve the issue momo has with an explicit requirement for all packs to be "enabled", correct??

6 years ago

what i can do instead is during the data-updates section, if the config setting has been set to 0, the recipe uses the default recipe found in recipe.lua (no modification to the result_count, even though it is set to 0.) the function that checks for the config setting equalling to zero or not will work without change. And the item will still be craftable. regardless of if it is required in any research or not.

6 years ago
(updated 6 years ago)

Or.....i can set it up in a different way: a way that enables the settings to still be used to determine the result count (for use in tweaking the output of the packs individually, and with a different setup of config settings, a list of which packs can be included in research costs.

6 years ago
(updated 6 years ago)
6 years ago

Yes. currently the config settings for result_count were designed without the idea that someone may come along and want to use all the packs as crafting ingredients.
The design decision was to enable a method, by which packs could individually be disabled from being necessary for technology, effectively resolving compatability with mods that removed items that were ingredients or created other impossible scenarios.
But if i change the mod so that the result count is always > 0, regardless of if the player inputs 0. While treating a input of 0 as a "don't include this pack in technology costs"---that will solve both issues.

So the next release will have it so if a player puts 0 in the config, it'll ignore that and have the pack result = the default prototype's result * the multiplier, while also telling the mod "hey, by the way, don't make this pack required in any research, kay? okay. This means, with momo installed, the ability to reduce the cost of research still exists using this method, without breaking recipes or craftability. Without momo installed, nothing is really changed. Users may think it odd that inserting a 0 in crafting result is ignored, but i can explain this.

6 years ago

(honestly) i'd prefer if you don't assume all packs are enabled, but with 30 of them, that can be a bit of a coding nightmare. You could do a "for each pack (1-5) that exists: add as ingredient to item(x)", etc....but that's up to you.

6 years ago

the number one problem i get from players is the result of another mod changing a recipe of one of the items i use, or which technology unlocks an item that MSP expects to be unlocked elsewhere, or otherwise altering the game in someway when combined with various other mods that makes it so a specific pack can't be crafted at all, and without it, research can't proceed....so this feature was put it to enable a way to proceed with a game relatively painlessly (indeed, in a cheaper way).
there are actually a few options: I can edit the way the config is treated, such that, no input results in the pack having a crafting result of 0. an input of 0 will have the recipe result unchanged during the data-updates stage and it'll use the initial recipe default. Setting it to 0 will just remove it from technology costs. This fixes them not having a crafting result, and thus, can be made and used in your items....however: the entire purpose of this setting was for scenarios where the items NEEDED to craft the pack are unobtainable, it's a method to tell the game to not require them.

....for this reason: i think it may be best if the recipe for the items in momo change based upon which packs the player is able to craft (or has decided they want to play with).

6 years ago

take a look at bob's lib. he has a pretty good function for adding ingredients to a recipe...
you can do something similar for the MSP packs in a loop (check for each being enabled by the config setting within a for loop, if it has a crafting result not equal to zero, you can then add it as an ingredient. I think the only reason a player would turn a pack off is if it can't be crafted due to another mod interfering.

6 years ago
(updated 6 years ago)

I'm able to remove more-science-pack if it set to 0.
But crafting and technology still show is that normal?

6 years ago
(updated 6 years ago)

actually, yes. It was designed to still exist in the game. though it is essentially a ghost item if the player sets the value to 0. It was assumed that setting it to zero meant the game's recipes had been changed in a way that made the ingredients the pack needed to be uncraftable....which usually meant that no progress could continue.

setting any of the packs to have a result count = 0 prevents that pack from being added to any technology costs associated with research. It does not, however, remove the item itself, or the recipe from the game. It did have the drawback of making the recipe produce nothing (although i felt this was a mute point, because it was assumed that if the config was set to 0, this meant that another mod had made the necessary ingredients to craft the pack unobtainable...or the player did not want to play with this pack included and thus wanted it to be removed from technology costs, or there was some other issue)

See "Turrets" tech should normally have packs 1 and 2 as requirements for the research. setting pack 1 to have a result of 0 tells MSP to remove that pack from all technologies (not true, actually: it doesn't remove it. it simply never adds it)... and the recipe does in fact have it's result_count changed as well. though i was planning to adjust this...but then realized the whole reason for including this disabling-mechanism was because it was a method of telling the game 'hey, i can't make this science pack (because another mod has broken the recipe), so don't include it in any research costs'

so when you set the military pack to = 0, it doesn't actually remove the recipe unlock, it just prevents that pack from being necessary to complete any research. it does set the recipe to output nothing, but this was considered unimportant, as the only reason a person would disable a pack is if they can't craft the necessary ingredients.

6 years ago

admittingly, i could have coded the entire mod such that, in each prototype, it checked if the config for each pack. if the pack was disabled, the item prototype wouldn't create an item. data-lua wouldn't add a ghost image to the lab, recipe-lua wouldn't add a recipe, and technology-lua wouldn't add a recipe-unlock. it'd be truly removed from the game.
this caused issues if a player wanted to change the settings back and forth.

..the way i did it, the only change is to the recipe output and which packs get added to research costs.

6 years ago

--Set up science pack crafting-results based on config setting. Defaults will be used if the pack is disabled from technology. (prevents a recipe result = 0) While maintaining ability to disable a pack from being required for research.

for i=1,30 do
if not settings.startup["MSP-pack"..i.."-result"].value == "0" then
data.raw["recipe"]["more-science-pack-"..i].result_count = settings.startup["MSP-pack"..i.."-result"].value * settings.startup["moresciencepack-multiplier"].value
end
end

6 years ago

this combined with your change of checking if a pack has been set to 0, should mean, in those cases where an ingredient for one of my packs is uncraftable,(usually cause a mod has changed tech or recipe requirements) a player should be able to disable that particular pack and continue play with both momo and MSP installed.

6 years ago
(updated 6 years ago)

edit: nevermind...it's easier if i add the option i was thinking about to my mod.

6 years ago
(updated 6 years ago)

""

6 years ago
(updated 6 years ago)

(sorry!)

New response