Jump to content

First mod problem


Recommended Posts

Created first character mod but it keeps crashing, I ask for help.

 

-----modmain

 

local STRINGS = GLOBAL.STRINGS

PrefabFiles = {
    "will",
}

Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/will.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/will.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/will.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/will.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/will_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/will_silho.xml" ),

    Asset( "IMAGE", "bigportraits/will.tex" ),
    Asset( "ATLAS", "bigportraits/will.xml" ),

}

table.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "will")


AddModCharacter("will")
 

 

----And script

 

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!

}
local prefabs = { "backpack"}

local start_inv = { "backpack"}

local fn = function(inst)
    
    -- choose which sounds this character will play
    inst.soundsname = "willow"

    -- a minimap icon must be specified
    inst.MiniMapEntity:SetIcon( "wendy.png" )

    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 2)
    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 2)
    inst.components.health.maxhealth = 120
    inst.components.hunger.maxhunger = 90
    inst.components.sanity.maxsanity = 270
    inst.components.sanity.night_drain_mult = TUNING.WENDY_SANITY_MULT
    inst.components.insulator.insulation = 75

end

GLOBAL.STRINGS.CHARACTER_TITLES.will = "The Orphan Girl"
GLOBAL.STRINGS.CHARACTER_NAMES.will = "Will"  
GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.will = "*Has backpack\nHas small stomach but runs fast\nHigh sanity and resist to cold"
GLOBAL.STRINGS.CHARACTER_QUOTES.will = "Where am I?""

STRINGS.CHARACTERS.WILL = "speech_will"

table.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "will")

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

Link to comment
Share on other sites

I've looked at it, but nothing stands out. Please can we have the log.txt? Look in (on Windows) your documents folder > Klei > DoNotStarve and upload for us the log.txt after the game crashes as a result of your mod.

 

Also, in future, when posting code blocks in the forums, highlight (select) the code and use the code.png (Code) button to format it nicely.

Link to comment
Share on other sites

Here we go, I believe this is of relevance:

../mods/workshop-173728136/images/saveslot_portraits/dipper.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/workshop-173728136/images/selectscreen_portraits/dipper.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-173728136/images/selectscreen_portraits/dipper_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-180046963/images/saveslot_portraits/norman.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/workshop-180046963/images/selectscreen_portraits/norman.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-180046963/images/selectscreen_portraits/norman_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-174902240/images/saveslot_portraits/mabel.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/workshop-174902240/images/selectscreen_portraits/mabel.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-174902240/images/selectscreen_portraits/mabel_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-176195384/images/saveslot_portraits/coraline.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/workshop-176195384/images/selectscreen_portraits/coraline.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/workshop-176195384/images/selectscreen_portraits/coraline_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.

The above textures need dimensions that are powers of 2, e.g. 16x16, 32x32, 64x64, 128x128, 256x256.

 

 

Edit: However, this doesn't seem to be your mod's problem, so I'm not sure if this is the problem. Try disabling those mods, perhaps?

Link to comment
Share on other sites

That's odd, they work normal on game, my mod has some problem, I try to enable it and then game crashes.

 

Edit

 

I did it, but it still crashes, quiet unluck I have, maybe I should upload mod to check up.

Link to comment
Share on other sites

-----modmainlocal STRINGS = GLOBAL.STRINGSPrefabFiles = {    "will",}

Let me just check, are you sure you have a file in your mod folder "scripts/prefabs/will.lua"? If not, I believe it will crash silently, I believe I have made the same mistake. It wasn't specified what you named your lua file, so I thought it was best to check.

 

Edit: Perhaps it's not a bad idea to upload the mod in a .zip so I can poke it.

Link to comment
Share on other sites

It was before and I fixed it, now it crashes and I need to close game up. :(

Check all files again to see if you haven't made an error somewhere .

And what tutorial do you use to create your custom char?

You should use Better Wod as tutorial,it explain everything very well !

http://forums.kleientertainment.com/files/file/520-wod-better/

If you are already using it as example so the error is from you.you forgotted something,check all files again.

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