Customizable Sprite with Blinking? [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#16 Post by ArizaLuca » Fri Jul 26, 2019 8:34 pm

Code: Select all

image player = LiveComposite(
        (740, 1110),
        (0,0), "player/player_base.png",
        (0,0), "player/player_skin_%s.png"%(skin),
        (0,0), "player/player_hair_%s.png"%(hair),
        (0,0), "player_eyes_%s"%(eye),
        (0,0), ConditionSwitch(
            "pbrow == 'quirk'", "player/player_eyebrows_quirked.png",
            "pbrow == 'raised'", "player/player_eyebrows_raised.png",
            "pbrow == 'sad'", "player/player_eyebrows_sad.png",
            "pbrow == 'angry'", "player/player_eyebrows_angry.png",
            "pbrow == 'thoughtful'", "player/player_eyebrows_thoughtful.png",
            "'True'", "player/player_eyebrows_normal.png",
            ),
        (0,0), ConditionSwitch(
            "pmouth == 'open'", "player/player_mouth_open.png",
            "pmouth == 'opensmile'", "player/player_mouth_opensmile.png",
            "pmouth == 'smile'", "player/player_mouth_smile.png",
            "pmouth == 'teeth'", "player/player_mouth_teeth.png",
            "pmouth == 'toothysmile'", "player/player_mouth_toothysmile.png",
            "'True'", "player/player_mouth_frown.png",
            ),
        (0,0), ConditionSwitch(
            "pshadow == 'full'", "player/player_shadow.png",
            "pshadow == 'half'", "player/player_shadow2.png",
            "'True'", "none.png",
            ),
        (0,0), ConditionSwitch(
            "ptears == 'tears'", "player/player_tears.png",
            "'True'", "none.png",
            ),
        (0,0), ConditionSwitch(
            "psweatdrop == 'sweatdrop'", "player/player_sweatdrop.png",
            "'True'", "none.png",
            )
        )
        
    
image side playerside:
    LiveCrop((50, 0, 800, 750), zoom=0.6, xoffset=0, "player")
It's fully closed if that's what the question was... I think...

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#17 Post by namastaii » Sat Jul 27, 2019 10:45 am

if you take out all the %s lines (just comment them out temporarily) and run the game, does an error still occur? if the game runs after that, I'd try the other version I suggested ([s_variable])

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#18 Post by ArizaLuca » Sun Jul 28, 2019 6:46 am

I tried; this error proceeded to pop up. I think the issue might be the skins and hairs and whatnot. :/

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/definitions/player definitions.rpy", line 1070, in script
    image player = LiveComposite(
Exception: Not a displayable: (<Fixed at 1125df550>, 0.1)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/definitions/player definitions.rpy", line 1070, in script
    image player = LiveComposite(
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1003, in execute
    renpy.exports.image(self.imgname, img)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 374, in image
    d = renpy.easy.displayable(d)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/easy.py", line 136, in displayable
    raise Exception("Not a displayable: %r" % (d,))
Exception: Not a displayable: (<Fixed at 1125df550>, 0.1)

Darwin-18.0.0-x86_64-i386-64bit
Ren'Py 7.2.2.491
Desruc Dolls 1.0
Sun Jul 28 06:45:48 2019

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#19 Post by namastaii » Sun Jul 28, 2019 9:28 am

do the file names look exactly how they are written in the live composite?

player/player_skin_1.png, player/player_skin_2.png, player/player_skin_3.png

and live composite looks like

Code: Select all

image player = LiveComposite(
        (740, 1110),
        (0,0), "player/player_base.png",
        (0,0), "player/player_skin_[s_skin].png",
        (0,0), "player/player_hair_[s_hair].png",
        (0,0), "player_eyes_[s_eye]"),
Other than that I can't fully see what's going on but I would understand creating a demo for me to look at would be tedious for this bit also since you've already done a couple haha

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#20 Post by ArizaLuca » Mon Jul 29, 2019 5:29 pm

This error popped up immediately:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/definitions/player definitions.rpy", line 1070, in script
    image player = LiveComposite(
Exception: Not a displayable: (<Fixed at 111bc23d0>, 0.1)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/definitions/player definitions.rpy", line 1070, in script
    image player = LiveComposite(
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1003, in execute
    renpy.exports.image(self.imgname, img)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 374, in image
    d = renpy.easy.displayable(d)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/easy.py", line 136, in displayable
    raise Exception("Not a displayable: %r" % (d,))
Exception: Not a displayable: (<Fixed at 111bc23d0>, 0.1)

Darwin-18.0.0-x86_64-i386-64bit
Ren'Py 7.2.2.491
Desruc Dolls 1.0
Mon Jul 29 17:28:20 2019
I can try to make a template soon.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#21 Post by namastaii » Mon Jul 29, 2019 5:53 pm

Sorry it's hard to tell what's going on without the full picture

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#22 Post by ArizaLuca » Tue Jul 30, 2019 9:04 pm

It's alright! Sorry it took so long. I just added a file with the LiveComposite definition and the previous layeredimage definition of the image; copy and paste the LiveComposite into the player definitions file and replace that layeredimage xD Thank you for helping me.
Attachments
playertest.zip
(3.16 MiB) Downloaded 5 times

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#23 Post by namastaii » Tue Jul 30, 2019 9:35 pm

Take the 0.1 off the end

Code: Select all

image player = LiveComposite(

    (740, 1110),
    (0,0), "player/player_base.png",
    (0,0), "player/player_[s_skin].png",
    (0,0), "player/player_[s_hair].png",
    (0,0), "player_eyes_[s_eye].png",
    (0,0), ConditionSwitch(
        "pbrow == 'quirk'", "player/player_eyebrows_quirked.png",
        "pbrow == 'raised'", "player/player_eyebrows_raised.png",
        "pbrow == 'sad'", "player/player_eyebrows_sad.png",
        "pbrow == 'angry'", "player/player_eyebrows_angry.png",
        "pbrow == 'thoughtful'", "player/player_eyebrows_thoughtful.png",
        "'True'", "player/player_eyebrows_normal.png",
        ),
    (0,0), ConditionSwitch(
        "pmouth == 'open'", "player/player_mouth_open.png",
        "pmouth == 'opensmile'", "player/player_mouth_opensmile.png",
        "pmouth == 'smile'", "player/player_mouth_smile.png",
        "pmouth == 'teeth'", "player/player_mouth_teeth.png",
        "pmouth == 'toothysmile'", "player/player_mouth_toothysmile.png",
        "'True'", "player/player_mouth_frown.png",
        ),
    (0,0), ConditionSwitch(
        "pshadow == 'full'", "player/player_shadow.png",
        "pshadow == 'half'", "player/player_shadow2.png",
        "'True'", "none.png",
        ),
    (0,0), ConditionSwitch(
        "ptears == 'tears'", "player/player_tears.png",
        "'True'", "none.png",
        ),
    (0,0), ConditionSwitch(
        "psweatdrop == 'sweatdrop'", "player/player_sweatdrop.png",
        "'True'", "none.png",
        )
    )
also there is an error with your playerside code. Not sure why and not really used to using livecrop or anything but changing it to im.FactorScale seemed to work? you'd have to adjust the numbers accordingly. I haven't messed with it as I'm assuming you haven't gone that far and haven't used the side image yet

Code: Select all

image side playerside = im.FactorScale("player", .95, .95)

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#24 Post by ArizaLuca » Tue Jul 30, 2019 9:41 pm

I got rid of it and this popped up.

Code: Select all

I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
SyntaxError: non-keyword arg after keyword arg (player definitions.rpy, line 1109)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/bootstrap.py", line 313, in bootstrap
    renpy.main.main()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/main.py", line 465, in main
    renpy.game.script.analyze()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/script.py", line 905, in analyze
    i.analyze()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1007, in analyze
    self.atl.mark_constant()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 692, in mark_constant
    i.mark_constant()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 976, in mark_constant
    constant = min(constant, is_constant_expr(expr))
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/pyanalysis.py", line 530, in is_constant_expr
    node, literal = ccache.ast_eval_literal(expr)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/pyanalysis.py", line 684, in ast_eval_literal
    expr = py_compile(expr, 'eval', ast_node=True)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/python.py", line 690, in py_compile
    raise e
SyntaxError: non-keyword arg after keyword arg (player definitions.rpy, line 1109)

Darwin-18.0.0-x86_64-i386-64bit
Ren'Py 7.2.2.491
Desruc Dolls 1.0
Tue Jul 30 21:40:42 2019

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#25 Post by namastaii » Tue Jul 30, 2019 9:42 pm

That's the error I was getting for the playerside thing that I fixed at the bottom

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#26 Post by ArizaLuca » Wed Jul 31, 2019 8:12 pm

Ah, okay-- that got rid of the arg issue (argh I'm a pirate xD), but when I fixed a different issue this popped up:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 119, in script
    with dissolve
Exception: In DynamicImage u'player/player_[s_skin].png': Could not find substitution 's_skin'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 119, in script
    with dissolve
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1375, in execute
    renpy.exports.with_statement(trans, paired)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 1578, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2240, in do_with
    clear=clear)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2690, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 3074, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 534, in visit_all
    d.visit_all(callback, seen)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 524, in visit_all
    for d in self.visit():
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 730, in visit
    self.find_target()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 626, in find_target
    raise Exception("In DynamicImage %r: Could not find substitution '%s'." % (self.name, unicode(ke.args[0])))
Exception: In DynamicImage u'player/player_[s_skin].png': Could not find substitution 's_skin'.

Darwin-18.0.0-x86_64-i386-64bit
Ren'Py 7.2.2.491
Desruc Dolls 1.0
Wed Jul 31 20:11:32 2019
My files are named like they are in the example game; do I need to change anything?

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#27 Post by namastaii » Wed Jul 31, 2019 8:52 pm

What "issue" did you fix?

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#28 Post by ArizaLuca » Thu Aug 01, 2019 8:41 pm

Mostly it was a small issue where the dressup game wouldn't jump properly so that was my fault-- I don't think it really had to do with the image; sorry that was confusing xD

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Customizable Sprite with Blinking?

#29 Post by ArizaLuca » Fri Aug 02, 2019 11:18 am

My files are named like:
Screen Shot 2019-08-02 at 11.17.29 AM.png
Screen Shot 2019-08-02 at 11.17.29 AM.png (11.49 KiB) Viewed 480 times
(the files for the hair)

Should the code be adjusted if that's the file name?

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Customizable Sprite with Blinking?

#30 Post by namastaii » Fri Aug 02, 2019 12:12 pm

Yes it should haha
the code is trying to find "player_1.png" Instead of "player_hair_1.png"
so change player/player_[s_hair].png to:

Code: Select all

player/player_hair_[s_hair].png
s_hair is being converted into a number (1, 2, 3, etc)

also you can't have your skin color files as "light", "tan" if you're assigning numbers or it won't find those files so you need to change player_skin_light to player_skin_1

Post Reply

Who is online

Users browsing this forum: _ticlock_