Schall Endgame Evolution


Adds GUI to display evolution factor and monitor alien spawn rates. Adds progressively higher tiers of aliens (configurable) at very-late game, bringing some real challenge! (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro, Русский)

Content
3 years ago
0.16 - 1.1
36.0K
Enemies

b [Solved] Bug in runtime_mod_setting_changed

3 years ago
(updated 3 years ago)

Hello!

I'm the author of another mod, that inside the script changes one of the settings. This triggers an on_runtime_mod_setting_changed event, which Schall is processing with local function runtime_mod_setting_changed(e) in control.lua around line 98, and that code assumes player_index is set in the event. However, https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed explicitly says this isn't true in the case of a script changing a setting (which Utilization Monitor Blargh is doing - it's trying to update the mod setting tick box to match what is being toggled).

The problem is in SchallEndgameEvolution, line 98:

local function runtime_mod_setting_changed(e)
  local player = game.players[e.player_index]

One of the people posted something in the discussion for my mod ( https://mods.factorio.com/mod/UtilizationMonitorBlargh/discussion/601a07ccf5bdb41ee3c4791b ) since Factorio shows it at the top and is the hotkey triggering, but the problem seems to be in this mod.

Any chance this can get looked at, and thanks!

3 years ago

Sorry for the waiting. Finally have some time for Factorio modding.

Thanks for reporting.
I was not aware that can be optional, and was not expecting mod settings being changed by script.
Just released 0.17.16 / 0.18.8 / 1.0.2 / 1.1.1, which (hopefully) fixed the problem.

PS1: BTW, your "Show labels" hotkey/option is global, which means it will also affect all other players in a multiplayer game. Right? From a first glance (without actually testing), I thought its nature would be similar to "Alt-mode" hotkey and display, which is per-user basis.

PS2: Some of my earlier-written mods have similar syntax in runtime_mod_setting_changed() calls. Seems I will also need to update/fix them in a few days...

3 years ago

Sorry for the waiting. Finally have some time for Factorio modding.

Thanks for reporting.

No worries!

I was not aware that can be optional, and was not expecting mod settings being changed by script.

A couple people didn't know it either - I had the same issue reported for a couple mods.

PS1: BTW, your "Show labels" hotkey/option is global, which means it will also affect all other players in a multiplayer game. Right? From a first glance (without actually testing), I thought its nature would be similar to "Alt-mode" hotkey and display, which is per-user basis.

It is, and fixing that is on the to-do list (actually at position #1, because it's driving me crazy in the multiplayer games I run :) ), but doing so in a way that doesn't cause multiplayer desyncs is going to be interesting - the first couple takes at it ran into some Fun Issues, heh.

3 years ago

Don't know if you have solved the show labels "per player" problem or not.
I have some experience in this, and never have any MP desync issues. See if it may help you:
If you do the labels via flying-text, you can make use of the render_player property.
If you do it via LuaRendering, then get_players & set_players calls would be useful. I used these in Schall Pickup Tower to mimic radius visualization when player hovers mouse cursor over (like what the game did with turrets and roboports).

New response