Ren'Py Restarting Dialogue

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
Do you think checking something 20 times per second that you may not even have a use for,
is a good way of doing things?
You know that what can be added into a list, can also be removed from this list, right ?


What do I refuse to quit?
I researched every option, even stated results up there.
No, you researched every option that follow your way, it's different.

Would you have effectively researched every options that, for your menu by example, you would have found by yourself not only that you can use config.label_overrides to limit the number of entries proceeded by config.say_menu_text_filter, but also that, when you've a sequence of identical choice, well, you just need a sequence of alternative choices...
Perhaps that there's still some flaw with this method, but this approach would have solved most of the issue you're facing.


And now I end up nowhere.
Meaning I quit everything.
Because nothing works to the fullest.
And I don't know how to progress any further.
But still want to follow that way...
In almost every single one of your post, you're saying that it don't works. But when have you considered that perhaps I'm right, and it's absolutely not how you should do it ?
I'm an arrogant grumpy prick, but I rarely talk without good reason.


Are you not aware?
Exception is direct way to change things.
Because everything mentioned up end up doing Exception anyway.
There's a gas tank in all cars, because pouring the gas directly into the motor is something totally stupid... Yet, it's the direct way to make the said motor works...


I'm talking about game_menu. When you open it it sets suppress_overlay to True, [...]
I answered to your question:
I mean how to:
1. Show/Hide overlays.
After, if it's not what you wanted to ask, it's not my responsibility...


and when I raise Exception there is nothing that changes it back.
Could it be the reason why I said that you shouldn't raise the exception by yourself, and rely on the interface functions that Ren'Py offer you ?


I just need to reverse changes from opening game_menu.
Or to learn how to properly rollback game_menu.
The thousands of games and mods doing what you try to do needed neither, and it's the same for you. What you need is to understand that this is not how one do this, period.
You pass your time saying that you go nowhere, and still continue to advance on this direction. But yeah, you aren't at all stubborn and just want to learn how to do it correctly... but only if it's in your way.


So I will later work on on my own invoke_in_new_context function,
that will meet my demands.
Because it is surprising to me that overlays aren't disabled in it.
And why should they be ? The function is made to proceed code into a new context, not to proceed code on a clean screen...


No matter what I do, it will have bigger flaws, because I'm not experienced enough.
It's not a question of experience.
Instead of looking at what Ren'Py effectively offer you, and trying to see how you can use it to reach your goal, you looked at the core source, and tried to mimic it. It's not, and it will never be, the way to do ; this whatever the subject and the goal.


I'm not developing engine I'm using it.
Then use it instead of trying to reproduce its behavior.
 
  • Like
Reactions: ZLZK

ZLZK

Member
Modder
Jul 2, 2017
276
626
Would you have effectively researched every options that, for your menu by example, you would have found by yourself not only that you can use config.label_overrides to limit the number of entries proceeded by config.say_menu_text_filter, but also that, when you've a sequence of identical choice, well, you just need a sequence of alternative choices...
I don't care about this method for my WT Mod, because my method can be used without text.
You think I would copy all choices in the game to modify them?
Heck no, why would I bother with copying text when I just want to add something to it?
That's a pros of my method.
I use "{t}" as a text and then my method replace it with actual choice text.
That's whole idea, to add color to choice, right?
Did you even check my WT Mod that I am working on right now?
if you can provide method that can work with it I could maybe use that method.
But right now my method is very convenient, it's like it was made for this.
That's right I did it for this sole purpose and it's doing great.

It's not a question of experience.
Instead of looking at what Ren'Py effectively offer you, and trying to see how you can use it to reach your goal, you looked at the core source, and tried to mimic it. It's not, and it will never be, the way to do ; this whatever the subject and the goal.
That's the only thing I know, learning by source.
And look at this I succeed.
My Rollback solution is working and now I have put rest of what I have learned into it.
Ta dam working code:
You don't have permission to view the spoiler content. Log in or register now.
And this is working because like a said,
game_menu itself quits by Rollback.
So if I Rollback or game_menu, same thing happen.
And after Rollback we are in main context.
And main context is even updated,
I guess it is ours RestartTopContext exception called from Rollback itself.

So my solutions was working all along, I was just miss confused because overlays were enabled,
and I am aware now, that was because we were in main context and not game_menu context.
So all it took was to disable overlays, voilà.

EDIT: Actually you don't even need to disable overlays, it works regardless now.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
Did you even check my WT Mod that I am working on right now?
You even answered to me in its thread. And guess what ? Yeah, you discarded everything I said... Well, see you when you'll discover that game authors can do really messy things.


And look at this I succeed.
Congratulation, you invented polyhedral wheel.

You created a new exception and a new screen action, having a code totally dependent to future changes in Ren'Py's core. All this to what exactly ? I hope it's not just to do what I hinted you, it would be ridiculous:
Python:
init python:
    class InMainContext( object ):
        def __init__( self, fnct ):
            self.__fnct = fnct

        def __call__( self ):
            if renpy.context_nesting_level(): return
            self.__fnct()
            if self in config.periodic_callbacks: config.periodic_callbacks.remove( self )

screen whatever:
    on "hide" action AddToSet( config.periodic_callbacks, InMainContext( whatever ) )
    [...]
 

ZLZK

Member
Modder
Jul 2, 2017
276
626
You created a new exception and a new screen action, having a code totally dependent to future changes in Ren'Py's core. All this to what exactly ? I hope it's not just to do what I hinted you, it would be ridiculous:
My screen and Exception are inside call_in_new_context,
they are part of my function call.
You can remove them, they do nothing for this purpose.
They are there to easier your life.
I mean in some cases when you click Right Mouse button or Escape key,
it doesn't work in that new context.
And that's where my screen and exception come,
to ensure that you may quit my function through those keys.
If Ren'Py quits through exceptions why can't I?

My code depends only on Rollback, you think it will get changed?
It can only be extended by adding new kwargs, so it's safe.

And anyway you do code for certain games.
You don't do it for every game just the one you are modding.