rons0n Posted January 29, 2015 Share Posted January 29, 2015 (edited) Does editing your post bump you up to the front page?I hope so. Anyway, before i edited this post i posted on how i got stumped on making myself a custom abigail, and pretty sure i made it overwhelming for people who looked at my post. I took a small break and went for a different approach on how to make my own abigail and its now progressing! Sorta... I encountered this error! Also is the provided file I still want to mention I dont know what I'm doing but i think im progressing?Using Malcanth's Map Icon sample btw sakuraghost.zip Edited February 1, 2015 by rons0n Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/ Share on other sites More sharing options...
Silhh Posted February 1, 2015 Share Posted February 1, 2015 I'd like to know as well! *~* Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608678 Share on other sites More sharing options...
Ryuushu Posted February 1, 2015 Share Posted February 1, 2015 (edited) @rons0n @Silhh Just duplicate abigail.lua, abigail_flower.lua, and change the anims/owner/set leader to reference your character. Hmm, I'll try to do it with Wolfgang. Give me a minute. Edited February 2, 2015 by Ryuushu Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608686 Share on other sites More sharing options...
Ryuushu Posted February 1, 2015 Share Posted February 1, 2015 @rons0nIt's easier said than done <<; Anyways, here you go. Look for wolfgang_ghost and wolfgang inside the prefabs and in modmain to know how it's made.You'll also need to have a OnLoad function in your character to spawn back your ghost after you logout/log back in. Look inside wendy to see how it's made. As far as I know modifying OnLoad inside a AddPrefabPost Init isn't possible due to the prefab loading first before applying added functions, that's why I didn't add it.Feel free to ask any questions that might surge.WolfgangGhost.zip Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608697 Share on other sites More sharing options...
rons0n Posted February 2, 2015 Author Share Posted February 2, 2015 (edited) @rons0nIt's easier said than done <<; Anyways, here you go. Look for wolfgang_ghost and wolfgang inside the prefabs and in modmain to know how it's made.You'll also need to have a OnLoad function in your character to spawn back your ghost after you logout/log back in. Look inside wendy to see how it's made. As far as I know modifying OnLoad inside a AddPrefabPost Init isn't possible due to the prefab loading first before applying added functions, that's why I didn't add it.Feel free to ask any questions that might surge. @RyuushuAh, I see. Looks like i've over complicated things as usual. Tends to happen when i just go off my head and not by examples .Yours is much easier to look at! I'll be testing this out, much thanks! On a semi-related note, if i extracted the anim files so i edit the sprites and recompile them nothing will go wrong right? Edited February 2, 2015 by rons0n Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608705 Share on other sites More sharing options...
Ryuushu Posted February 2, 2015 Share Posted February 2, 2015 @rons0n Hmm, last time I decompiled a ghost its hat fell down in the idle animation, so... Instead decompiling/compiling again, make your ghost animations based on the ESC Template ghost, they'll work perfectly fine. Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608712 Share on other sites More sharing options...
rons0n Posted February 2, 2015 Author Share Posted February 2, 2015 (edited) @rons0nHmm, last time I decompiled a ghost its hat fell down in the idle animation, so...Instead decompiling/compiling again, make your ghost animations based on the ESC Template ghost, they'll work perfectly fine. @Ryuushu I thought for sure i knew what to do with the Onload function but apparently not.I added it to my Characters prefab and made sure to add inst.sakura_ghost_flowers = {} at the correct spot but my ghost still doesn't appear after relogin. I went and renamed a few things but that only made things more confusing. Am I missing something or was there an error i didn't check? Other than that though, he works perfectly fine and i haven't had a crash with the ghost yetlocal 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" ), Asset( "ANIM", "anim/sakura.zip" ), Asset( "ANIM", "anim/ghost_sakura_build.zip" ), }local prefabs = { "sakura_ghost_flower", "book_tentacles", "researchlab3_blueprint" }local start_inv = { -- Custom starting items "sakura_ghost_flower" , "book_tentacles", "researchlab3_blueprint" }local tempCaveVar = false local function updatestats(inst) if TheWorld.state.phase == "day" then inst.Light:Enable(true) inst.components.locomotor.walkspeed = (3.5) inst.components.locomotor.runspeed = (5) inst.components.sanity.dapperness = (TUNING.DAPPERNESS_SMALL * -5) inst.components.combat.damagemultiplier = 0.5 -- DAPPERNESS_TINY = 100/(day_time*15), -- DAPPERNESS_SMALL = 100/(day_time*10), -- DAPPERNESS_MED = 100/(day_time*6), -- DAPPERNESS_LARGE = 100/(day_time*3), -- DAPPERNESS_HUGE = 100/(day_time), -- daytime is 300 elseif TheWorld.state.phase == "dusk" then inst.components.locomotor.walkspeed = (5) inst.components.locomotor.runspeed = (6.5) inst.components.sanity.dapperness = (TUNING.DAPPERNESS_SMALL * 3) inst.components.combat.damagemultiplier = 1 elseif TheWorld.state.phase == "night" then inst.components.locomotor.walkspeed = (7.5) inst.components.locomotor.runspeed = (8) inst.components.sanity.dapperness = (TUNING.DAPPERNESS_SMALL * 8) inst.components.combat.damagemultiplier = 2 elseif tempCaveVar == true then inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.75) inst.components.locomotor.runspeed = (TUNING.WILSON_WALK_SPEED * 2.5) inst.components.sanity.dapperness = (TUNING.DAPPERNESS_SMALL * 6) inst.components.combat.damagemultiplier = 1 endend-- This initializes for both clients and the hostlocal common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "sakura.tex" )endlocal function fn() inst:AddComponent("sanityaura") inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE endlocal function OnLoad(inst, data) if data.abigail ~= nil and inst.abigail == nil then local abigail = SpawnSaveRecord(data.abigail) if abigail ~= nil then abigail.SoundEmitter:PlaySound("dontstarve/common/ghost_spawn") abigail:LinkToPlayer(inst) end endend-- This initializes for the host onlylocal master_postinit = function(inst) inst:AddComponent("sanityaura") inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE -- choose which sounds this character will play inst.soundsname = "wendy" -- Stats inst.components.health:SetMaxHealth(125) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(200) inst.components.eater.monsterimmune = true inst.components.eater.strongstomach = true -- Night-vision inst.entity:AddLight() inst.Light:Enable(true) inst.Light:SetRadius(5) inst.Light:SetFalloff(.6) inst.Light:SetIntensity(0.9) inst.Light:SetColour(235/255,12/255,12/255) inst:ListenForEvent( "nighttime", function() inst.entity:AddLight() end, GetWorld() ) inst.ghostbuild = "ghost_sakura_build" inst:AddComponent("reader") inst.sakura_ghost_flowers = {} inst.OnLoad = OnLoad inst:WatchWorldState( "startday", function(inst) updatestats(inst) end ) inst:WatchWorldState( "startdusk", function(inst) updatestats(inst) end ) inst:WatchWorldState( "startnight", function(inst) updatestats(inst) end ) updatestats(inst) return inst endreturn MakePlayerCharacter("sakura", prefabs, assets, common_postinit, master_postinit, start_inv, fn) Edited February 2, 2015 by rons0n Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608854 Share on other sites More sharing options...
Ryuushu Posted February 2, 2015 Share Posted February 2, 2015 (edited) @rons0n... I kinda forgot to mention the OnSave part. Makes sense it isn't working on reload.... And the OnDespawn part.It seems that Wendy has a couple more things linked to Abigail. Didn't really notice them since I was focused on the ghost....local function OnDespawn(inst) if inst.sakura_ghost ~= nil then inst.sakura_ghost.components.lootdropper:SetLoot(nil) inst.sakura_ghost.components.health:SetInvincible(true) inst.sakura_ghost:PushEvent("death") --in case the state graph got interrupted somehow, just force --removal after the dissipate animation should've finished inst.sakura_ghost:DoTaskInTime(25 * FRAMES, inst.sakura_ghost.Remove) endendlocal function OnSave(inst, data) if inst.sakura_ghost ~= nil then data.sakura_ghost = inst.sakura_ghost:GetSaveRecord() endendlocal function OnLoad(inst, data) if data.sakura_ghost ~= nil and inst.sakura_ghost == nil then local sakura_ghost = SpawnSaveRecord(data.sakura_ghost) if sakura_ghost ~= nil then sakura_ghost.SoundEmitter:PlaySound("dontstarve/common/ghost_spawn") sakura_ghost:LinkToPlayer(inst) end endendlocal function master_postinit(inst) ... inst.sakura_ghost = nil inst.sakura_ghost_flowers = {} inst.OnDespawn = OnDespawn inst.OnSave = OnSave inst.OnLoad = OnLoad ...endreturn MakePlayerCharacter("sakura", prefabs, assets, common_postinit, master_postinit, start_inv, fn) Edited February 2, 2015 by Ryuushu Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608859 Share on other sites More sharing options...
rons0n Posted February 2, 2015 Author Share Posted February 2, 2015 @rons0n... I kinda forgot to mention the OnSave part. Makes sense it isn't working on reload.... And the OnDespawn part.It seems that Wendy has a couple more things linked to Abigail. Didn't really notice them since I was focused on the ghost. @Ryuushu Whew! That took longer than expected, but shes finished!My character and her new jelly fish ghost friend is now complete. I'll give you a shoutout! Link to comment https://forums.kleientertainment.com/forums/topic/49954-make-a-custom-abigail/#findComment-608913 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now