[solved] renpy.notify() not working inside called function?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

[solved] renpy.notify() not working inside called function?

#1 Post by Errilhl »

I have something like this (currenly just in testing phase):
functions.rpy:

Code: Select all

init python:
	def statschangeNotify(notifyText):
		renpy.notify(notifyText)
		renpy.pause(5)
And in script.rpy I call that function like this:

Code: Select all

$ statschangeNotify("testmessage")
It pauses as it should, but no notification is shown. Any reason why this doesn't work?

I've also tried just using

Code: Select all

renpy.notify("testmessage")
in the function, to check and see if it didn't like parsing a variable as text, without making any difference.
Last edited by Errilhl on Thu Nov 16, 2017 1:35 pm, edited 2 times in total.
Currently working on: Image

User avatar
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: renpy.notify() not working inside called function?

#2 Post by Remix »

Did you really have init.python written with a period rather than space?
Frameworks & Scriptlets:

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: renpy.notify() not working inside called function?

#3 Post by Errilhl »

Oh, sorry, no, that was me typing it in now (I didn't copy, because there is a bit of redundant comments and stuff) Fixed now. The original problem still exists, of course.
Currently working on: Image

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: renpy.notify() not working inside called function?

#4 Post by RicharDann »

I just tested your code and it seems to work fine, shows the notify screen with textmessage and pauses for 5 seconds (or until I click). So the problem doesn't seem to be in this code. Have you modified your notify screen?Or perhaps are you showing another image or screen above the area where the notify box is supposed to appear? (it's around the upper left corner of the game window).
The most important step is always the next one.

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: renpy.notify() not working inside called function?

#5 Post by Errilhl »

Seems there was an issue with a modification done tot he notify-screen in screens.rpy. Weirdly enough, that modification worked perfectly well when using renpy.notify() directly from screens.rpy, but not when doing it from within a init python: statement in another rpy-file. Oh well. Quirks and stuff. It works now, at least :)
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]