Jump to content

[Help] Custom Character crashing on Tab


Recommended Posts

With the new update, including Workshop Support, characters now require badges or whatever for the Tab menu(server list or whatever it's called). Naturally, wanting my mod not to crash and burn horribly, I made the avatars for the it and tried to implement them.

 

The problem? Crashes anyways. Usually in such a situation, I'd go vulturing for solutions off of characters that actually work, but with such a sparsity, I was unable to find a solution. Any advice or ilk?

 

Error Screen:

post-305423-0-51050500-1417646465_thumb.

 

Exact Modmain Lua:

local require = GLOBAL.requirelocal Ingredient = GLOBAL.Ingredientlocal RECIPETABS = GLOBAL.RECIPETABSlocal STRINGS = GLOBAL.STRINGSlocal ACTIONS = GLOBAL.ACTIONSlocal Action = GLOBAL.ActionSTRINGS.CHARACTERS.GENERIC.DESCRIBE.IKA = ("What a strange squid.")STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.IKA = ("What a strange Watasenia Scintillans!")STRINGS.CHARACTERS.WAXWELL.DESCRIBE.IKA = ("Still at it again?")STRINGS.CHARACTERS.WOODIE.DESCRIBE.IKA = ("Not sure how I feel about that....")STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.IKA = ("Squid comrade!")STRINGS.CHARACTERS.WILLOW.DESCRIBE.IKA = ("I could go for some calimari...")STRINGS.CHARACTERS.WENDY.DESCRIBE.IKA = ("Given strange eons...")STRINGS.CHARACTERS.WX78.DESCRIBE.IKA = ("AQUATIC SPECIES DETECTED.")--STRINGS.CHARACTERS.WES.DESCRIBE.IKA = (" ")PrefabFiles = {	"ika",}Assets = {    Asset( "IMAGE", "images/saveslot_portraits/ika.tex" ),    Asset( "ATLAS", "images/saveslot_portraits/ika.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/ika.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/ika.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/ika_silho.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/ika_silho.xml" ),    Asset( "IMAGE", "bigportraits/ika.tex" ),    Asset( "ATLAS", "bigportraits/ika.xml" ),		Asset( "ATLAS", "images/musume.xml" ),	Asset( "IMAGE", "images/musume.tex" ),		Asset("SOUNDPACKAGE", "sound/musume.fev"),    Asset("SOUND", "sound/musume.fsb"),		Asset( "IMAGE", "images/avatars/avatar_ika.tex" ),    Asset( "ATLAS", "images/avatars/avatar_ika.xml" ),		Asset( "IMAGE", "images/avatars/avatar_ghost_ika.tex" ),    Asset( "ATLAS", "images/avatars/avatar_ghost_ika.xml" ),		Asset( "IMAGE", "images/avatars.tex" ),    Asset( "ATLAS", "images/avatars.xml" ),}local require = GLOBAL.requireGLOBAL.STRINGS.CHARACTERS.IKA = require "speech_ika"-- The character select screen lines-- note: these are lower-case character nameGLOBAL.STRINGS.CHARACTER_TITLES.ika = "The Inkvader"GLOBAL.STRINGS.CHARACTER_NAMES.ika = "Ika Musume"  -- Note! This line is especially important as some parts of the game require                                            -- the character to have a valid name.GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.ika = "*Glows in the Dark and is a Squid\n*Determined to inkvade with her umbrella!\n*Terrified of Monsters"GLOBAL.STRINGS.CHARACTER_QUOTES.ika = "\"I am Squid Girl, invader of the sea!\""-- Let the game know ika is a male, for proper pronouns during the end-game sequence.-- Possible genders here are MALE, FEMALE, or ROBOTtable.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "ika")RemapSoundEvent( "dontstarve/characters/ika/death_voice", "musume/sound/death_voice" )RemapSoundEvent( "dontstarve/characters/ika/hurt", "musume/sound/hurt" )RemapSoundEvent( "dontstarve/characters/ika/talk_LP", "musume/sound/talk_LP" )AddMinimapAtlas("images/musume.xml")GLOBAL.STRINGS.NAMES.IKA = "Ika Musume"AddModCharacter("ika") 

 

Log Details pertaining:

 

*insert everything going peachy*

Received request to spawn as ika from Magick Evil Squid[Host]
 
[Fixed]
 
SPAWNING PLAYER AT: (-450.00, 0.00, 66.00)
Serialize session to session/0BA000E6BF43DCF4/KU_u05aAEiC
OnSaveMinimapComplete
Deserialize local session session/0BA000E6BF43DCF4/KU_u05aAEiC
OnLoadMinimapComplete
Deserializing cached icon data: 0
Deserializing tile data (425 x 425)
WARNING! Could not find region 'avatar_ika.tex' from atlas 'images/avatars.xml'. Is the region specified in the atlas?
images/avatars.xml
LUA ERROR stack traceback:
        scripts/widgets/image.lua(30,1) in function 'SetTexture'
        scripts/widgets/image.lua(11,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'Image'
        scripts/widgets/playerbadge.lua(26,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'PlayerBadge'
        scripts/screens/playerstatusscreen.lua(232,1) in function 'DoInit'
        scripts/screens/playerstatusscreen.lua(14,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'PlayerStatusScreen'
        scripts/screens/playerhud.lua(318,1) in function 'ShowPlayerStatusScreen'
        scripts/screens/playerhud.lua(352,1) in function 'OnControl'
        scripts/frontend.lua(241,1) in function 'OnControl'
        scripts/input.lua(163,1) in function 'OnControl'
        scripts/input.lua(338,1)
images/avatars.xml
LUA ERROR stack traceback:
        scripts/widgets/image.lua(30,1) in function 'SetTexture'
        scripts/widgets/image.lua(11,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'Image'
        scripts/widgets/playerbadge.lua(26,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'PlayerBadge'
        scripts/screens/playerstatusscreen.lua(232,1) in function 'DoInit'
        scripts/screens/playerstatusscreen.lua(14,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'PlayerStatusScreen'
        scripts/screens/playerhud.lua(318,1) in function 'ShowPlayerStatusScreen'
        scripts/screens/playerhud.lua(352,1) in function 'OnControl'
        scripts/frontend.lua(241,1) in function 'OnControl'
        scripts/input.lua(163,1) in function 'OnControl'
        scripts/input.lua(338,1)
SCRIPT ERROR! Showing error screen
QueryServerComplete no callback
QueryServerComplete no callback
Force aborting...
 
Edited by TheKingofSkulls
Link to comment
Share on other sites

@TheKingofSkulls, I talked to PeterA and there isn't currently full support for it. It should be pretty simple to fix though, so I'm guessing one of the next two hotfixes will have a fix for it.

 

Basically the situation at the moment is that playerbadge.lua checks for mod characters' textures, but it has a locally hardcoded atlas at the moment. The only way around it until that gets fixed is to provide a new playerbadge.lua that has a place to provide a mod character atlas.

Link to comment
Share on other sites

The hot fix is live now and fixes the issues with your mod that you were seeing. In your character prefab's common_postinit function, you'll want to do the following.

 

local function common_postinit(inst)    inst.avatar_tex   = "avatar_ika.tex"    inst.avatar_atlas = "images/avatars/avatar_ika.xml"	    inst.avatar_ghost_tex   = "avatar_ghost_ika.tex"    inst.avatar_ghost_atlas = "images/avatars/avatar_ghost_ika.xml"end

This should fix both the player status screen (Tab) as well as the offscreen target indicators.

 

Thanks! However, I'd like to report a bug or something. Me and my friends were doodling around, having a grand old time, however, anytime one of them would hit tab when I wasn't within their screen range, they would crash. However, it worked fine if they could see me. Any reason why?

Link to comment
Share on other sites

  • Developer

Thanks! However, I'd like to report a bug or something. Me and my friends were doodling around, having a grand old time, however, anytime one of them would hit tab when I wasn't within their screen range, they would crash. However, it worked fine if they could see me. Any reason why?

 

Ahhh excellent, you appear to have found a condition that my test cases didn't stress. I'm guessing that you got far enough away that some information that the status screen needs wasn't being synced anymore. I'll look into that and try get a fix for you as soon as I can. If you happen to have the log file when it crashed still, could you post it on here? 

 

Thanks for finding this! 

Link to comment
Share on other sites

  • Developer

Due to some complications with how player inst data is synced online, I had to change the solution for custom player badges. The next hot fix will include this change.

 

By default, the character mod avatar's atlas is expected to be images/avatars/avatar_prefabname.xml, and the texture images/avatars/avatar_prefabname.tex. For ghosts, images/avatars/avatar_ghost_prefabname.xml and images/avatars/avatar_ghost_prefabname.tex respectively.

 

If you want to have your atlases in a different directory, you can put this line into your modmain.

GLOBAL.MOD_AVATAR_LOCATIONS["prefabname"] = "images/extraspecial_avatars/"

We've also added some early support for changing the state of your character at runtime and having that be reflected in the avatar. To do this in your update, you'll want to set a tag and user flag on the instance.

--in your component updateif some_condition then    self.inst:AddTag("chr_state_1")    self.inst.Network:AddUserFlag(USERFLAGS.CHARACTER_STATE_1)end

This will then use avatar_prefabname_1.xml and avatar_prefabname_1.tex for the avatar. We don't currently have any use cases of this yet, but I anticipate we will in the future.

 

 

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...