Class methods not working consistently.

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
Thundy
Regular
Posts: 88
Joined: Tue Dec 05, 2017 9:08 am
Contact:

Class methods not working consistently.

#1 Post by Thundy »

Hey folks. So this is an odd one.

I have the following class:

Code: Select all

 class DIALOGUE(object):
            def __init__(self, isActive, startTime, endTime, day, menuText, location, participant, func, recurring, recurred, canChat, loadd):
                self.isActive = isActive
                self.startTime = startTime
                self.endTime = endTime
                self.menuText = menuText
                self.day = day
                self.location = location
                self.participant = participant
                self.func = func
                self.recurring = recurring
                self.recurred = recurred
                self.canChat = canChat
                self.loadd = loadd

            def setDay(self, day):
                self.day = totaldays + day
            def Activate(self):
                self.isActive = True
            def deActivate(self):
                self.canChat = False
                self.isActive = False
for some reason when i call $DialogueName.Activate() it doesn't always appear to work. Does anyone have any experience of anything similar and preferably a workaround?

Thundy
Regular
Posts: 88
Joined: Tue Dec 05, 2017 9:08 am
Contact:

Re: Class methods not working consistently.

#2 Post by Thundy »

I should clarify. In the game at some point the .Activate() method is called. however is doesn't "Stick" and the dialogue doesnt appear however when I manually call the method in the console it does work. Its a bit of a head scratcher

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], GealachArts, Google [Bot]