Can you change the formula for crafting time?

Place to get help with not working mods / modding interface.
Post Reply
Balthazar
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Dec 10, 2013 10:58 am
Contact:

Can you change the formula for crafting time?

Post by Balthazar »

Ok first off i'm a complete scrub with lua, only started fiddling this week, and i'm stuck.

I want the time to change from the current form; recipe time/(speed * speed bonus) = production time, to (recipe time* 2^(number of productivity modules in machine))/(speed*speed bonus). The reason i wish to change it is because even if i figure out how to modify the speed bonus based on how many recipes are in the machine, it will make speed modules completely obsolete when even a tier 3 module will only reduce the time by 1/16th with 4 productivity modules in effect.

Anyone got any idea how/if this can be done?

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: Can you change the formula for crafting time?

Post by immibis »

I don't think you can.

Balthazar
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Dec 10, 2013 10:58 am
Contact:

Re: Can you change the formula for crafting time?

Post by Balthazar »

Well fuck guess that's not an option :/

Would i be able to do something more like this instead?

-create events for module inserted and module removed
-add an effect similar to being under a beacon to the assembler
-have effect modify speed to match 2^n, where n is some new variable attached to the machine and increased by 1 for each productivity module?

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Can you change the formula for crafting time?

Post by Holy-Fire »

Sorry for thread-jacking, but I have a very similar question, also on the topic of balancing productivity modules.

I want to change the formula for computing power consumption for a machine that has modules that modify the consumption.

The current formula is:
PowerConsumption = BasePower * (1 + PowerModifier)

I want to change it to:
PowerConsumption = BasePower * exp (PowerModifier)

(Where PowerModifier is the sum of the modifiers of all modules)

Is there some way to do it?

(I think this should be changed in the base game, but as long as that's not done...)

Post Reply

Return to “Modding help”