ScienceCostTweaker Mod (mexmer)

by mexmer

Allows the cost of research to be tweaked, in terms of count, science packs and time. Edit its configs costs *.lua to tweak the multipliers. - Original mod made by UberWafe, this is adopted version for factorio from version 0.16 until current

Tweaks
3 months ago
0.16 - 1.1
70.0K

b angels and bob-weapon mods compatibility

3 years ago
(updated 3 years ago)

any science from angel mods is set as tier 1 multipliers, as are any alien science from bob-warfare mod.
From what i have found out while tracking down the reason its because bob-weapons mod uses non-standard science (science-pack-gold + alien colored packs), while angel is using non-standard ingredient listing in the technology prototypes (see below).

regular setup:
ingredients = {{"automation-science-pack",1},{"logistic-science-pack",1}}
angels setup:
ingredients = {{type = "item", name = "automation-science-pack", amount = 1}, {type = "item", name = "logistic-science-pack", amount = 1}}

UPDATE:
my recommendation would be to add local functions to access the proper fields in the table as opposed to directly using []. so instead of Value[1] and Value[2] for name and amount, use getName(Value) and getAmount(Value) or similar. Same thing for setting the amount afterwards, use setAmount(Value, amount). I got it working on my end using the following:

local function getIngredientName(ingredientRow)
if ingredientRow.name then
-- angel mod style: (type: {type="item", name="ingredient-pack", amount = quantity} )
return ingredientRow.name
else
-- name not found, so basic setup (type: {"ingredient-pack", quantity})
return ingredientRow[1]
end
end

local function getIngredientAmount(ingredientRow)
if ingredientRow.amount then
-- angel mod style: (type: {type="item", name="ingredient-pack", amount = quantity} )
return ingredientRow.amount
else
-- name not found, so basic setup (type: {"ingredient-pack", quantity})
return ingredientRow[2]
end
end

local function setIngredientAmount(ingredientRow, quantity)
if ingredientRow.amount then
--angel mod style
ingredientRow.amount = quantity
else
-- regular
ingredientRow[2] = quantity
end
end

and naturally in your ingredient check loop <<<for Index, Value in pairs( tech.unit.ingredients ) do>>>
you would use <<<getIngredientName(Value) == "science-pack">>>
and similarly in the setting stage where you get the name, get the amount, and set the amount.

If you want to view the full mod, its here (I added support for gold science pack : bob warfare mod as well)
https://www.dropbox.com/s/gx5wnw4lv4i7d7o/ScienceCostTweakerM_0.18.4.zip?dl=0

3 years ago

honestly i have no idea what are you trying to say.

please describe your problem, not how solution works. because i don't understand, what are you trying to solve in first place.

also please use github, on this forum, you can't format code.

3 years ago

Ok, sorry about that.
Issue: any research added by angel mods is counted as lowest tier science. This means that the cost of research for angel's stuff is hilariously low, and extremely disproportionate with the rest of the research (costing like 35 blue science while the rest of the stuff on the same level costs 600)

3 years ago

ah so you say, that science multiplier is not working, because it can't properly evaluate science packs on angels weapon mod.

i will check that, i have not changed science multiplier function from original, and original was for factorio v13 or 14, when mods were less flexible. i will check that.

3 years ago

i did some fixes in my code in past that handles object define science packs, just didn't look at science multiplier function ... should be fixed now for 1.0 and 1.1

This thread has been locked.