Jump to content

Wilton, The Skeleton (Wilton, The Undead Ver. 3.0)


Recommended Posts

warmondbigportaitfinal.png

Hello everyone. I'am here today get help and opinion with Wilton, The Skeleton (formely known as Wilton, The Undead because who likes to call Wilton by his affiliation and not by what he is).

 

I became very interested in debugman18's mod of Wilton. I saw the mod having great potential. But with a drawback of unbalance which is something I aim to correct so Wilton could be a more welcoming character to all players and wouldn't be something like Super Wes. So here's a list of things that I changed/left as it was.

 

General:

- HP: 70

- Sanity: 40

- Hunger: Doesn't exist.

- Insomniac (It's to help Wilton be balanced when it comes to his huge Sanity regeneration).

- Can eat any and all foods but won't recieve the benefits and penalties to Health or Sanity when done so (Dark Petals have their own special effect which reduces sanity. Plus they are EVIL).

- Has a 25% speed increase (because bones are practically weightless so speed is not impaired by wind or mass).

- Has Wendy's damage multiplier (meaning he will do as much damage as Wendy).

- Has Maxwell's Sanity regeneration multiplier (Dapperness).

- Has a Bone-a-Rang (I increased the damage done by the Bone-A-Ring to 20 (damage is affected by Wendy's damage multiplier) so simple NPC's like birds would fall in atleast two hits).

- Can reincarnate from a nearest Skeleton in the generated world. But that in turn switches to the next day's morning.

- Can dig up a Skeleton from a Grave Mound (very rarely).

- Immune to Overheating and Freezing.

 

Bugs/Issues:

- Wilton will say the Gravestone Epitaph lines normally like every other character instead of using his own.

 

Link to comment
Share on other sites

@KiddyCorky In Wiltons fn (warmod.lua) you can add the function

inst.components.eater:SetOnEatFn(function(inst, food)    if food.components.edible.sanityvalue then       inst.components.sanity:DoDelta(-food.components.edible.sanityvalue)    endend)

Sorry for the bad formatting, I'm not sure how to add code on my phone.
Some names of variables might not be correct as well, but you can find everything relevant in the respective components files.

Link to comment
Share on other sites

Why do you want him to eat food?  It would just fall through him yes ?

 

That's the point (except for the falling through part... perhaps we could say he has a black hole in his chest?). As a Skeleton. He should be able to eat any and all food. But not gain or lose Sanity and Health when done so. Basically becoming a garbage dump for useless stuff like Monster Meat when you perhaps live near a bee hive spider farm.

 

So instead I want the players to rely on the Survival items like mentioned in my post (Spider Gland, Honey Poultice, Healing Salve) to mend his damaged bones so to speak.

Link to comment
Share on other sites

Another thing though.

 

I really need opinion on this. Considering I added Maxwell's Sanity regeneration to Wilton. He automatically becomes immune to simple Sanity reducing techniques like the Night and Rain.

 

Should I keep it as is. Or should I decrease the value from HUGE to SMALL. It's important because Wilton actually gains Sanity back pretty fast and so it feels like the only way he would go insane fast would be from stuff like Monsters or getting followers from the One Man Band and so on.

 

Also I believe keeping Sanity on Wilton is important because even if he is a Skeleton. He is still a being who can think for himself... so to speak. That's why I gave him the description of *Has little Sanity his rotting brain left him with

Link to comment
Share on other sites

@KiddyCorky In Wiltons fn (warmod.lua) you can add the function

inst.components.eater:SetOnEatFn(function(inst, food)    if food.components.edible.sanityvalue then       inst.components.sanity:DoDelta(-food.components.edible.sanityvalue)    endend)

Sorry for the bad formatting, I'm not sure how to add code on my phone.

Some names of variables might not be correct as well, but you can find everything relevant in the respective components files.

 

Am I doing something wrong here? I keep getting errors saying end is expected after the local functions.

 

Here's the main bit of the local fn:

local fn = function(inst)        -- choose which sounds this character will play    inst.soundsname = "wilton"    -- a minimap icon must be specified    inst.MiniMapEntity:SetIcon( "wilton.png" )    inst:AddComponent("lootdropper")    inst:AddTag("iswilton")    -- todo: Add an example special power here.    --wilton    inst.components.health.maxhealth = 70    inst.components.sanity.max = 40    inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT    inst.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE    inst.components.eater.ignoresspoilage = true    inst.components.eater.strongstomach = true    --wilton does not get hungry    inst.components.hunger:Pause()    inst.components.hunger:SetRate(0)    inst.components.hunger:SetKillRate(0)    --fast wilton    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.25)    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.25)    --spawn with eyebone    inst.components.inventory:GuaranteeItems(start_inv)    --wilton food    inst.components.eater:SetOnEatFn(function(inst, food)    if food.components.edible.sanityvalue then       inst.components.sanity:DoDelta(-food.components.edible.sanityvalue)    endend)
Link to comment
Share on other sites

