i got a screen and i want to make it so after shown it runs its action just the first time the screen is clicked.
context:
im using screens also like my character sprites, the final result im trying to achieve is a "Rick and Morty a way back home" interactive characters ui.
basically you click on characters and then a text menu is displayed moving on to conversations on each choice.
well i can do all this but the screen stays there, and you can click it again resetting the conversation and thats the issue. im not trying to hide the screen, i just want it to be unclickable after the first time, again these are also my character sprites.
the screens move around every time they are reloaded, sometimes they appear on the left, sometimes on the right, on top of that, there are screen sprites variations chosen randomly, thats why i cant switch the screen for the image used on the screen, as it has randomness involved, the screen has to persist.
any idea how to make it so it runs its action just the first time ?
[SOLVED] preventing screens from being clicked after 1st time
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.
[SOLVED] preventing screens from being clicked after 1st time
Last edited by Dr_arell on Mon May 10, 2021 8:23 pm, edited 1 time in total.
Re: preventing screens from being clicked after 1st time
I'm not sure what you are trying to achieve (idk Rick and Morty, I just looked at this video a few seconds). Aren't you just describing a visual novel, aka Ren'Py's core feature ?
If not (sorry), can you provide a demo, and describe what you expect ? (maybe it is in this video, but I didn't see it, so please provide a timestamp)
Anyway, if you want something to happen just once, maybe you can just use a variable and a if condition, and put your one-time processing inside the if ...
If not (sorry), can you provide a demo, and describe what you expect ? (maybe it is in this video, but I didn't see it, so please provide a timestamp)
Anyway, if you want something to happen just once, maybe you can just use a variable and a if condition, and put your one-time processing inside the if ...
- Syrale
- Regular
- Posts: 101
- Joined: Sun Oct 25, 2015 10:28 am
- Completed: Robot Daycare, Deep Sea Valentine, Locke(d)
- Projects: Artificial Selection, Artificial Fashionista, rei_carnation
- Github: kigyo
- itch: kigyo
- Discord: kigyodev
- Contact:
Re: preventing screens from being clicked after 1st time
I think you might be looking for SensitiveIf().
Since your screens already mostly work, you just have to do the following:
For the button actions, instead of
use
Whenever a conversation starts, and you no longer want the sprites to be clickable, set in_conversation to True.
Then, when you want the screens to be clickable again, just set in_conversation to False.
Since your screens already mostly work, you just have to do the following:
For the button actions, instead of
Code: Select all
action WhatYouWantItToDo()
Code: Select all
action [SensitiveIf(not in_conversation), WhatYouWantItToDo()]
Then, when you want the screens to be clickable again, just set in_conversation to False.
Last edited by Syrale on Tue May 11, 2021 3:03 am, edited 1 time in total.
Artificial Selection (ongoing) |Deep Sea Valentine | Robot Daycare (NaNo19)
| Artificial Fashionista (NaNo24)
My Developer Tools: Ren'Py Minimap/Location System | Ren'Py Word Counter+
My Developer Tools: Ren'Py Minimap/Location System | Ren'Py Word Counter+
Re: [SOLVED] preventing screens from being clicked after 1st time
thanks for your help ill try both of your methods and i think what uncoded said makes sense, but i think ill see if i can get what syrale said runing cuz it looks cleaner
respecting for the example uncoded asked, its not shown in that video, or at least on that version of the game, when you click on a character it should display a text menu that yes its very similar to the menu tool renpy gives you, in that version you click on the character and jumps straight to the story/dialogue
you can see what im talking about in this video, at 19:01 https://www.youtube.com/watch?v=YA0-Pf3mupg
respecting for the example uncoded asked, its not shown in that video, or at least on that version of the game, when you click on a character it should display a text menu that yes its very similar to the menu tool renpy gives you, in that version you click on the character and jumps straight to the story/dialogue
you can see what im talking about in this video, at 19:01 https://www.youtube.com/watch?v=YA0-Pf3mupg
Who is online
Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, snotwurm