Jump to content

Spawning player at: [Load] (0.00, 0.00, 0.00) has some Transform nil BUG


StoneSplinter
  • Pending

 

I created a MOD with some mechanics, and encountered at least 2 bugs when testing player spawn coordinates at (0, 0, 0).

Hooked into playerspawner.SpawnAtLocation to force player spawning at coordinate [Load] (0.00, 0.00, 0.00).

log :   Spawning player at: [Load] (0.00, 0.00, 0.00)

 

Crash 1: After successfully entering the game at this location, connecting a game controller triggers a crash:

[00:01:33]: [string "scripts/components/playercontroller.lua"]:3130: attempt to index field 'Transform' (a nil value)
LUA ERROR stack traceback:
scripts/components/playercontroller.lua:3130 in (upvalue) UpdateControllerInteractionTarget (Lua) <3036-3228>

 

Crash 2: Still in this area, causes errors in birdspawner.SpawnBird:

          [string "scripts/components/birdspawner.lua"]:292: attempt to index field 'Transform' (a nil value)

         or 

          [string "scripts/components/birdspawner.lua"]:302: attempt to index field 'Transform' (a nil value)

 

 

Note: All above issues occurred in a save file without caves.


Steps to Reproduce
AddComponentPostInit("playerspawner", function(self)
       
        local old_SpawnAtLocation = self.SpawnAtLocation
        self.SpawnAtLocation = function(self,inst, player, x, y, z, isloading)
            local over_ride_location = Vector3(0,0,0)
            if over_ride_location then
                player.migration = nil
                x,y,z = over_ride_location.x, over_ride_location.y, over_ride_location.z
            end
            old_SpawnAtLocation(self,inst, player, x, y, z, isloading)
        end
 
    end)



User Feedback


There are no comments to display.



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...