Jump to content

[Error] First timer item code help!


Recommended Posts

 

scripts/worldgen_main.lua(600,1) Generation complete
WorldSim::SimThread::Main() complete
scripts/gamelogic.lua(148,1) Unload FE
scripts/gamelogic.lua(150,1) Unload FE done
scripts/dlcsupport.lua(24,1) Load scripts/DLC001_prefab_files
scripts/mods.lua(269,1) Mod: workshop-170030148 (Display Food Values) Registering prefabs
scripts/mods.lua(292,1) Mod: workshop-170030148 (Display Food Values)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: workshop-180843799 (Always On Status) Registering prefabs
scripts/mods.lua(292,1) Mod: workshop-180843799 (Always On Status)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: workshop-171012126 (WolfgangClassic) Registering prefabs
scripts/mods.lua(275,1) Mod: workshop-171012126 (WolfgangClassic)  Registering prefab file: prefabs/wolfgang
scripts/mods.lua(279,1) Mod: workshop-171012126 (WolfgangClassic)    wolfgang
scripts/mods.lua(292,1) Mod: workshop-171012126 (WolfgangClassic)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: Wei (Wendeline) Registering prefabs
scripts/mods.lua(275,1) Mod: Wei (Wendeline)  Registering prefab file: prefabs/wei
scripts/mods.lua(279,1) Mod: Wei (Wendeline)    wei
scripts/mods.lua(275,1) Mod: Wei (Wendeline)  Registering prefab file: prefabs/panfluteWYN
scripts/mods.lua(279,1) Mod: Wei (Wendeline)    panfluteWYN
scripts/mods.lua(292,1) Mod: Wei (Wendeline)  Registering default mod prefab
scripts/gamelogic.lua(164,1) LOAD BE
..\source\animlib\animmanager.cpp(401) :: Tried to add build [pan_flute] from file [anim/pan_flute.zip] but we've already added a build with that name!
 
 
 
The world generated successfully. I am assuming the red part is the important part.
 
I must have added the item wrong, it is an infinite use panflute.
 
 
 
It is my first time adding an character item.
 
I think I got it mostly right, but you know coding, it can be 99% right, but oh, that 1%.....
 
 
Thanks in advance,
Monty

 

 

scripts/worldgen_main.lua(600,1) Generation complete
WorldSim::SimThread::Main() complete
scripts/gamelogic.lua(148,1) Unload FE
scripts/gamelogic.lua(150,1) Unload FE done
scripts/dlcsupport.lua(24,1) Load scripts/DLC001_prefab_files
scripts/mods.lua(269,1) Mod: workshop-170030148 (Display Food Values) Registering prefabs
scripts/mods.lua(292,1) Mod: workshop-170030148 (Display Food Values)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: workshop-180843799 (Always On Status) Registering prefabs
scripts/mods.lua(292,1) Mod: workshop-180843799 (Always On Status)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: workshop-171012126 (WolfgangClassic) Registering prefabs
scripts/mods.lua(275,1) Mod: workshop-171012126 (WolfgangClassic)  Registering prefab file: prefabs/wolfgang
scripts/mods.lua(279,1) Mod: workshop-171012126 (WolfgangClassic)    wolfgang
scripts/mods.lua(292,1) Mod: workshop-171012126 (WolfgangClassic)  Registering default mod prefab
scripts/mods.lua(269,1) Mod: Wei (Wendeline) Registering prefabs
scripts/mods.lua(275,1) Mod: Wei (Wendeline)  Registering prefab file: prefabs/wei
scripts/mods.lua(279,1) Mod: Wei (Wendeline)    wei
scripts/mods.lua(275,1) Mod: Wei (Wendeline)  Registering prefab file: prefabs/panfluteWYN
scripts/mods.lua(279,1) Mod: Wei (Wendeline)    panfluteWYN
scripts/mods.lua(292,1) Mod: Wei (Wendeline)  Registering default mod prefab
scripts/gamelogic.lua(164,1) LOAD BE
..\source\animlib\animmanager.cpp(401) :: Tried to add build [pan_flute] from file [anim/pan_flute.zip] but we've already added a build with that name!
 
 
 
The world generated successfully. I am assuming the red part is the important part.
 
I must have added the item wrong, it is an infinite use panflute.
 
 
 
It is my first time adding an character item.
 
I think I got it mostly right, but you know coding, it can be 99% right, but oh, that 1%.....
 
 
Thanks in advance,
Monty
 
 
EDIT: see post #5 for the current problem
Link to comment
Share on other sites

If your anim/pan_flute is the same as in the base game, delete yours. Else, rename it (along with the build, using matts build renamer for example).

If I delete it, will it not have an animation anymore? 

 

 

I downloaded the build renamer, am I just renaming the build.bin file here or something else?

 

EDIT: It is the same animation as in the base game. If I delete it, will it use the base game animation or will it just lack an animation?

Link to comment
Share on other sites

If I delete it, will it not have an animation anymore? 

 

 

I downloaded the build renamer, am I just renaming the build.bin file here or something else?

 