Am I doing something wrong here? I keep getting errors saying end is expected after the local functions.

 

Here's the main bit of the local fn:

local fn = function(inst)        -- choose which sounds this character will play    inst.soundsname = "wilton"    -- a minimap icon must be specified    inst.MiniMapEntity:SetIcon( "wilton.png" )    inst:AddComponent("lootdropper")    inst:AddTag("iswilton")    -- todo: Add an example special power here.    --wilton    inst.components.health.maxhealth = 70    inst.components.sanity.max = 40    inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT    inst.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE    inst.components.eater.ignoresspoilage = true    inst.components.eater.strongstomach = true    --wilton does not get hungry    inst.components.hunger:Pause()    inst.components.hunger:SetRate(0)    inst.components.hunger:SetKillRate(0)    --fast wilton    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.25)    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.25)    --spawn with eyebone    inst.components.inventory:GuaranteeItems(start_inv)    --wilton food    inst.components.eater:SetOnEatFn(function(inst, food)    if food.components.edible.sanityvalue then       inst.components.sanity:DoDelta(-food.components.edible.sanityvalue)    endend)

Looks like fn never closes. You'll need an additional end for that.

Link to comment
Share on other sites

Looks like fn never closes. You'll need an additional end for that.

 

Okay that worked. But at the same time it didn't. So eating foods that give sanity reduce your sanity by 1 point. Eating foods that reduce sanity like normal will... well reduce it like normal.

 

Also the sleeping in a tent gives full health... I should probably just give Wilton the Insomniac component.

Link to comment
Share on other sites

Okay nevermind. I was correct. What happens is opposite of what normally food would do. Like let's say I ate a Deerclops Eyeball. It doesn't heal me by 60 HP. It decreases my HP by 60 (causing me to die). But strangely the effects are different for every food. Some decrease my sanity by little. Some increase it. Some give me health. Some don't.

 

So I guess I still need to find a way to tweak the functions to completely stop food from doing anything to me.

Link to comment
Share on other sites

Okay nevermind. I was correct. What happens is opposite of what normally food would do. Like let's say I ate a Deerclops Eyeball. It doesn't heal me by 60 HP. It decreases my HP by 60 (causing me to die). But strangely the effects are different for every food. Some decrease my sanity by little. Some increase it. Some give me health. Some don't.

 

So I guess I still need to find a way to tweak the functions to completely stop food from doing anything to me.

Actually what my code should do is remove the same amount of sanity that was added by the food item (or add it respectively for items removing sanity). It does not yet take into account that food could change health and also doesn't work for healers (i.e. healing salve) You'll need to figure that out yourself, or at least try it.

Link to comment
Share on other sites

Actually what my code should do is remove the same amount of sanity that was added by the food item (or add it respectively for items removing sanity). It does not yet take into account that food could change health and also doesn't work for healers (i.e. healing salve) You'll need to figure that out yourself, or at least try it.

 

Well it doesn't matter for healers since they don't belong to the food category. I just need to make food not effect Sanity or Health at all. It's either that. Or making Wilton completely not being able to eat items from the food category.

Link to comment
Share on other sites

There are two ways to do what you want to do one requires you to do this for ever single food and the other has the issue of not removing the sounds

 

first you can do this

local function berriesSet(inst)		inst.components.edible.healthvalue = 0	inst.components.edible.hungervalue = 0	endAddPrefabPostInit("berries", berriesSet)

You have to do it for every food separately. I tried doing a for loop using GLOBAL.Prefabs but the AddPrefabPostInit function just would not seem to work in it.

function SimInit(inst)	inst:ListenForEvent("oneatsomething", function(inst, data)				inst.HUD.controls.status.stomach.pulse:Hide()		inst.HUD.controls.status.heart.pulse:Hide()		inst.components.health:DoDelta(-data.food.components.edible.healthvalue, false, "") 		inst.components.hunger:DoDelta(-data.food.components.edible.hungervalue)				inst:DoTaskInTime(.2, function(inst, data) 			inst.HUD.controls.status.stomach.pulse:Show()			inst.HUD.controls.status.heart.pulse:Show()			end)			end)endAddSimPostInit(SimInit)

This works for every food but won't remove the sounds accompanying the loss/gain.

 

Ok There is a much better way to do this I wasn't thinking straight

require = GLOBAL.requireGetPlayer = GLOBAL.GetPlayerif GetPlayer.prefab == "wilton" then    local Edible = require("components/edible")    ----------------------------------------------------------------------------------    ----------------------------------------------------------------------------------    function Edible:GetHunger(eater)	    return 0    end    function Edible:GetHealth(eater)	    return 0    endend

That will set all health and hunger gain form food to 0 only for wilton

Link to comment
Share on other sites

require = GLOBAL.requireGetPlayer = GLOBAL.GetPlayerif GetPlayer.prefab == "wilton" then    local Edible = require("components/edible")    ----------------------------------------------------------------------------------    ----------------------------------------------------------------------------------    function Edible:GetHunger(eater)	    return 0    end    function Edible:GetHealth(eater)	    return 0    endend

That will set all health and hunger gain form food to 0 only for wilton

 

I can change GetHunger to GetSanity right? Also I should place this inside modmain.lua correct?

Link to comment
Share on other sites

Assuming Edible:GetSanity is the name of the sanity function in the component edible.

 

Alright. Tried the methods. But it seems the game just crashes after loading up a new game.

 

If you want to look at the modmain.lua and the prefab lua files then here:

 

modmain.lua

