Jump to content

Recommended Posts

Hi there, I was just wondering if was vet. would be able to help me figure out what is going on with my mod. Here is a screenshot of the error message, and the code.

Quote

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/harmin.zip" ),
        Asset( "ANIM", "anim/harmin_beard.zip" ),
}

local prefabs =
{
    "beardhair",
}

local start_inv = {
    -- Custom starting items
    "piggyback",
    "axe",
    "pickaxe",
}

 local fn = function OnResetBeard(inst)    
inst.AnimState:ClearOverrideSymbol("beard")
end

--tune the beard economy...
local BEARD_DAYS = { 1, 2, 3 }
local BEARD_BITS = { 1, 3,  9 }
 
local fn = function OnGrowShortBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "harmin_beard", "beard_short")    
inst.components.beard.bits = BEARD_BITS[1]
end

local fn = function OnGrowMediumBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "harmin_beard", "beard_medium")    
inst.components.beard.bits = BEARD_BITS[2]
end

local fn = function OnGrowLongBeard(inst)    
inst.AnimState:OverrideSymbol("beard", "harmin_beard", "beard_long")    
inst.components.beard.bits = BEARD_BITS[3]
end

local fn = function(inst)
    
    inst:AddComponent("beard")    
    inst.components.beard.onreset = OnResetBeard    
    inst.components.beard.prize = "beardhair"    
    inst.components.beard:AddCallback(BEARD_DAYS[1], OnGrowShortBeard)    
    inst.components.beard:AddCallback(BEARD_DAYS[2], OnGrowMediumBeard)    
    inst.components.beard:AddCallback(BEARD_DAYS[3], OnGrowLongBeard)  
    
    -- choose which sounds this character will play
    inst.soundsname = "wilson"

    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "wilson.tex" )
    
    -- Stats    
    inst.components.health:SetMaxHealth(200)
    inst.components.hunger:SetMax(150)
    inst.components.sanity:SetMax(350)
    
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 3
    
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = .20 * TUNING.WILSON_HUNGER_RATE
    
    -- Movement speed (optional)
    inst.components.locomotor.walkspeed = 7
    inst.components.locomotor.runspeed = 10
end
return MakePlayerCharacter("harmin", prefabs, assets, fn, start_inv)

 

 

modERROR.png

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
×
  • Create New...