Jump to content

Crash When Firing "Intracosmic Blastershot" at Moving Meteorite ("Demolior")


SamLogan
  • Branch: Preview Branch Version: Windows Fixed

The game crashes with a NullReferenceException when firing an Intracosmic Blastershot from the Meteor Blaster at a moving target — specifically the Demolior meteorite — while it is approaching the colony. The issue appears to stem from the missile's logic relying on a static reference to the target’s position at firing time, which becomes invalid as Demolior continues to move.

Logs.txt


Steps to Reproduce
  • Wait for the Demolior meteorite to approach the asteroid (i.e., it must be actively moving across the Cluster Map).

  • Fire an Intracosmic Blastershot using the Meteor Blaster, targeting Demolior.

  • Let time pass until the missile explodes.

  • Observe that the game crashes at the moment the missile would typically complete its explosion animation.

  • Health 2



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Can confirm this issue.

Exception in: (ClusterMapLongRangeMissile).ClusterMapLongRangeMissile.root.explode. 
System.NullReferenceException: Object reference not set to an instance of an object
  at KMonoBehaviour.Subscribe (System.Int32 hash, System.Action`1[T] handler) [0x00001] in /home/build/workspace/game/Assets/Plugins/Klei/util/KMonoBehaviour.cs:416 
  at KMonoBehaviourExtensions.Subscribe (UnityEngine.GameObject go, System.Int32 hash, System.Action`1[T] handler) [0x00008] in /home/build/workspace/game/Assets/Plugins/Klei/util/KMonoBehaviour.cs:562 
  at ClusterMapLongRangeMissile+StatesInstance.SubscribeOnVisAnimComplete (ClusterMapVisualizer visualizer, System.Action`1[T] action) [0x0002d] in /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:240 
  at ClusterMapLongRangeMissile.<InitializeStates>b__12_1 (ClusterMapLongRangeMissile+StatesInstance smi) [0x0004a] in /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:77 
  at StateMachine`4+GenericInstance[StateMachineType,StateMachineInstanceType,MasterType,DefType].ExecuteActions (StateMachine`4+State[StateMachineType,StateMachineInstanceType,MasterType,DefType] state, System.Collections.Generic.List`1[T] actions) [0x00057] in /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:930 

UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
LogCatcher:UnityEngine.ILogHandler.LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at /home/build/workspace/game/Assets/scripts/game/Game.cs:47)
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Debug:LogError (object,UnityEngine.Object) (at /home/build/workspace/game/Assets/Plugins/Debug.cs:163)
DebugUtil:LogErrorArgs (UnityEngine.Object,object[]) (at /home/build/workspace/game/Assets/Plugins/Klei/util/DebugUtil.cs:219)
DebugUtil:LogException (UnityEngine.Object,string,System.Exception) (at /home/build/workspace/game/Assets/Plugins/Klei/util/DebugUtil.cs:229)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:ExecuteActions (StateMachine`4/State<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>,System.Collections.Generic.List`1<StateMachine/Action>) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:964)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:PushState (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:889)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:GoTo (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1186)
StateMachine/Instance:<ScheduleGoTo>b__44_0 (object) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:308)
Scheduler:Update () (at /home/build/workspace/game/Assets/scripts/ai/scheduler/Scheduler.cs:113)
GameScheduler:Update () (at /home/build/workspace/game/Assets/scripts/ai/scheduler/GameScheduler.cs:38)

Build: U56-671013-SCRP

Share this comment


Link to comment
Share on other sites

Can confirm this issue too,I can't launch a missile because the game crashes a second later.
I'm just waiting for the imminent impact of the asteroid.
 

Exception in: (ClusterMapLongRangeMissile).ClusterMapLongRangeMissile.root.travelling.moving. 
System.NullReferenceException: Object reference not set to an instance of an object
  at ClusterMapLongRangeMissile+StatesInstance.IsTraveling () [0x00008] in /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:224 
  at ClusterMapLongRangeMissile+<>c.<InitializeStates>b__12_0 (ClusterMapLongRangeMissile+StatesInstance smi) [0x00000] in /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:51 
  at GameStateMachine`4+State+<>c__DisplayClass118_0[StateMachineType,StateMachineInstanceType,MasterType,DefType].<EnterTransition>b__0 (StateMachineInstanceType smi) [0x00001] in /home/build/workspace/game/Assets/scripts/ai/statemachine/GameStateMachine.cs:2913 
  at StateMachine`4+GenericInstance[StateMachineType,StateMachineInstanceType,MasterType,DefType].ExecuteActions (StateMachine`4+State[StateMachineType,StateMachineInstanceType,MasterType,DefType] state, System.Collections.Generic.List`1[T] actions) [0x00057] in /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:930 

UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
LogCatcher:UnityEngine.ILogHandler.LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at /home/build/workspace/game/Assets/scripts/game/Game.cs:47)
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Debug:LogError (object,UnityEngine.Object) (at /home/build/workspace/game/Assets/Plugins/Debug.cs:163)
DebugUtil:LogErrorArgs (UnityEngine.Object,object[]) (at /home/build/workspace/game/Assets/Plugins/Klei/util/DebugUtil.cs:219)
DebugUtil:LogException (UnityEngine.Object,string,System.Exception) (at /home/build/workspace/game/Assets/Plugins/Klei/util/DebugUtil.cs:229)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:ExecuteActions (StateMachine`4/State<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>,System.Collections.Generic.List`1<StateMachine/Action>) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:964)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:PushState (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:889)
StateMachine`4/GenericInstance<ClusterMapLongRangeMissile, ClusterMapLongRangeMissile/StatesInstance, IStateMachineTarget, ClusterMapLongRangeMissile/Def>:GoTo (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1186)
ClusterMapLongRangeMissile/StatesInstance:Travel (AxialI,AxialI) (at /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:218)
ClusterMapLongRangeMissile/StatesInstance:Setup (AxialI,ClusterGridEntity) (at /home/build/workspace/game/Assets/scripts/Mods/ClusterMapLongRangeMissile.cs:164)
MissileLongRangeProjectile/StatesInstance:ExitWorldEnterStarmap () (at /home/build/workspace/game/Assets/scripts/game/Buildings/MissileLongRangeProjectile.cs:157)
MissileLongRangeProjectile/<>c:<InitializeStates>b__5_3 (MissileLongRangeProjectile/StatesInstance) (at /home/build/workspace/game/Assets/scripts/game/Buildings/MissileLongRangeProjectile.cs:46)
StateMachine`4/GenericInstance<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def>:ExecuteActions (StateMachine`4/State<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def>,System.Collections.Generic.List`1<StateMachine/Action>) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:930)
StateMachine`4/GenericInstance<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def>:PushState (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:889)
StateMachine`4/GenericInstance<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def>:GoTo (StateMachine/BaseState) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1186)
StateMachine`4/Parameter`1/Transition<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def, bool>:Evaluate (StateMachine/Instance) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1334)
StateMachine`4/Parameter`1/Context<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def, bool>:Set (bool,MissileLongRangeProjectile/StatesInstance,bool) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1412)
StateMachine`4/Parameter`1<MissileLongRangeProjectile, MissileLongRangeProjectile/StatesInstance, IStateMachineTarget, MissileLongRangeProjectile/Def, bool>:Set (bool,MissileLongRangeProjectile/StatesInstance,bool) (at /home/build/workspace/game/Assets/scripts/ai/statemachine/StateMachine.cs:1281)
MissileLongRangeProjectile/StatesInstance:UpdateLaunch (single) (at /home/build/workspace/game/Assets/scripts/game/Buildings/MissileLongRangeProjectile.cs:102)
MissileLongRangeProjectile/<>c:<InitializeStates>b__5_1 (MissileLongRangeProjectile/StatesInstance,single) (at /home/build/workspace/game/Assets/scripts/game/Buildings/MissileLongRangeProjectile.cs:29)
BucketUpdater`1<MissileLongRangeProjectile/StatesInstance>:Update (MissileLongRangeProjectile/StatesInstance,single) (at /home/build/workspace/game/Assets/Plugins/Klei/util/StateMachineUpdater.cs:96)
UpdateBucketWithUpdater`1<MissileLongRangeProjectile/StatesInstance>:Update (single) (at /home/build/workspace/game/Assets/Plugins/Klei/util/StateMachineUpdater.cs:79)
StateMachineUpdater/BucketGroup:AdvanceOneSubTick (single) (at /home/build/workspace/game/Assets/Plugins/Klei/util/StateMachineUpdater.cs:152)
StateMachineUpdater:AdvanceOneSimSubTick () (at /home/build/workspace/game/Assets/Plugins/Klei/util/StateMachineUpdater.cs:244)
Game:SimEveryTick (single) (at /home/build/workspace/game/Assets/scripts/game/Game.cs:1471)
Game:Update () (at /home/build/workspace/game/Assets/scripts/game/Game.cs:1446)

Build: U56-671013-SCRP

Festering Shelter.sav

Edited by Nachonike15

Share this comment


Link to comment
Share on other sites

The error only occurs if the asteroid moves once you've launched some missiles at it. If you time it properly, you can fire your missiles  in between the movements.
What you do is.. Save your game, launch a small volley of missiles ( 4-8 ) wait till they hit then save again, rinse and repeat. if you crash instead of them hitting, wait half a cycle or so, save and launch again. I've managed to destroy the asteroid using this method. You can just stockpile the rockets for launch in advance, and regulate the delivery of them with access control on the door leading up to the space biome.

 

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...