Mousewheel up rollback to screens
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.
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.
Mousewheel up rollback to screens
Is it possible to allow players to rollback using mouse-wheel to labels that had only screens without dialogues.
I have seen other games where rolling back carries you from one location to another (and not just to the last dialogue) but couldn't find how they did it.
I have seen other games where rolling back carries you from one location to another (and not just to the last dialogue) but couldn't find how they did it.
Re: Mousewheel up rollback to screens
I have the same question. I'm using a navigation system with jumps to labels via navigation screen (ui.interact() allows "to stay" in a room(label)). So how can I rollback not to the last dialogue, but to previous room.
I was trying to see how others do it. I found in one game in the end of each label this type of code:
Does it mean that the label will not collapse but will wait till "result" will get an action from imagemap? I guess it's rollback friendly approach, but how can I do it with imagebuttons?
I was trying to see how others do it. I found in one game in the end of each label this type of code:
Code: Select all
$ result = renpy.imagemap("kitchen.webp", "kitchen.webp", [
(0, 0, 0, 0, "kitchen.webp")
])
Re: Mousewheel up rollback to screens
I tried
in the label, and before the screen is called, and it seems to work.
Code: Select all
$ renpy.checkpoint()
Re: Mousewheel up rollback to screens
Thank you, It' a decent solution and It's working for me but without a rollforward. In documentaion about renpy.checkpoint():
Maybe it's a good enough solution. Seems noone can help us
This is not working for some reason (not a stable rollback, no rollforward and sometimes calling an error "roll_forward is not defined"). Maybe the reason is that the game is interact with the user. Currently I'm using this structure:Most Ren'Py statements automatically support rollback and roll forward. If you call ui.interact() directly, you'll need to add support for rollback and roll-forward yourself. This can be done using the following structure:It's important that your game does not interact with the user after renpy.checkpoint has been called. (If you do, the user may not be able to rollback.)Code: Select all
# This is None if we're not rolling back, or else the value that was # passed to checkpoint last time if we're rolling forward. roll_forward = renpy.roll_forward_info() # Set up the screen here... # Interact with the user. rv = ui.interact(roll_forward=roll_forward) # Store the result of the interaction. renpy.checkpoint(rv)
Code: Select all
$ renpy.checkpoint()
#some scene with it's own screen (imagebutton or imagemap)
#navigation screen
#$ ui.interact()
Re: Mousewheel up rollback to screens
I'm not sure how much this might help, but I have this code for calling the history screen with the mousewheel instead of rollback.
Replacing the code in rollback=[] is what you probably want to perform you own functions. If you want your rollback itself to rollback through locations, instead of say, calling a location screen, then I wouldn't know what to suggest, sorry. Maybe it's a start?
Code: Select all
# Override Keymap
def readback_catcher():
if _game_menu_screen != None:
ui.add(renpy.Keymap(rollback=[Stop("text"), renpy.curried_call_in_new_context("call_subscreen", screen="text_history")]))
else:
pass
config.overlay_functions.append(readback_catcher)
Re: Mousewheel up rollback to screens
Thank you, I'll think about it. Maybe I just overthinking things though. Perfect is the enemy of the good.
Re: Mousewheel up rollback to screens
Ok, if anyone will read this topic, I've found a better way to write the code (it's more simple, clear and let you rollback/rollforward). I'm doing this:
Code: Select all
label factory:
if clock.time_of_day[0]=="noon": # set a scene depending on the daytime
scene factory with fade # show bg
show screen factory_chars # show a screen with a character(s) you want to interact with in the scene (use imagebutton)
elif clock.time_of_day[0]=="evening":
pass # do here the same as above
call screen home_navigation # that's simple :) just _call_ the screen (a row of small pics of rooms in my case) and it stops the script till you jump out the label
return
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot]