[Solved] Using a Call Statement Without Advancing The Script
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.
- haydengames3
- Newbie
- Posts: 13
- Joined: Wed Mar 17, 2021 9:56 am
- Contact:
[Solved] Using a Call Statement Without Advancing The Script
I'm having an issue where I want to switch an image out temporary through a hotspot action in a imagemap screen. I tried calling another screen to achieve this, but had layering issues with the textbox. So I tried calling the new image as a label instead, which works fine expect every time I use call(), it advances the script by one line once the call statement completes.
So here is my question, is there anyway of stopping call() from advancing the script? If not, would I be able to create my own function that could, and if so, where would I find the original script for it?
So here is my question, is there anyway of stopping call() from advancing the script? If not, would I be able to create my own function that could, and if so, where would I find the original script for it?
Last edited by haydengames3 on Tue Mar 23, 2021 4:36 pm, edited 1 time in total.
Re: [Question] Using a Call Statement Without Advancing The Script
Hi, haydengames3,
You should provide a piece of code to explain what exactly you are trying to do.
I am not sure if I understood you right, but if you call a screen and you want to do an action and stay at this script line you can:
1) use an action that won't return from the screen For example:
PS: You can also use Function action and return None to avoid returning from the screen.
2) You can also call lopped label with condition to return from label. For example:
You should provide a piece of code to explain what exactly you are trying to do.
I am not sure if I understood you right, but if you call a screen and you want to do an action and stay at this script line you can:
1) use an action that won't return from the screen For example:
Code: Select all
screen test():
default img = False
if img:
add "image_1.png" # image that should be switched
else:
add "image_2.png" # switch to this image
imagemap:
auto ...
hotspot (100, 100, 100, 100) action ToggleScreenVariable("img")
label start:
# show image 1 or 2 with condition
call screen test()
2) You can also call lopped label with condition to return from label. For example:
Code: Select all
label test:
call screen imagemap_screen()
if _return == "exit":
return
jump test
label start:
call test
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: [Question] Using a Call Statement Without Advancing The Script
Call() supports a from_current attribute which when set to True should return to the current rather than next statement.
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- haydengames3
- Newbie
- Posts: 13
- Joined: Wed Mar 17, 2021 9:56 am
- Contact:
Re: [Question] Using a Call Statement Without Advancing The Script
That works perfectly, thank you.
Who is online
Users browsing this forum: No registered users