Page 1 of 1
[0.15.12] [kovarex] force.reset_technology_effects() stops research
Posted: Sat May 20, 2017 4:27 am
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!
Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research
Posted: Sun May 21, 2017 12:21 pm
by kovarex
What do you mean that the research done by the force is stopped? What did you expect this function would do?
Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research
Posted: Sun May 21, 2017 3:21 pm
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.
Re: [0.15.12] [kovarex] force.reset_technology_effects() stops research
Posted: Sun May 21, 2017 5:34 pm
by kovarex
Ok, thanks, fixed for 0.15.13