EDIT: It is the same animation as in the base game. If I delete it, will it use the base game animation or will it just lack an animation?

 

Any animation you put in your mod gets added to the base game animations on load. The crash happens because you try to add what is already there. If you remove the anim from your mod, it should work.

Link to comment
Share on other sites

I renamed the build, which fixed the previous issue, However the item still does not show up.

scripts/mainfunctions.lua(121,1) Can't find prefab panflutewyn	HttpClientWriteCallback (0x0046D5BF, 1, 16, 0x0701FBA4)HttpClientWriteCallback READ 16 (16 total)QueryServerComplete no callback../mods/Wei/images/saveslot_portraits/wei.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/Wei/images/selectscreen_portraits/wei.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/Wei/images/selectscreen_portraits/wei_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.scripts/components/resurrector.lua(42,1) Resurrector:OnSave	100053 - resurrectionstone	used:nil	active:nil	scripts/saveindex.lua(420,1) DeregisterResurrector	scripts/saveindex.lua(436,1) DeregisterResurrector	scripts/components/resurrector.lua(42,1) Resurrector:OnSave	100054 - resurrectionstone	used:nil	active:nil	scripts/saveindex.lua(420,1) DeregisterResurrector	scripts/saveindex.lua(436,1) DeregisterResurrector	scripts/mods.lua(304,1) unloading prefabs for mod MOD_workshop-170030148	scripts/mods.lua(304,1) unloading prefabs for mod MOD_workshop-180843799	scripts/mods.lua(304,1) unloading prefabs for mod MOD_workshop-171012126	scripts/mods.lua(304,1) unloading prefabs for mod MOD_Wei	scripts/mainfunctions.lua(582,1) Saved	survival_5	Collecting garbage...lua_gc took 0.05 seconds

I just double checked, I declared panfluteWYN.lua as an asset in my modmain, so I am kinda confused.

Link to comment
Share on other sites

GLOBAL.STRINGS.NAMES.panfluteWYN = "Wyn's Panflute"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.panfluteWYN = "Plays Music. FOREVER."PrefabFiles = {	"wei",	"panfluteWYN"}Assets = {    Asset( "IMAGE", "images/saveslot_portraits/wei.tex" ),    Asset( "ATLAS", "images/saveslot_portraits/wei.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/wei.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/wei.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/wei_silho.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/wei_silho.xml" ),    Asset( "IMAGE", "bigportraits/wei.tex" ),    Asset( "ATLAS", "bigportraits/wei.xml" ),	Asset("IMAGE", "images/wei.tex"),	Asset("ATLAS", "images/wei.xml"),		Asset("ANIM", "anim/panfluteWYN.zip"),	Asset("ATLAS", "images/inventoryimages/panfluteWYN.xml")}AddMinimapAtlas("images/wei.xml")local STRINGS = GLOBAL.STRINGSlocal require = GLOBAL.requireGLOBAL.STRINGS.CHARACTERS.WEI = require "speech_wei"local function ModMaxwellIntro(inst)    if GLOBAL.GetPlayer().prefab == "wei" then        inst.components.maxwelltalker.speeches.SANDBOX_1 =        {            appearsound = "dontstarve/maxwell/disappear",            voice = "dontstarve/maxwell/talk_LP",            appearanim = "appear",            idleanim= "idle",            dialogpreanim = "dialog_pre",            dialoganim="dial_loop",            dialogpostanim = "dialog_pst",            disappearanim = "disappear",            disableplayer = true,            skippable = true,            {                string = "Are you lost Little Girl? \n You should pay me a visit",                wait = 3,                anim = nil,                sound = nil,            },            {                string = "Let's see you survive the night first!",                wait = 3,                anim = nil,                sound = nil,            },        }    endend  AddPrefabPostInit("maxwellintro", ModMaxwellIntro)local function MakeGood(inst)     if inst and inst.components then            if not inst.components.sanityaura then inst:AddComponent("sanityaura") end            inst.components.sanityaura.aura = GLOBAL.TUNING.SANITYAURA_TINY     endend  AddPrefabPostInit("flower",  MakeGood)local function MakeVeryGood(inst)     if inst and inst.components then            if not inst.components.sanityaura then inst:AddComponent("sanityaura") end            inst.components.sanityaura.aura = GLOBAL.TUNING.SANITYAURA_MED     endend  AddPrefabPostInit( "butterfly", MakeVeryGood)local function AoSFix(inst) inst:AddComponent("switch") end for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "Always On Status" then AddPrefabPostInit("wei", AoSFix) end end -- strings! Any "wod" below would have to be replaced by the prefab name of your character.-- The character select screen lines-- note: these are lower-case character nameGLOBAL.STRINGS.CHARACTER_TITLES.wei = "The Little One"GLOBAL.STRINGS.CHARACTER_NAMES.wei = "Wei"  -- Note! This line is especially important as some parts of the game require                                            -- the character to have a valid name.GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.wei = "*Easily frightened\n*Loves Flowers\n* Doesn't eat much \n* Quick hands, Nimble Feet"GLOBAL.STRINGS.CHARACTER_QUOTES.wei = "\"Smaller, Faster, Lighter\""-- Let the game know wod is a male, for proper pronouns during the end-game sequence.-- Possible genders here are MALE, FEMALE, or ROBOTtable.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "wei")AddModCharacter("wei")

