Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

Update, created most of the asset art for a single hat, my only issue is that i'm struggling with the code, I keep getting an error when the game tries to load asterion on the screen, getting this error:

I'm sorry, but an uncaught exception occurred.

While running game code:

  File "game/script_build05.rpy", line 20819, in script

    you "If anything, I'd like you to accept that you're good.{w=0.4}

  File "game/characters_images.rpy", line 69, in <module>

    if Asterion.stage == "buff" and Asterion.hatwear != "none":

AttributeError: 'AsterionObject' object has no attribute 'hatwear'

--

I've inserted everything that other assets have, but it doesn't seem to want to work. does anyone have any idea?

Hey Kentas, what you're bumping into here is one of the big issues the sprite system I set up has.

Modular character sprites like Asterion's load their filenames from attributes in each character object. If you add an attribute to the class and try to load an older save of the game where the character object didn't have the attribute you added, the game will crash when it tries to render the sprite because that savefile's instance of the object doesn't have the attribute.

There's a workaround for this: you'll notice an "after_load" label in script.rpy. This is a label renpy jumps to right after loading the game, and then it jumps back to the spot it was just in when you load the game. You can set Asterion's new attribute here.

There's an example laid out for you right there: Asterion's chlamys (the cape he wears starting on chapter 18) needed to be added for build 0.5. You'll notice that on line 77 (at least on the file I'm working with) the following happens:

        $Asterion.chlamys = "none"
        $wardrobe.clothing['chlamys'] = {}
        $Asterion.resetFilenames()

First I set the chlamys attribute, then I add a chlamys category to the wardrobe object (which is used on the screen where you change asterion's clothes), and then I make the Asterion object reset filenames. If you added a headwear or a  front/back horn filename attribute on the resetFilenames method, this is where that happens, and now the sprite knows which subsprite to load.

Also yes there are WAY better implementations for this. First of all the fact that wardrobe doesn't have a method for adding a category is fucking nasty and I have no idea why 2019 me thought that was ok

Awesome, thanks for the information, I was banging my head against the wall for 4 hours last night xD