Jump to content

NullReferenceException: Object reference not set to an instance of an object


Recommended Posts

Hi everyone,

 

Steam files verified OK.

 

The latest Steam version of the game Alpha 19.2 (b4)

 

No mods.

 

2 person multiplayer.

 

I've made a mess, as I usually do, playing with what I shouldn't, without any knowledge about it, but I accept only 80% of the blame, as someone who lets kid in front of the wheel is the one responsible for the crashed car :)

 

Anyway, I created 2 player server in the game (playing and hosting on same PC) and played with friend for a few days until we came far enough to start planning strategy and tactics for future hordes, a sustainable, effective and efficient solution. After making it, it would be natural to test it, before a horde, so I came up with the idea of spawning a few zombies to see if they'll walk where we want to or they will find an easier path for them.

 

After spending 30 seconds on Google, I found some thread where someone was asking the same question and someone replied something like this "se X Y, where X is ID of entity near which new entity will be spawned (for example a zombie near a player) and Y is ID of entity type we want to spawn (specific zombie type ID)" , with an example "se 350 1".

 

Easy enough, I used "lpi" to list players, determined my ID is 304 and used "1" in Y place to spawn a zombie of type 1, not knowing which one it is.  I'm really lucky in general, so of course, "1" had to be a template zombie which obviously is not supposed to be spawned (now I understand why Microsoft won't let you be administrator of your own PC , but I don't know, seems irresponsible to allow random people to issue commands which could destroy their game and real time days of progress ).

 

Console started filling with dozens identical errors per second, not letting me close it or do anything (zombie was spawned, attacked me and killed me after a while, so at least that went almost as planned, I think he was invisible though). Quick Google search led me to "shutdown", so I closed server and game like that. After logging in again, same error continued, making the game unplayable. Another "shutdown" and restart.  Not knowing what else to do, I entered "kill 1" thinking it would perhaps kill that zombie and prevent error from happening and somehow that worked, stopping the error, even though it in fact didn't kill the template zombie, but a random dog (as I concluded it had, after thinking about it today, because it probably killed entity with ID "1" and not entity which type is "1"), as I found in the log few minutes ago. However it says dog 4030 was killed, not 1, as I said, no idea what I'm doing. Perhaps zombie despawned on it's own stopping the error.

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2020-12-07T01:02:14 46.226 INF Executing command 'kill 1'
2020-12-07T01:02:14 46.258 INF Entity animalZombieDog 4030 killed

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Anyway, now I can login and play without error happening (as can be seen in log 07.12. 18:56) , but if my friend tries to join the game, error continues (as can be seen in logs 07.12. 01:01 and 07.12. 01:04). Is it related to backpack somehow, as it's the last line that gets printed before error ?

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2020-12-07T01:03:22 114.206 INF RequestToSpawnPlayer: 312, 123, 6
2020-12-07T01:03:22 114.213 INF Created player with id=312
2020-12-07T01:03:24 116.260 INF 5141 EntityBackpack id 0, plyrId 304, (0.0, 0.0, 0.0) (0, 0), chunk False (0, 0, 0), items 54 ammo762mmBulletBall, ammo9mmBulletBall at (0, 0, 0, xz 0 0) : Read
2020-12-07T01:03:24 116.261 INF 5141 EntityBackpack id 5158, plyrId 304, (208.1, 81.0, 403.2) (13, 25), chunk True (13, 5, 25), items 54 ammo762mmBulletBall, ammo9mmBulletBall at (0, 0, 0, xz 0 0) : Write
2020-12-07T01:03:24 116.263 INF TileEntityLootContainer backpack write 0, 0, 0
2020-12-07T01:03:24 116.640 INF 5141 EntityBackpack id 5158, plyrId 304, (208.1, 81.0, 403.2) (13, 25), chunk True (13, 5, 25), items 54 ammo762mmBulletBall, ammo9mmBulletBall at (0, 0, 0, xz 0 0) : Start
NullReferenceException: Object reference not set to an instance of an object
  at LegacyAvatarController.Update () [0x00127] in <8966b1f384fe4ecab81b938f521bef70>:0
  at AvatarZombieController.Update () [0x00000] in <8966b1f384fe4ecab81b938f521bef70>:0

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Logs are attached and since it's a short error getting repeated infinitely, I will also paste it here:

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

2020-12-07T00:47:21 17258.181 INF Executing command 'lpi'
2020-12-07T00:47:26 17263.489 INF Executing command 'se 304 1'
NullReferenceException: Object reference not set to an instance of an object
  at LegacyAvatarController.Update () [0x00127] in <8966b1f384fe4ecab81b938f521bef70>:0
  at AvatarZombieController.Update () [0x00000] in <8966b1f384fe4ecab81b938f521bef70>:0
 
(Filename: <8966b1f384fe4ecab81b938f521bef70> Line: 0)

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Do you think killing that zombie would help? According to below, it's ID should be 5156, but if I type "kill 5156" now, I get the message that ID can't be found. Perhaps it despawned because I was reborn far away from the place where I was killed?

 

2020-12-07T00:53:17 132.193 INF GMSG: Player 'Andrej' died
2020-12-07T00:53:17 132.194 INF Entity Andrej 304 killed by zombieTemplateMale 5156

 

 

 

output_log__2020-12-06__19-59-25.txt output_log__2020-12-07__00-50-46.txt output_log__2020-12-07__01-01-12.txt output_log__2020-12-07__01-04-13.txt output_log__2020-12-07__18-56-49.txt

Edited by tandrej
Posted by accident before it was finished (see edit history)
Link to post
Share on other sites

Ok, two things. Spawning entities uses the entity ID list. You can get this list by just typing the "se" command without any arguments. Entry #1 is not an actual zed, but the main template so spawning it would have some errors. Which is where you run into your issue.

 

The second thing is that once an entity is spawned into the game, it gets a unique entity ID number. This is the number you would have to use in order for the kill command to work.

 

And then there's the rub. The entity has to be loaded in order for you to kill it. If you get close enough to load the entity you are spammed with NRE's and are unable to function.

Easiest way to fix it is to calculate the region file the affected entity is in, and nuke that file. You'll lose any constructions in the region though as it will be reset completely.

Link to post
Share on other sites
On 12/7/2020 at 3:27 PM, SylenThunder said:

 

And then there's the rub. The entity has to be loaded in order for you to kill it. If you get close enough to load the entity you are spammed with NRE's and are unable to function.

Easiest way to fix it is to calculate the region file the affected entity is in, and nuke that file. You'll lose any constructions in the region though as it will be reset completely.

Just asking as well as potentially helping. If the region has something you don't want reset, and they said it was a two player game, could player2 to go to the area, get spammed with NRE's while player1 kills the entity from a safe distance?

  • Thanks 1
Link to post
Share on other sites
5 hours ago, Spiked_Coffee said:

Just asking as well as potentially helping. If the region has something you don't want reset, and they said it was a two player game, could player2 to go to the area, get spammed with NRE's while player1 kills the entity from a safe distance?

It's possible. The issue may also be that the NRE spam overloads the host and they are unable to properly execute the command.

Link to post
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...