Jump to content

[HELP] Crash on making a new placer


Recommended Posts

To reiterate, the prefab is a modified copy of telebase.lua with modified animations

 

The code.

require "prefabutil" --added this hoping it would help, it did notlocal assets ={	Asset("ANIM", "anim/supertelebase.zip"),	Asset("ATLAS", "images/inventoryimages/supertelebase.xml"),}--other stuff here for the itemreturn Prefab( "common/inventory/supertelebase", commonfn, assets, prefabs),		MakePlacer( "common/supertelebase_placer", "supertelebase_pink", "supertelebase", "idle" )	   --MakePlacer( "common/supertelebase_placer", "staff_purple_base_ground", "staff_purple_base_ground", "idle" ) 

oddly the origional line works even though i changed the name of the placer, but fails when i change the build and bank. The build for supertelebase.zip is supertelebase and the bank is either supertelebase_pink or supertelebase_blue.

20siqgh.png

 

 

Edit: i tryed readding the Asset("ANIM", "anim/staff_purple_base_ground.zip"), and using 

MakePlacer("common/supertelebase_placer", "staff_purple_base_ground", "staff_purple_base_ground", "idle")andMakePlacer("common/telebase_placer", "staff_purple_base_ground", "staff_purple_base_ground", "idle")

and they also give me this error. 99% sure it was working like this before i tried to mess with it -.-

plz help! i cant decypher what value ? is... and i dont really know how _replica components work either.

Edited by Kam297
Link to comment
Share on other sites

@Kam297, Based on the error stack trace, it looks like the problem is more related to the way the Recipe is being added than the build/bank change. As far as I can tell, it would appear that somehow it's getting into the player_classified's recipe table, but not into the bufferedbuilds table. How that could occur... I'm not sure, but seeing the part of your code that handles the recipe might be helpful. 

Link to comment
Share on other sites

http://steamcommunity.com/sharedfiles/filedetails/?id=359606820

 

i was hoping that the "TUNING" values were derived from the server host and couldnt be added/modified but apparently this is untrue...

im not really sure how to progress from here... i just wanted the host to be able to change certain mcm values and the clients not to be. 

the world prefab post init was because i was hoping the tuning values would be derived from the host thus with "host" set off you would crash without it... i was also hoping with it set on and trying to overwrite the tuning values you would crash but using this code any client that joins, other then thier hud, their screen is completely black...

