[15.37] Crash on: "PrototypeLoader::loadPrototypes"

Things that has been reported already before.
TheSeriusYoutuber
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Sep 13, 2017 12:34 pm
Contact:

[15.37] Crash on: "PrototypeLoader::loadPrototypes"

Post by TheSeriusYoutuber »

Now this is complicated. My mod(RobotDeployer) seems to cause a factorio crash.I dont know how to fix it.Seems like something to do with visual studio.
https://www.dropbox.com/s/smyx5te96f7ph37/mods.zip?dl=0
Attachments
factorio-current.log
Log
(19.1 KiB) Downloaded 100 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14891
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [15.37] Crash on: "PrototypeLoader::loadPrototypes"

Post by Rseding91 »

Thanks for the report. The crash is fixed in 0.16 already. What's wrong is a few things:
  • You've included your settings in the data stage - they don't go there. Just delete "require("settings")" from data.lua
  • Your "settingspanel.lua" file is completely broken (see blow)
This - is unreadable

Code: Select all

function GetSettingsValue(SettingsValue)
if (SettingsValue.value==nil) then local output=false else local output=true end
if (output==true) then local returnstring=settings.startup[SettingsValue].value end
return returnstring
end
You're using locals inside if/else statements which means they only exist for those branches. As soon as the if/else is left that value is now nil - gone. Because of that every call to that function will always return nil - which isn't valid for anything asking for a setting. You should use this:

Code: Select all

function GetSettingsValue(setting, defaultValue)
	if (settings.startup[setting] == nil) then
		return defaultValue;
	end
	
	return settings.startup[setting].value
end
Here it takes a setting name to look up and a default value if that setting doesn't exist. If it doesn't exist it returns the default value and it's all good.
If you want to get ahold of me I'm almost always on Discord.
TheSeriusYoutuber
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Sep 13, 2017 12:34 pm
Contact:

Re: [15.37] Crash on: "PrototypeLoader::loadPrototypes"

Post by TheSeriusYoutuber »

Thank you so much, you can lock this now! :D
TheSeriusYoutuber
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Sep 13, 2017 12:34 pm
Contact:

Re: [15.37] Crash on: "PrototypeLoader::loadPrototypes"

Post by TheSeriusYoutuber »

Thank you so much, you can lock this now! :D
Post Reply

Return to “Duplicates”