Nightvision Toggles

by GotLag

Adds key to toggle nightvision on and off.

Tweaks
3 years ago
0.17 - 1.1
2.58K

b Crash when attempt to use hotkey.

4 years ago

The mod Nightvision Toggles (1.0.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event NightvisionToggles::night-vision-toggle (ID 205)
NightvisionToggles/control.lua:27: attempt to index local 'new_nvg' (a nil value)
stack traceback:
NightvisionToggles/control.lua:27: in function <NightvisionToggles/control.lua:18>

4 years ago

What other mods are you running?

4 years ago

I am running quite a few mods. Krastorio 2 and Space Exploration major ones. Krastorio alter googles recipe, but as far as I am aware, should not change how the item itself works.

Mod list, although not sure it will fit in comment properly:
"name": "aai-industry",
"name": "aai-programmable-structures",
"name": "aai-programmable-vehicles",
"name": "aai-signal-transmission",
"name": "aai-signals",
"name": "aai-vehicles-chaingunner",
"name": "aai-vehicles-flame-tank",
"name": "aai-vehicles-flame-tumbler",
"name": "aai-vehicles-hauler",
"name": "aai-vehicles-laser-tank",
"name": "aai-vehicles-miner",
"name": "aai-vehicles-warden",
"name": "aai-zones",
"name": "alien-biomes",
"name": "alien-biomes-hr-terrain",
"name": "AlmostInvisibleElectricWires",
"name": "ArmouredBiters",
"name": "ArtilleryCombinator",
"name": "biter_factions",
"name": "bullet-trails",
"name": "cargo-ships",
"name": "clock",
"name": "Clockwork",
"name": "Cold_biters",
"name": "ConnectionBox",
"name": "Construction_Drones",
"name": "creeper",
"name": "DelayedRegen",
"name": "DragonIndustries",
"name": "Electric-Range",
"name": "ElectricTrain",
"name": "ElectricTrain-K2-Rebalance",
"name": "Explosive_biters",
"name": "FactorIO",
"name": "Factorissimo2",
"name": "flib",
"name": "FluidMustFlow",
"name": "FNEI",
"name": "Geothermal",
"name": "grappling-gun",
"name": "heat_glow",
"name": "helmod",
"name": "ImprovedCombinator",
"name": "informatron",
"name": "jetpack",
"name": "KR2_RTF_Tree_to_Seed",
"name": "Krastorio2",
"name": "krastorio2_extended_endgame",
"name": "Logistic-Gun-Turret",
"name": "Logistic-Machines",
"name": "LogisticTrainNetwork",
"name": "LootingRemnants",
"name": "minime",
"name": "MushroomCloud",
"name": "NextGenEvolution",
"name": "Nightfall",
"name": "NightvisionToggles",
"name": "platforms",
"name": "pushbutton",
"name": "regenerate-terrain",
"name": "robot_attrition",
"name": "SchallCircuitGroup",
"name": "SchallCircuitScaling",
"name": "SchallLampContrast",
"name": "Shield-FX",
"name": "SmallRobots",
"name": "space-exploration",
"name": "space-exploration-graphics",
"name": "space-exploration-hr-graphics",
"name": "space-exploration-postprocess",
"name": "Squeak Through",
"name": "Tral_robot_tree_farm",
"name": "Turret-Shields",
"name": "vanilla-loaders-hd-krastorio",
"name": "VehicleSnap",
"name": "vtk-armor-plating",
"name": "walls-block-spitters",
"name": "WireShortcuts",
"name": "Wood_Gasification",
"name": "ZRecycling",

3 years ago

Hi everyone.

I've got the same error. It's funny that it crashes the server and not the client. The crash does not bother me at all. I just restarted my server and stopped using the toggle key. I'm reporting this just in case this info helps anyone.

Factorio 1.0.0
ClearNightvision (1.0.1)
Krastorio2 (1.0.7)
RealisticFlashlight (0.2.1)
and ofc NightvisionToggles (1.0.5)
Full mod list below...

srv_1 | 351075.144 Error MainLoop.cpp:1207: Exception at tick 9843867: The mod Nightvision Toggles (1.0.5) caused a non-recoverable error.
srv_1 | Please report this error to the mod author.
srv_1 |
srv_1 | Error while running event NightvisionToggles::night-vision-toggle (ID 201)
srv_1 | NightvisionToggles/control.lua:27: attempt to index local 'new_nvg' (a nil value)
srv_1 | stack traceback:
srv_1 | NightvisionToggles/control.lua:27: in function <NightvisionToggles/control.lua:18>
srv_1 | 351075.146 Error ServerMultiplayerManager.cpp:90: MultiplayerManager failed: "The mod Nightvision Toggles (1.0.5) caused a non-recoverable error.
srv_1 | Please report this error to the mod author.
srv_1 |
srv_1 | Error while running event NightvisionToggles::night-vision-toggle (ID 201)
srv_1 | NightvisionToggles/control.lua:27: attempt to index local 'new_nvg' (a nil value)
srv_1 | stack traceback:
srv_1 | NightvisionToggles/control.lua:27: in function <NightvisionToggles/control.lua:18>"

Full mod list:
aai-industry
aai-programmable-vehicles
aai-signal-transmissio
aai-signals
aai-vehicles-chaingunner
aai-vehicles-hauler
aai-vehicles-miner
aai-vehicles-warden
aai-zones
alien-biomes
angelsaddons-storage
blueprint_flip_and_turn
Bottleneck
bullet-trails
ClearNightvision
clock
Construction_Drones
even-distribution
EvoGUI
Flare Stack
flib
Flow Control
grappling-gun
helmod
informatron
inventory-repair
jetpack
Krastorio2
lightorio
ModuleInserter
Natural_Evolution_Enemies
NightvisionToggles
qol_research
railloader
RealisticFlashlight
rewire-tool
robot_attrition
show-max-underground-distance
space-exploration
space-exploration-graphics
space-exploration-postprocess
Squeak Through
VehicleSnap
VisionRadar
walls-block-spitters
Warehousing
Waterfill_v17
wood-to-landfill

Happy holidays to those who are fortunate enough to have some time off!

3 years ago

I've released an update that hopefully fixes it.
Krastorio changes the nightvision goggles' grid size in data-updates, and normally this runs before NightvisionToggles copies the goggles to make the inactive version. I think that when certain optional dependencies are installed (eg Squeak Through), they push the load order back such that Krastorio's updates run after mine, which means that when you toggle NVGs the 1x1 Krastorio NVGs are removed and the mod tries to insert 2x2 disabled NVGs that don't fit in the space available, and the script crashes.
I've changed my mod to use data-final-fixes instead, and if that doesn't work it will just silently fail (losing the NVGs) instead of crashing the game.

New response