Key shortcut jumps to a label
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.
Key shortcut jumps to a label
I already use the curried_call_in_new_context (or something very close) but it does what it says : "call". Is there anyway to have the same thing do a "jump" ? I'd like to keep the possibility of rolling back and other things that the new context won't make possible.
The python equivalent of the normal jump command is renpy.jump('label'), but there is no curried version of it, which is what you'd need to add to the keymap.
I took a few minutes to check how adding a curried version to the renpy source would work, but I'm not sure how to add it in just a game script file.
The result was that you could jump to a label using just a key, and then rollback to before the jump, but rolling forward after that would just go to the point where you hit the jump key.
PyTom will no doubt know exactly why it behaves like that, and whether the key-based jump could be saved in the rollback, but I don't.
I took a few minutes to check how adding a curried version to the renpy source would work, but I'm not sure how to add it in just a game script file.
The result was that you could jump to a label using just a key, and then rollback to before the jump, but rolling forward after that would just go to the point where you hit the jump key.
PyTom will no doubt know exactly why it behaves like that, and whether the key-based jump could be saved in the rollback, but I don't.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
Actually, there is a curried version of renpy.jump, and that's ui.jumps. Admittedly, that's one of the more non-orthagonal bits of Ren'Py. The jump will be saved in the rollback, but not in the roll-forward, since nothing is saved in the roll-forward.
One interesting thing is that roll-forward and roll-back are two different things. Roll-back is very complicated, while roll-forward simply skips the current statement iff it has already been encountered.
What are we trying to accomplish here? In general, I'd suspect using the keyboard isn't a good idea, as several keys are already bound to Ren'Py specific functionality, and in general the user should be given a choice of input device. (Mouse, Keyboard, or Joystick.)
One interesting thing is that roll-forward and roll-back are two different things. Roll-back is very complicated, while roll-forward simply skips the current statement iff it has already been encountered.
What are we trying to accomplish here? In general, I'd suspect using the keyboard isn't a good idea, as several keys are already bound to Ren'Py specific functionality, and in general the user should be given a choice of input device. (Mouse, Keyboard, or Joystick.)
No worries, this is only for debugging purpose, ie. jumping to a menu of scenes, or at least to a central point in my game. So far I've curried_called a function that does the jump... but as to be expected, roll back doesn't work properly anymore
. Minor annoyance but I was scared it might imply other problems...
*just tried ui.jumps*... seems perfect ^^
*just tried ui.jumps*... seems perfect ^^
Who is online
Users browsing this forum: _ticlock_
