RimWorld

RimWorld

Red Alert!
 This topic has been pinned, so it's probably important
Admiral Zander  [developer] 14 Dec, 2022 @ 10:04am
Bug reports
bug reports are now to be posted in the discord
Last edited by Admiral Zander; 16 May, 2023 @ 8:33am
< >
Showing 1-15 of 15 comments
Dastardly Dragon 15 Dec, 2022 @ 11:59pm 
System.TypeInitializationException: The type initializer for 'RedAlert.Core' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object

When the alarm went off, this got spammed until the max messages limit. Also my lights no longer turn red.

Hugslib (There's probably a lot of random issues here) https://gist.github.com/bcf24527ae11e9003feba6c5683cf154
Last edited by Dastardly Dragon; 16 Dec, 2022 @ 12:00am
Dastardly Dragon 16 Dec, 2022 @ 10:00pm 
The funny thing about the above, is that it worked initially when I added it but then after the update that added the sound it broke the lights for me and will occasionally spam the nullreferenceexception
Admiral Zander  [developer] 16 Dec, 2022 @ 11:19pm 
its most likely some obscure mod incompatability, as i test it before each update. still waiting on taranchuks opinion on the logs
Admiral Zander  [developer] 17 Dec, 2022 @ 11:47am 
Originally posted by Dasdidly Dragon:
The funny thing about the above, is that it worked initially when I added it but then after the update that added the sound it broke the lights for me and will occasionally spam the nullreferenceexception
a fix has been pushed, let me know if it works
Dastardly Dragon 17 Dec, 2022 @ 11:37pm 
That fixed the issue on my end, I got no errors and lights are turning red again
Ataman 27 Dec, 2022 @ 8:03am 
Some kind of bug after fighting an infested ship part from VFE - Insectoids, caused all lights to stay permanently red. No errors/warnings in the logs either. I suspect Red Alert! forgot about the lights somehow once the conditions returned to normal because; after the incident, I could recolor the lights to other colors and those worked normally with Red Alert!

Also, I was unable to reproduce the issue a second time around...
Admiral Zander  [developer] 27 Dec, 2022 @ 10:19am 
i will relay it to taranchuk, but theres no guarantees without error logs
Ataman 27 Dec, 2022 @ 5:39pm 
It's probably a bug, not an error. I'll give you a heads up when I find a way to reproduce it.
Wisp 2 Feb, 2023 @ 8:34pm 
After defeating an active infestation, all threats on the map were defeated. But all lights are still set to red. They didn't default back to their standard color(s) after the alarms stopped.

https://gist.github.com/624d516370ead335160a578e39de96bf

Error logs are riddled due to some other mods being funky, but I hope the root of the dilemma is in there.

Delightful mod and I hope it's an easily-solvable situation. :sfsmug:
Admiral Zander  [developer] 3 Feb, 2023 @ 5:11pm 
Originally posted by Wisp:
After defeating an active infestation, all threats on the map were defeated. But all lights are still set to red. They didn't default back to their standard color(s) after the alarms stopped.

https://gist.github.com/624d516370ead335160a578e39de96bf

Error logs are riddled due to some other mods being funky, but I hope the root of the dilemma is in there.

Delightful mod and I hope it's an easily-solvable situation. :sfsmug:
please attempt to replicate the error with a less clogged error log. make sure to clear the log BEFORE replicating the error to get rid of those CE errors, taranchuk wasnt able to identify the issue because the log was full of just CE errors
Last edited by Admiral Zander; 3 Feb, 2023 @ 5:12pm
Wisp 3 Feb, 2023 @ 6:56pm 
Duly noted. I'll see what can be done about it.
Ataman 4 Feb, 2023 @ 3:05am 
taranchuk wasn't able to identify the issue because it doesn't cause an error in the log. I have 3 friends playing Rimworld and all of them had the same issue at *some* point without clear indication what could be causing it.

It's a bug in the code. On red alert, you're taking the existing colors and store those into a collection. Are you 100% sure that part can't get called twice, overwriting everything with red the second time?
Wisp 4 Feb, 2023 @ 12:21pm 
This is a good thought!
Admiral Zander  [developer] 4 Feb, 2023 @ 1:51pm 
Originally posted by Ataman:
taranchuk wasn't able to identify the issue because it doesn't cause an error in the log. I have 3 friends playing Rimworld and all of them had the same issue at *some* point without clear indication what could be causing it.

It's a bug in the code. On red alert, you're taking the existing colors and store those into a collection. Are you 100% sure that part can't get called twice, overwriting everything with red the second time?
could you send a copy of the save file this occured in to try and replicate it?
Ataman 7 Feb, 2023 @ 1:29pm 
Sadly, I'm not actively playing Rimworld at the moment. Aside from that, replicating never worked.

What I can tell you however is that I only used wall lights in my base so it could also be possible that wall lights specifically have an issue.

A possible problem I found after looking at your code:
MapComponent_RedAlert.MapComponentTick() only resets wall lights if (ColorInt)Core.GetGlowColorWallLights.Invoke(thingComp3, null) == Core.threatColor is true but from what I can see inside the WallLight.dll CompOffsetGlow.GlowColor might not always return the correct color. In fact, the private property _glowColor could be null in which case it returns the glow color from the corresponding CompProperties_GlowOffset and that might be a different color than Core.threatColor. When that happens, your code would not invoke Core.SetGlowColorWallLights but the savedColorsPerLamps list would still be cleared and delete any hope of recovery. Even if the wall lights are coded correctly, you can never be sure that yet another mod messed with it beforehand.

Suggestion: Do the same thing you're already doing with lampsToEnable. Create a second list and add all lights to it that have actually been reset. Then remove those entries from savedColorsPerLamps. Log an error if savedColorsPerLamps is not empty before clearing it (with additional info if possible). While that will not fix the issue, you would at least see something in peoples logs.
Last edited by Ataman; 7 Feb, 2023 @ 1:29pm
< >
Showing 1-15 of 15 comments
Per page: 1530 50