Page 1 of 1

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

Posted: Thu Nov 16, 2017 10:29 am
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.

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

Posted: Thu Nov 16, 2017 11:45 am
by Remix
Did you really have init.python written with a period rather than space?

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

Posted: Thu Nov 16, 2017 11:51 am
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.

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

Posted: Thu Nov 16, 2017 12:31 pm
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).

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

Posted: Thu Nov 16, 2017 1:34 pm
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 :)