Jump to content

Recommended Posts

Ehm, I got an error whilst loading my game up, its a simple character mod and its my first time coding, so Im not very experienced with it.

The crash I get is this:

The following mod(s) have caused a failure: Echo

[string "scripts/mainfunctions.lua"]:92: Error loading file prefabs/o90

[string "../mods/EchoMod/scripts/prefabs/o90.lua"]:40: unexpected symbol near 'local'

LUA ERROR stack traceback:

           =[C] in function 'assert'

           scripts/mainfunctions.lua(92,1)

           =(tail call) ?

           =[C] in function 'xpcall'

           scripts/mods.lua(144,1)

 

And here is my o90.lua file from the prefabs folder:

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/o90.zip" ),




local prefabs = {}



local start_inv =
{
    "sanespear"

}

local player = GLOBAL.GetPlayer()

local fn = function(inst)



    return
    
    inst.soundsname = "webber"
    inst.MiniMapEntity:SetIcon( "wilson.png" )
        inst.components.health:SetMaxHealth(250)
        inst.components.hunger:SetMax(TUNING.WILSON_HUNGER * .65)
        inst.components.combat.damagemultiplier = .85
       inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1.25)
       inst.components.sanity:SetMax(50)
       inst.components.sanity.night_drain_mult = 0.2
       inst.components.self.walkspeed = TUNING.WILSON_WALK_SPEED -- 5
    inst.components.self.runspeed = TUNING.WILSON_RUN_SPEED -- 3
    
    return inst

end


return MakePlayerCharacter("o90", prefabs, assets, fn, start_inv)

If anyone could help me, thanks a lot!

prefabs is not closed, you're missing } here:

 

[...]

-- Don't forget to include your character's custom assets!

Asset( "ANIM", "anim/o90.zip" ),

}

local prefabs = {}

 

[...]

Good catch, but I think you mean "assets" is missing a closing "}" symbol?

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