local Host = GetModConfigData("Host")--local CustomTeleporting = GetModConfigData("Custom Teleporting")local TeleConfigKey = GetModConfigData("TeleToggle on ALT+")--local enableTeleToggle1 = (GetModConfigData("Custom Teleport 1")=="on")--local enableTeleToggle2 = (GetModConfigData("Custom Teleport 2")=="on")--local enableTeleToggle3 = (GetModConfigData("Custom Teleport 3")=="on")--local enableTeleToggle4 = (GetModConfigData("Custom Teleport 4")=="on")--local enableTeleToggle5 = (GetModConfigData("Custom Teleport 5")=="on")--local supertelebasecooldown = GetModConfigData("TeleBase Cooldown")--local RecipeList = GetModConfigData("Recipe")--local FiniteStaff = (GetModConfigData("Finite Staff")==true)--local staffuses = GetModConfigData("Staff uses")--local HideNormies = GetModConfigData("Hide normal recipies")--local TeleNumColor = GetModConfigData("Teleport Number Colours")TUNING.SUPERTELESTAFF = {}if Host thenTUNING.SUPERTELESTAFF.CUSTOMTELEPORTING = GetModConfigData("Custom Teleporting")--local TeleConfigKey = GetModConfigData("TeleToggle on ALT+")TUNING.SUPERTELESTAFF.TELETOGGLE1 = (GetModConfigData("Custom Teleport 1")==true)TUNING.SUPERTELESTAFF.TELETOGGLE2 = (GetModConfigData("Custom Teleport 2")==true)TUNING.SUPERTELESTAFF.TELETOGGLE3 = (GetModConfigData("Custom Teleport 3")==true)TUNING.SUPERTELESTAFF.TELETOGGLE4 = (GetModConfigData("Custom Teleport 4")==true)TUNING.SUPERTELESTAFF.TELETOGGLE5 = (GetModConfigData("Custom Teleport 5")==true)TUNING.SUPERTELESTAFF.SUPERTELEBASECOOLDOWN = GetModConfigData("TeleBase Cooldown")*60TUNING.SUPERTELESTAFF.RECIPELIST = GetModConfigData("Recipe")TUNING.SUPERTELESTAFF.FINITESTAFF = (GetModConfigData("Finite Staff")==true)TUNING.SUPERTELESTAFF.SUPERTELESTAFF_USES = GetModConfigData("Staff uses")TUNING.SUPERTELESTAFF.HIDENORMIES = GetModConfigData("Hide normal recipies"==true)endTUNING.SUPERTELESTAFF.COLORS = GetModConfigData("Teleport Number Colours")AddPrefabPostInit("world", function(wrld)    wrld:ListenForEvent("playeractivated", function(wlrd, player)        if player == GLOBAL.ThePlayer then            --player:AddComponent("myclientsidecomponentwhichdoesntequireanyserversidestuff")local function BindTeleMethod(tele, staff)	local player = GetPlayer()	local pt = GLOBAL.GetPlayer():GetPosition()	local staff = TheSim:FindEntities(pt.x,pt.y,pt.z, 5, {"supertelestaff"})    --local weapon = TheSim:FindFirstEntityWithTag("supertelestaff")	--local weapon = player.components.inventory:IsItemEquipped("SuperTeleStaff")	--local weapon = player.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)	for k,v in pairs(staff) do		if v.prefab == "supertelestaff" and v.components.inventoryitem.owner == player then			if tele == 0 then				v.components.teleportmethod.method = 0				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD0"))			elseif tele == 1 then				v.components.teleportmethod.method = 1				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD1"))			elseif tele == 2 then				v.components.teleportmethod.method = 2				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD2"))			elseif tele == 3 then				v.components.teleportmethod.method = 3				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD3"))			elseif tele == 4 then				v.components.teleportmethod.method = 4				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD4"))			elseif tele == 5 then				v.components.teleportmethod.method = 5				player.components.talker:Say(GetString(player.prefab, "CUSTOMTELEMETHOD5"))			end		elseif not staff then			player.components.talker:Say(GetString(player.prefab, "NOSUPERTELESTAFF"))		end	endendcustomteleportmeth = 0local function TeleToggleMethod(method)	    if method == 1 or (not method and customteleportmeth == 0) then		if TUNING.SUPERTELESTAFF.TELETOGGLE1 then			customteleportmeth = 1			BindTeleMethod(1)		else			TeleToggleMethod(2)		end    elseif method == 2 or (not method and customteleportmeth == 1) then		if TUNING.SUPERTELESTAFF.TELETOGGLE2 then			customteleportmeth = 2			BindTeleMethod(2)		else			TeleToggleMethod(3)		end    elseif method == 3 or (not method and customteleportmeth == 2) then		if TUNING.SUPERTELESTAFF.TELETOGGLE3 then			customteleportmeth = 3			BindTeleMethod(3)		else			TeleToggleMethod(4)		end    elseif method == 4 or (not method and customteleportmeth == 3) then		if TUNING.SUPERTELESTAFF.TELETOGGLE4 then			customteleportmeth = 4			BindTeleMethod(4)		else			TeleToggleMethod(5)		end    elseif method == 5 or (not method and customteleportmeth == 4) then		if TUNING.SUPERTELESTAFF.TELETOGGLE5 then			customteleportmeth = 5			BindTeleMethod(5)		else			TeleToggleMethod(0)		end	elseif method == 0 or (not method and customteleportmeth == 5) then        customteleportmeth = 0		BindTeleMethod(0)	endendif TUNING.SUPERTELESTAFF.CUSTOMTELEPORTING and not (TeleConfigKey == 0) then 	--print ("Super Teleport Staff, Mooched from: BetterWalls : Alt+"..string.char(TeleConfigKey-delta))	local delta = KEY_A - string.byte("A")	TheInput:AddKeyDownHandler(TeleConfigKey --[[GLOBAL.KEY_T]], function()	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) and TheInput:IsKeyDown(GLOBAL.KEY_ALT) then 		TeleToggleMethod(nil)	endend)endif TUNING.SUPERTELESTAFF.RECIPELIST == "uber" then	local supertelestaffrec = GLOBAL.Recipe("supertelestaff",{Ingredient("nightmarefuel", 30), Ingredient("livinglog", 20), Ingredient("purplegem", 5)}, RECIPETABS.MAGIC, --[[TECH.LOST]] TECH.MAGIC_THREE )	local supertelebaserec = GLOBAL.Recipe("supertelebase", {Ingredient("nightmarefuel", 10), Ingredient("livinglog", 16), Ingredient("purplegem", 2)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE, "supertelebase_placer")	supertelestaffrec.atlas = "images/inventoryimages/supertelestaff.xml"	supertelebaserec.atlas = "images/inventoryimages/supertelebase.xml"		local tele1rec = GLOBAL.Recipe("tele1", {Ingredient("nightmarefuel", 30), Ingredient("purplegem", 5), Ingredient("livinglog", 20)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele2rec = GLOBAL.Recipe("tele2", {Ingredient("nightmarefuel", 20), Ingredient("redgem", 5), Ingredient("livinglog", 10)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele3rec = GLOBAL.Recipe("tele3", {Ingredient("nightmarefuel", 20), Ingredient("bluegem", 5), Ingredient("livinglog", 10)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele4rec = GLOBAL.Recipe("tele4", {Ingredient("nightmarefuel", 20), Ingredient("orangegem", 5), Ingredient("livinglog", 20)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele5rec = GLOBAL.Recipe("tele5", {Ingredient("nightmarefuel", 50), Ingredient("greengem", 5), Ingredient("livinglog", 20)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	if TUNING.SUPERTELESTAFF.COLORS == "pink" then		tele1rec.atlas = "images/inventoryimages/tele1pink.xml"		tele2rec.atlas = "images/inventoryimages/tele2pink.xml"		tele3rec.atlas = "images/inventoryimages/tele3pink.xml"		tele4rec.atlas = "images/inventoryimages/tele4pink.xml"		tele5rec.atlas = "images/inventoryimages/tele5pink.xml"	elseif TUNING.SUPERTELESTAFF.COLORS == "blue" then		tele1rec.atlas = "images/inventoryimages/tele1blue.xml"		tele2rec.atlas = "images/inventoryimages/tele2blue.xml"		tele3rec.atlas = "images/inventoryimages/tele3blue.xml"		tele4rec.atlas = "images/inventoryimages/tele4blue.xml"		tele5rec.atlas = "images/inventoryimages/tele5blue.xml"	endelseif TUNING.SUPERTELESTAFF.RECIPELIST == "hard" then	local supertelestaffrec = GLOBAL.Recipe("supertelestaff",{Ingredient("nightmarefuel", 15), Ingredient("livinglog", 10), Ingredient("purplegem", 3)}, RECIPETABS.MAGIC, --[[TECH.LOST]] TECH.MAGIC_THREE )	local supertelebaserec = GLOBAL.Recipe("supertelebase", {Ingredient("nightmarefuel", 5), Ingredient("livinglog", 6), Ingredient("purplegem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE, "supertelebase_placer")	supertelestaffrec.atlas = "images/inventoryimages/supertelestaff.xml"	supertelebaserec.atlas = "images/inventoryimages/supertelebase.xml"		local tele1rec = GLOBAL.Recipe("tele1", {Ingredient("nightmarefuel", 15), Ingredient("purplegem", 3), Ingredient("livinglog", 10)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele2rec = GLOBAL.Recipe("tele2", {Ingredient("nightmarefuel", 10), Ingredient("redgem", 3), Ingredient("livinglog", 5)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele3rec = GLOBAL.Recipe("tele3", {Ingredient("nightmarefuel", 10), Ingredient("bluegem", 3), Ingredient("livinglog", 5)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele4rec = GLOBAL.Recipe("tele4", {Ingredient("nightmarefuel", 10), Ingredient("orangegem", 3), Ingredient("livinglog", 10)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele5rec = GLOBAL.Recipe("tele5", {Ingredient("nightmarefuel", 25), Ingredient("greengem", 3), Ingredient("livinglog", 10)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	if TUNING.SUPERTELESTAFF.COLORS == "pink" then		tele1rec.atlas = "images/inventoryimages/tele1pink.xml"		tele2rec.atlas = "images/inventoryimages/tele2pink.xml"		tele3rec.atlas = "images/inventoryimages/tele3pink.xml"		tele4rec.atlas = "images/inventoryimages/tele4pink.xml"		tele5rec.atlas = "images/inventoryimages/tele5pink.xml"	elseif TUNING.SUPERTELESTAFF.COLORS == "blue" then		tele1rec.atlas = "images/inventoryimages/tele1blue.xml"		tele2rec.atlas = "images/inventoryimages/tele2blue.xml"		tele3rec.atlas = "images/inventoryimages/tele3blue.xml"		tele4rec.atlas = "images/inventoryimages/tele4blue.xml"		tele5rec.atlas = "images/inventoryimages/tele5blue.xml"	endelseif TUNING.SUPERTELESTAFF.RECIPELIST == "easy" then	local supertelestaffrec = GLOBAL.Recipe("supertelestaff",{Ingredient("nightmarefuel", 4), Ingredient("livinglog", 2), Ingredient("purplegem", 2)}, RECIPETABS.MAGIC, --[[TECH.LOST]] TECH.MAGIC_THREE )	local supertelebaserec = GLOBAL.Recipe("supertelebase", {Ingredient("nightmarefuel", 4), Ingredient("livinglog", 4), Ingredient("goldnugget", 8)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE, "supertelebase_placer")	supertelestaffrec.atlas = "images/inventoryimages/supertelestaff.xml"	supertelebaserec.atlas = "images/inventoryimages/supertelebase.xml"	local tele1rec = GLOBAL.Recipe("tele1", {Ingredient("purplegem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele2rec = GLOBAL.Recipe("tele2", {Ingredient("redgem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele3rec = GLOBAL.Recipe("tele3", {Ingredient("bluegem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele4rec = GLOBAL.Recipe("tele4", {Ingredient("orangegem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	local tele5rec = GLOBAL.Recipe("tele5", {Ingredient("greengem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)	if TUNING.SUPERTELESTAFF.COLORS == "pink" then		tele1rec.atlas = "images/inventoryimages/tele1pink.xml"		tele2rec.atlas = "images/inventoryimages/tele2pink.xml"		tele3rec.atlas = "images/inventoryimages/tele3pink.xml"		tele4rec.atlas = "images/inventoryimages/tele4pink.xml"		tele5rec.atlas = "images/inventoryimages/tele5pink.xml"	elseif TUNING.SUPERTELESTAFF.COLORS == "blue" then		tele1rec.atlas = "images/inventoryimages/tele1blue.xml"		tele2rec.atlas = "images/inventoryimages/tele2blue.xml"		tele3rec.atlas = "images/inventoryimages/tele3blue.xml"		tele4rec.atlas = "images/inventoryimages/tele4blue.xml"		tele5rec.atlas = "images/inventoryimages/tele5blue.xml"	endendif TUNING.SUPERTELESTAFF.HIDENORMIES then	require("recipes")	--[[local telestaffrec = GLOBAL.]]Recipe("telestaff",{Ingredient("goldnugget", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, nil, nil, true, 0)	--[[local telebaserec = GLOBAL.]]Recipe("telebase", {Ingredient("goldnugget", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_TWO, "telebase_placer", nil, true, 0)end        end    end)end)
Link to comment
Share on other sites

@Kam297, No, TUNING is local. I'm also not sure how mod configuration works between the host and clients, either, actually... I should probably do a test of that, since looking around in the code for that doesn't seem to help.

 

For now, I'd recommend first trying to get it to work without mod config options turning versions of it on/off. Recipes have to match 1-to-1 on clients and host or you'll get black screen bugs like you're seeing. 

 

You should definitely not be setting whether the mod is on a host in the mod config. Instead, you can use TheNet:GetIsServer().

Link to comment
Share on other sites

@Kam297, No, TUNING is local. I'm also not sure how mod configuration works between the host and clients, either, actually... I should probably do a test of that, since looking around in the code for that doesn't seem to help.

 

no no Im using tuning values because they are reference in prefabs. :) modmain is filled with post inits on the DS/RoG version atm.

This is exactly my delema tho! :( im stumped. as is it seems i either have to decide on my values myself or leave it as is and let clients decide.

 

For now, I'd recommend first trying to get it to work without mod config options turning versions of it on/off. Recipes have to match 1-to-1 on clients and host or you'll get black screen bugs like you're seeing. 

<3 yeah i was hoping that the tuning values being different would cause a crash preventing this scenario forcing the clients to set the mcm value of host to off, avoiding the conflict... but then again i dont think tuning values get pulled from the host...

 

You should definitely not be setting whether the mod is on a host in the mod config. Instead, you can use TheNet:GetIsServer().

I was just testing on two computers at home so it was a temporary thing. i was looking for that tho thank you! :)

Link to comment
Share on other sites

i dont think tuning values get pulled from the host
That's what I'm saying when I say TUNING is local. It doesn't get networked directly at all.

 

For everything that the game normally uses TUNING for, however, it only matters what the host's value is. But if a mod were to check TUNING, it would get whatever it's set to locally, so there could be differences between the host and client. 

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