Beacon Rebalance


Beacon rebalance mod that emulates the balance of Space Exploration's beacons, including the overload mechanic. (Now with Krastorio 2 and Bob's/SeaBlock compatibility!)

Tweaks
a month ago
1.1 - 2.0
20.5K

b "module_specification" crash

a month ago

This is specific to Factorio 2.0. When attempting to launch with this mod enabled, I get the following error.

Failed to load mods: wret-beacon-rebalance-mod/prototypes/entity.lua:192: attempt to index field 'module_specification' (a nil value)

Looking at entity.lua line 192, we see "beacon.module_specification.module_slots = 4". As far as I can tell, "module_specification" doesn't exist as a variable in 2.0. Instead, Beacons use a basic integer variable "module_slots". That would explain the nil value exception. Looking through the rest of the file, you seem to have fixed this issue everywhere else but here, which leads me to believe this definition slipped through. It seems to be conditional on a mod options setting ("wret-overload-enable-notnotmelon-style"), so chances are most people just don't have this on, but apparently it defaulted to on for me.

I did get it to work, but I ended up fixing three separate things: I replaced the reference of "beacon.module_specification.module_slots" to beacon.module_slots on line 192, I changed the value of "beacon.supply_area_distance" to 9 (from 9.2) on line 193 as that variable is an int, and I changed to a lowercase k in "1050kW" (was "1050KW") as the game insists on defining "kilo" like that and won't accept a capital K. Again, these are things you've done everywhere else, but I wanted to see if the mod will load. Having done all of the above, it did load without issue.

New response