local STRINGS = GLOBAL.STRINGSGetClock = GLOBAL.GetClockGetPlayer = GLOBAL.GetPlayerPrefabFiles = {    "warmond",    "bonerang",}Assets = {    Asset( "ATLAS", "images/saveslot_portraits/warmond.xml" ),    Asset( "IMAGE", "images/saveslot_portraits/warmond.tex" ),        Asset( "ATLAS", "images/selectscreen_portraits/warmond.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/warmond.tex" ),        Asset( "ATLAS", "images/selectscreen_portraits/warmond_silho.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/warmond_silho.tex" ),        Asset( "ATLAS", "bigportraits/warmond.xml" ),    Asset( "IMAGE", "bigportraits/warmond.tex" ),            Asset( "ATLAS", "images/inventoryimages/bonerang.xml" ),    Asset( "IMAGE", "images/inventoryimages/bonerang.tex" ),}function uniqueitem1(inst)    inst:AddTag("uniqueitem1")endfunction uniqueitem2(inst)    inst:AddTag("uniqueitem2")endfunction doresurrect(inst, dude)    print "Wilton is trying to respawn."        dude:DoTaskInTime(2, function()                --This removes any already-existing eyebones and bonerangs.            clearduplicates1 = TheSim:FindFirstEntityWithTag("uniqueitem1")        clearduplicates1:Remove()        clearduplicates2 = TheSim:FindFirstEntityWithTag("uniqueitem2")        clearduplicates2:Remove()        dude.components.lootdropper:SetLoot({"chester_eyebone","bonerang"})                --This sets your respawnpoint to wherever the skeleton is.        dude.Transform:SetPosition(inst.Transform:GetWorldPosition())                dude:Show()                --Makes next day so that there are no issues with night.        GetClock():MakeNextDay()                --Gives you back your unique items.        dude.components.lootdropper:DropLoot()        dude.components.lootdropper:SetLoot({})                --These lines set your stats to half of normal.        if dude.components.health and dude.components.health.maxhealth >= 10 then            dude.components.health:Respawn(35)            dude.components.health:SetPercent(0.5)            dude.components.health.maxhealth = dude.components.health.maxhealth-10        end            if dude.components.sanity then            dude.components.sanity:SetPercent(0.3)        end                    dude.sg:GoToState("wakeup")                --This removes the skeleton so it can't be reused.        inst.components.resurrector.used = true        inst:Remove()        dude:ClearBufferedAction()                --This brings the HUD back up.        if dude.HUD then            dude.HUD:Show()        end                --This makes sure the health meter shows the changes.        dude.components.health:DoDelta(1)        dude.components.health:DoDelta(-1)                return true    end)endfunction reincarnate(inst)        local canbehelped = false    local MainCharacter = GetPlayer()        if MainCharacter.prefab == "warmond" then        canbehelped = true    end        if canbehelped == true then        inst:AddComponent("resurrector")        inst.components.resurrector.penalty = 0            inst.components.resurrector.active = true            inst.components.resurrector.used = false            inst.components.resurrector.doresurrect = doresurrect            print "This is one skeleton"        return inst    end    endlocal function ModMaxwellIntro(inst)    if GLOBAL.GetPlayer().prefab == "warmond" 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 = "Say pal, you don't look so...",                wait = 3,                anim = nil,                sound = nil,            },            {                string = "Oh, it's you again. Nevermind.",                wait = 3,                anim = nil,                sound = nil,            },        }    endend AddPrefabPostInit("maxwellintro", ModMaxwellIntro)AddSimPostInit(function(inst)    if inst.prefab == "warmond" then        inst.HUD.controls.status.brain:SetPosition( inst.HUD.controls.status.stomach:GetPosition() )        inst.HUD.controls.status.stomach:Hide()        --This makes sure that Wilton can eat anything.        inst.components.eater:SetOmnivore()    endend)GLOBAL.STRINGS.NAMES.BONERANG = "Bone-A-Rang"AddPrefabPostInit('skeleton', reincarnate)AddPrefabPostInit('chester_eyebone', uniqueitem1)AddPrefabPostInit('bonerang', uniqueitem2)AddModCharacter("warmond")

and warmond.lua (the character prefab)

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" ),        Asset( "ANIM", "anim/warmond.zip" ),        Asset( "ANIM", "anim/bonerang.zip"),        Asset( "ANIM", "anim/swap_bonerang.zip"),    }local prefabs = { "chester_eyebone", "bonerang",}local start_inv = { "chester_eyebone", "bonerang",}function GetSpecialCharacterString(character)    character = string.lower(character)    if character == "warmond" then        local sayings =        {            "Ehhhhhhhhhhhhhh.",            "Eeeeeeeeeeeer.",            "Rattle.",            "Click click click click.",            "Hissss!",            "Aaaaaaaaa.",            "Mooooooooooooaaaaan.",            "...",        }        return sayings[math.random(#sayings)]    elseif character == "wes" then        return ""    --else        --print (character)    endend    local fn = function(inst)        -- choose which sounds this character will play    inst.soundsname = "wilton"    -- a minimap icon must be specified    inst.MiniMapEntity:SetIcon( "wilton.png" )    inst:AddComponent("lootdropper")    inst:AddTag("iswilton")    inst:AddTag("insomniac")    -- todo: Add an example special power here.    --wilton    inst.components.health.maxhealth = 70    inst.components.sanity.max = 40    inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT    inst.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE        inst.components.eater.ignoresspoilage = true        inst.components.eater.strongstomach = true    --wilton does not get hungry    inst.components.hunger:Pause()    inst.components.hunger:SetRate(0)    inst.components.hunger:SetKillRate(0)    --fast wilton    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.25)    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.25)    --spawn with eyebone    inst.components.inventory:GuaranteeItems(start_inv)endSTRINGS.CHARACTER_TITLES.warmond = "The Skeleton"STRINGS.CHARACTER_NAMES.warmond = "Wilton"STRINGS.CHARACTER_DESCRIPTIONS.warmond = "*Is brittle, fast, hits weak, reincarnates, does not starve\n*Has little sanity his rotting brain left him with\n*Carries an Eye Bone and has a spooky Bone-A-Rang"STRINGS.CHARACTER_QUOTES.warmond = "\"Rattle...\""STRINGS.CHARACTERS.WARMOND = {}STRINGS.CHARACTERS.WARMOND.DESCRIBE = {}STRINGS.CHARACTERS.WARMOND.DESCRIBE.GENERIC = "Rattle..."   return MakePlayerCharacter("warmond", prefabs, assets, fn, start_inv)
Link to comment
Share on other sites

Alright. Tried the methods. But it seems the game just crashes after loading up a new game.

 

If you want to look at the modmain.lua and the prefab lua files then here:

 

modmain.lua

and warmond.lua (the character prefab)

Please just upload the entire mod its so much easier to figure out problems that way.

 

Also I do not even see the functions to change the health etc in those files you definitely need to upload the mod if you want help, as I'm not even sure those are correct if you did add those functions.

Link to comment
Share on other sites

Also I do not even see the functions to change the health etc in those files you definitely need to upload the mod if you want help, as I'm not even sure those are correct if you did add those functions.

 

Oh sorry I removed them. I basically just added them to the warmond.lua prefab changed prefab wilton to warmond and loaded it up. It works until you press new game. So I just thought to remove them.

Link to comment
Share on other sites

Oh sure. Here ya go: https://www.dropbox.com/s/4diyl61clpamtu2/Wilton%20The%20Skeleton.zip

 

I just figured since the entire mod depends on the modmain.lua and the prefabs I could post them here.

 

Oh sorry I removed them. I basically just added them to the warmond.lua prefab changed prefab wilton to warmond and loaded it up. It works until you press new game. So I just thought to remove them.

 

The whole point of posting is to try to fix what crashed the game if you don't post what was crashign it is very hard to fix but here is my guess

 

I changed this to the modmain

AddSimPostInit(function(inst)	if inst.prefab == "warmond" then		inst.HUD.controls.status.brain:SetPosition( inst.HUD.controls.status.stomach:GetPosition() )		inst.HUD.controls.status.stomach:Hide()		--This makes sure that Wilton can eat anything.		inst.components.eater:SetOmnivore()		local Edible = require("components/edible")	    ----------------------------------------------------------------------------	    ----------------------------------------------------------------------------	    function Edible:GetHunger(eater)	        return 0	    end	    function Edible:GetHealth(eater)	        return 0	    end	    function Edible:GetSanity(eater)	        return 0	    end	endend)

It crashed but that made me notice you didn't have...

require = GLOBAL.require

...in your mod as the error message said require was not defined so I added that at the top of the file and now it works.

 

No more sanity, health or hunger change from food and you do want to keep the hunger in there I believe as while you hid the hunger widget the sounds will still trigger I believe if his hunger changes even if you can't see it.

Link to comment
Share on other sites

The whole point of posting is to try to fix what crashed the game if you don't post what was crashign it is very hard to fix but here is my guess

 

I changed this to the modmain

AddSimPostInit(function(inst)	if inst.prefab == "warmond" then		inst.HUD.controls.status.brain:SetPosition( inst.HUD.controls.status.stomach:GetPosition() )		inst.HUD.controls.status.stomach:Hide()		--This makes sure that Wilton can eat anything.		inst.components.eater:SetOmnivore()		local Edible = require("components/edible")	    ----------------------------------------------------------------------------	    ----------------------------------------------------------------------------	    function Edible:GetHunger(eater)	        return 0	    end	    function Edible:GetHealth(eater)	        return 0	    end	    function Edible:GetSanity(eater)	        return 0	    end	endend)

It crashed but that made me notice you didn't have...

require = GLOBAL.require

...in your mod as the error message said require was not defined so I added that at the top of the file and now it works.

 

No more sanity, health or hunger change from food and you do want to keep the hunger in there I believe as while you hid the hunger widget the sounds will still trigger I believe if his hunger changes even if you can't see it.

 

Thanks. I'll note that down.

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