This is my modmain.lua

Link to comment
Share on other sites

local assets={	Asset("ANIM", "anim/panfluteWYN.zip"),	Asset("ATLAS", "images/inventoryimages/panfluteWYN.xml")}local function onfinished(inst)    inst:Remove()endlocal function HearPanFlute(inst, musician, instrument)	if inst.components.sleeper then	    inst.components.sleeper:AddSleepiness(10, TUNING.PANFLUTE_SLEEPTIME, inst)	endendlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()		inst:AddTag("flute")        inst.AnimState:SetBank("pan_flute")    inst.AnimState:SetBuild("pan_flute")    inst.AnimState:PlayAnimation("idle")    MakeInventoryPhysics(inst)        inst:AddComponent("inspectable")    inst:AddComponent("instrument")    inst.components.instrument.range = TUNING.PANFLUTE_SLEEPRANGE    inst.components.instrument:SetOnHeardFn(HearPanFlute)        inst:AddComponent("tool")    inst.components.tool:SetAction(ACTIONS.PLAY)        inst:AddComponent("infiniteuses")    	inst:AddTag("irreplaceable")    inst:AddComponent("characterspecific")    inst.components.characterspecific:SetOwner("wei")        inst:AddComponent("inventoryitem")     inst.components.inventoryitem.atlasname = "images/inventoryimages/panfluteWYN.xml"    return instendreturn Prefab( "common/inventory/panfluteWYN", fn, assets) 

This is my panfluteWYN.lua

 

Link to comment
Share on other sites

local MakePlayerCharacter = require "prefabs/player_common"local assets = {        Asset( "ANIM", "anim/player_basic.zip" ),        Asset( "ANIM", "anim/player_idles_shiver.zip" ),        Asset( "ANIM", "anim/player_actions.zip" ),        Asset( "ANIM", "anim/player_actions_axe.zip" ),        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),        Asset( "ANIM", "anim/player_actions_shovel.zip" ),        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),        Asset( "ANIM", "anim/player_actions_eat.zip" ),        Asset( "ANIM", "anim/player_actions_item.zip" ),        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),        Asset( "ANIM", "anim/player_actions_fishing.zip" ),        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),        Asset( "ANIM", "anim/player_bush_hat.zip" ),        Asset( "ANIM", "anim/player_attacks.zip" ),        Asset( "ANIM", "anim/player_idles.zip" ),        Asset( "ANIM", "anim/player_rebirth.zip" ),        Asset( "ANIM", "anim/player_jump.zip" ),        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),        Asset( "ANIM", "anim/player_teleport.zip" ),        Asset( "ANIM", "anim/wilson_fx.zip" ),        Asset( "ANIM", "anim/player_one_man_band.zip" ),        Asset( "ANIM", "anim/shadow_hands.zip" ),        Asset( "SOUND", "sound/sfx.fsb" ),        Asset( "SOUND", "sound/wilson.fsb" ),        Asset( "ANIM", "anim/beard.zip" ),		-- Don't forget to include your character's custom assets!        Asset( "ANIM", "anim/wei.zip" ),}local prefabs = {}local start_inv = {	"bushhat",	"butterfly",	"butterfly",	"butterfly",	"butterfly",	"butterfly",	"panfluteWYN",	}local fn = function(inst)		-- choose which sounds this character will play	inst.soundsname = "winnie"	-- a minimap icon must be specified    inst.entity:AddMiniMapEntity()    inst.MiniMapEntity:SetIcon("wei.tex")	-- todo: Add an example special power here.	inst.components.sanity:SetMax(TUNING.WILSON_SANITY*.3)	inst.components.health.maxhealth = 45	inst.components.hunger:SetMax(TUNING.WILSON_HUNGER * .266666666666666666666666666666666666666666666666666666666666666666666 )	inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.35)	inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.35)	inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE*.25)    inst.components.sanity.night_drain_mult = 1.20	inst.components.sanity.neg_aura_mult = 1.35	inst.components.builder.ingredientmod = TUNING.GREENAMULET_INGREDIENTMOD	local handle = inst.sg.sg.actionhandlers[ACTIONS.PICK]handle.deststate = function(inst) return "doshortaction" end	inst.components.locomotor:SetTriggersCreep(false)	inst.components.combat.damagemultiplier = .75        			endSTRINGS.CHARACTERS.WEI= require "speech_wei"return MakePlayerCharacter("wei", prefabs, assets, fn, start_inv)

Thats my character.lua if that somehow makes a difference.

Link to comment
Share on other sites

Hey Monty, I took a look at your mod. It seems to dislike the capitals "WYN" in your file names. I changed the file names and references to lowercase panflutewyn and they are working.

Wow.

 

That is almost too pathetically simple.

 

 

It was my first thought, but I then thought "no way, that would be too simple."

 

 

 

Just Wow.

 

 

Thanks for taking a look at it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...