How to replace the "rollback" function with your own.

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
User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

How to replace the "rollback" function with your own.

#1 Post by ISAWHIM »

I need to figure-out a way to replace the rollback function with my own function.

I would just hijack the keys, but I am unsure if the keys also do other things, when not in "PLAYING" mode. (When playing the game/novel. EG, scrolling or item navigation.)

If they don't control anything-else, then I can hijack them.

So... How do I hijack them, if it is safe to do so, or how do I replace renpy.rollback with my own function.

P.S. I am not looking to "customize the rollback function", it isn't working correctly for me, so making it do something-else wrong, is not my desire. I don't want anything it is doing, at all.

My needs are simple... per rollback-state.
Scene, Stats, Event, Location, Time... is all I need recorded. I just don't know how to make MY version of a rollback, trigger when they try to rollback and also rollforward.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: How to replace the "rollback" function with your own.

#2 Post by xela »

You can overload the function or get the keybinding to do something else but what you want may not be possible. You can't just have a shown screen setting the variables that player can use at his/her leisure whenever they please and expect that to participate in Rollback.

Rollback is setup to work with fixed points. Saving the game saves the entire state. I am not sure there is a workaround for the issues you describe in other posts, I just disable Rollback all together in complex games...

You can do both of the things you suggest, but a function that does what you describe may not be possible or way too complicated.
Like what we're doing? Support us at:
Image

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: How to replace the "rollback" function with your own.

#3 Post by ISAWHIM »

I will be replacing the save system too, at some point.

I essentially want the current rollback to do "Nothing", then call my code instead.

I am not seeing mouse-wheel do much-else in my game, so I may just hijack that and have a button-click NEXT/BACK too.

Honestly, I think it is a combination of having the game in a loop, in addition to my use of values that just don't play nice with rollback. I am seeing all sorts of hacks to get things to work, potentially... But it is a lot of excess coding that kind-of kills the simplicity I just programmed in the first place.

Sheep = apple = lamb = frog... Just to get it to remember a value, both ways... Not just one way, then forget it. :P

Much easier to remember simple selections... and
Choice1:selectedA
Choice2:selectedC
advanced:dialogue(16-lines)

That's the whole damn game, in a nut-shell. Just needs to fast-forward to the selected progression point. Takes like a micro-second, when it isn't displaying stuff or pausing for clicks.

When it comes to "save games", I will be using codes, because they don't fail to load, when code changes between point-a to point-z. All that matters is the progression-level and pertinent values. (For my game.) The rest is just bloat. Honestly impossible to even view save-game status or data, makes them kind-of useless to me. They will all look the same, except dates.

I'd rather have full control of critical stuff like that. Not a "who knows what it actually saves", and "what the heck was this save point", confusion. It works great for linear stories. This is a fully dynamic and kinetic game, with a story.

That is entirely MY FAULT... :P

I am trying to stuff my feet into plungers, so I can run a marathon over broken glass, up-hill, in the snow, backwards, while not spilling my coffee, which is held inside a thimble.

I just need a way to do it. :P

Post Reply

Who is online

Users browsing this forum: Bing [Bot]