Trying to add Notifications to my game
Posted: Tue Sep 21, 2021 6:06 pm
Like the title says, I'm trying to add Notifications to my game.
I have an Extras area on my Main Menu and I want to notify my players when they have unlocked bonus content. I also want the notification to show only once.
There are a lot of variables though. Mostly if they have to have seen certain pictures or played other extras.
The problem is if I do it this way on the Extras screen.
The notification loops continuously on the Main Menu when the conditions are met.
I have tried grouping them in one label and call that label at the end of the game or when I know an unlock could occur. With a persisent that turns true after the notification has triggered, like this.
Or this way.
But I then had to create another label that basically checks if the persistent data exist in the first place and if not creates it.
I put that one in my splashscreen label so it runs at the very start of the game.
Is there an easier way of do all this that doesn't rely on so much persistent data?
I have an Extras area on my Main Menu and I want to notify my players when they have unlocked bonus content. I also want the notification to show only once.
There are a lot of variables though. Mostly if they have to have seen certain pictures or played other extras.
The problem is if I do it this way on the Extras screen.
Code: Select all
if persistent.credits_seen:
$ renpy.notify("Inside the Character Studio has been unlocked")
textbutton "Introduction" action Replay("ICSIntro", locked=False)
else:
text "The episode is not unlocked yet."
I have tried grouping them in one label and call that label at the end of the game or when I know an unlock could occur. With a persisent that turns true after the notification has triggered, like this.
Code: Select all
if persistent.credits_seen or persistent.IntroUnlocked == False:
$ renpy.notify("Inside the Character Studio has been unlocked")
$ persistent.IntroUnlocked = True
Code: Select all
if persistent.credits_seen and persistent.IntroUnlocked == False:
$ renpy.notify("Inside the Character Studio has been unlocked")
$ persistent.IntroUnlocked = True
Code: Select all
label PersistentCheck:
if not persistent.IntroUnlocked:
$ persistent.IntroUnlocked = False
Is there an easier way of do all this that doesn't rely on so much persistent data?