Jump to content

Game crashed for no reason and nothing special in logfile(added my mod)


Recommended Posts

the game crashed for no reason when entering the saves,  and there is no info useful for helping me debug it.

please have a look and tell me why, thanks for any help.

 

 

(first two files are by normal saves)

(last log file is created by a client-host game without server, and same symptom) 

client_log.txt master_server_log.txt client_log-for_a_client-host_save.txt

 

 

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

 

After testing, the bug section may be this(or not), but i still cant tell the wrong code

 

AddPrefabPostInit("moving_box_full_placer", function(inst)

	-- this function only responsible for anim of preview of the structures
	if GLOBAL.MOVING_BOX_PLACER_NAME ~= nil then
		local tmp_inst = GLOBAL.SpawnPrefab(GLOBAL.MOVING_BOX_PLACER_NAME)
	
		if tmp_inst~=nil then
			print("[MOVINGBOX]GLOBAL.MOVING_BOX_PLACER_NAME  "..GLOBAL.MOVING_BOX_PLACER_NAME)

			-- varied for wall and gate
			if tmp_inst.isdoor or string.find(tmp_inst.name, "gate")~=nil or string.find(tmp_inst.name, "wall")~=nil then

				local pref = GLOBAL.MOVING_BOX_PLACER_NAME
				if string.sub(pref, -1 * string.len("_placer")) == "_placer" then
					pref = string.sub(pref,1,  -1 * string.len("_placer") - 1)
				end
				if string.sub(pref, -1 * string.len("_item")) == "_item" then
					pref = string.sub(pref,1,  -1 * string.len("_item") - 1)
				end

				inst.Transform:SetEightFaced()
				-- inst.Transform:SetRotation(90)
				-- inst.AnimState:SetFacing(FACING_DOWN)  -- THERE IS NO SetFacing in the game????

				inst.AnimState:SetBank(pref or "")
				inst.AnimState:SetBuild(pref or "")
				inst.AnimState:PlayAnimation("idle", true)

				-- inst.AnimState:Hide("mouseover")
				-- inst.AnimState:SetLightOverride(1)


				print("[MOVINGBOX]GetCurrentBankName  (pref)"..(pref or "") )
			end	
	
			tmp_inst:Remove()
		end
	end
end)

 

Edited by JChanger
text format modify
Link to comment
Share on other sites

I have tested this mod a bit and the game didn't crash for me, I suspect this is a mod compatibility issue, are you sure this is the only server mod enabled?

Also one thing I've noticed is that if you unpack the box while standing very close to it, the structure inside does not spawn at where you'd expect(using geometric placement mod)

Edit: also you're using the function "AddRecipe" and passing in positional parameters to AddAction function, which are both deprecated. Use AddRecipe2 instead of AddRecipe, and for AddAction you should pass in the parameters as a table (see modutil.lua and  actions.lua for the proper format).

Edited by _zwb
Link to comment
Share on other sites

1 hour ago, _zwb said:

I have tested this mod a bit and the game didn't crash for me, I suspect this is a mod compatibility issue, are you sure this is the only server mod enabled?

Also one thing I've noticed is that if you unpack the box while standing very close to it, the structure inside does not spawn at where you'd expect(using geometric placement mod)

Edit: also you're using the function "AddRecipe" and passing in positional parameters to AddAction function, which are both deprecated. Use AddRecipe2 instead of AddRecipe, and for AddAction you should pass in the parameters as a table (see modutil.lua and  actions.lua for the proper format).

Many thanks for the works on testing my mod!

  1.  if it wont crash, that'd be the best. The only one thing different on the lastest version is i delete the code:
if tmp_inst.isdoor or string.find(tmp_inst.name, "gate")~=nil or string.find(tmp_inst.name, "wall")~=nil then
  
  ↓↓↓(delete the "string" part
  
if tmp_inst.isdoor then

After that, the crash posibility decreases on some degree. But this crash actually takes me a day long. And the wired thing is nothing on the log file.

     2.  For using the packed box, if you use "dropped way(left click on the ground)", it is correct cause the box dropped under the cursor not by geometric placement; And if using "plant way(right click)", i didnt see any offset by standing closely and unpacking, and it will be ok  as long as the structrue is spawned at the position of box, cause whether the box can be unpacked uses extra check. In my testing, the green range prompted by Geo Place is the same as the extra check. Thanks again for mentioning that.

    3. That is true. This mod was originally created in 2017 by original auther, i just update and modify it. Seeing good compatibility of the old function, i may update it in sometime.

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
 Share

×
  • Create New...