[0.15.12] [kovarex] force.reset_technology_effects() stops research

This subforum contains all the issues which we already resolved.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

[0.15.12] [kovarex] force.reset_technology_effects() stops research

Post by Mylon »

When I call force.reset_technology_effects(), all research being done by the force is stopped. This seems rather random and disruptive. I can work around, but I don't understand why this behavior would be part of the function.

Edit: Additionally, all research progress is lost!
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research

Post by kovarex »

What do you mean that the research done by the force is stopped? What did you expect this function would do?
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research

Post by Mylon »

Okay, more details:

State before:

force.laboratory_speed_modifier is -0.2 (modified through script)
Current research is Atomic Bomb.
Atomic Bomb progress is 0.5

State after calling force.reset_technology_effects():

force.laboratory_speed_modifier is 0.7 (related to number of research lab speed researched)
Current Research is nil.
Atomic Bomb progress is 0

Expected state after calling force.reset_technology_effects():

force.laboratory_speed_modifier is 0.7 (related to number of research lab speed researched)
Current research is Atomic Bomb.
Atomic Bomb progress is 0.5

My specific use case is I'm modifying a bunch of force modifiers via script. When they need to be updated, it's useful to have the base value of what the modifier is so I can modify that appropriately and force.reset_technology_effects() does this. I tried storing the current research progress as a var to work around, but it seems I need to wait one tick between calling force.current_technology = var and force.research_progress = var2 as the second statement fails due to current_technology still being nil.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research

Post by kovarex »

Ok, thanks, fixed for 0.15.13
Post Reply

Return to “Resolved Problems and Bugs”