Live 2D model that defined differently share the same update_function

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.
Post Reply
Message
Author
sine12
Newbie
Posts: 7
Joined: Sun Apr 08, 2018 2:03 pm
Contact:

Live 2D model that defined differently share the same update_function

#1 Post by sine12 »

Hi, i am working on a Live 2D project, I defined the live 2d model as recommend in the document:https://www.renpy.org/doc/html/live2d.html

Code: Select all

image yvonne far = Live2D("images/sprite/Yvonne", top=-150,base=1,default_fade=0.5,loop=True, seamless=True,update_function=yvonne_sprite)
image yvonne close = Live2D("images/sprite/Yvonne",base=.6,loop=False, default_fade=0.0,update_function=None)

And when I call "yvonne close", I find out the image still using the update_function in "yvonne far", and it also fade back to the default expression for the model. (but it does not loop and the sprite is bigger)

Some of the variables displayed for "close" are using the one passed to it (base and loop) but some are till using the "far" one (default_fade and update_function).

This is why I am so confused. Is this an expected behavior? Or I did something wrong here?

Thank you very much for reading my question.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Live 2D model that defined differently share the same update_function

#2 Post by PyTom »

Not, but there isn't a great fix for this. Live2D objects that share the same path share everything. You'll need two copies to do this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

sine12
Newbie
Posts: 7
Joined: Sun Apr 08, 2018 2:03 pm
Contact:

Re: Live 2D model that defined differently share the same update_function

#3 Post by sine12 »

PyTom wrote: Wed Jan 31, 2024 1:07 am Not, but there isn't a great fix for this. Live2D objects that share the same path share everything. You'll need two copies to do this.
Got it! Thanks for replying!

Post Reply

Who is online

Users browsing this forum: No registered users