Code: Select all
class DIALOGUE(object):
def __init__(self, place, who, sTime, eTime, isActive, mood, menuText, func, repeatable, num):
self.place = place
self.who = who
self.sTime = sTime
self.eTime = eTime
self.isActive = isActive
self.mood = mood
self.menuText = menuText
self.func = func
self.repeatable = repeatable
self.num = num
place = where the dialogue takes place
who = the character with whom the dialogue is
sTime = The time at which the dialogue becomes available
eTime = The time at which the dialogue becomes unavailable
isActive = master on / off switch
mood = not currently used
MenuText = The text which will appear on the choices screen to begin the dialogue
func = The label to call to start the dialogue
repeatable = Is the dialogue repeatable or a one off
num = How many times has the dialogue occured
Essentially each time the came loops it carries out a check to see if the dialogue is available, and if so, the dialogue is added to a menu so the player can start it.
the checks are as follows
Is it the right time of day for the Dialogue?
Code: Select all
@property
def ACheck(self):
global Date
if self.sTime == "none":
return True
else:
tHour,tMin = self.sTime.split(":")
if tHour >= Date.Hour and tMin <= Date.Minute:
tHour,tMin = self.eTime.split(":")
if tHour < Date.Hour and tMin < Date.Minute:
return True
return False
Code: Select all
@property
def BCheck(self):
global Act
if self.who == Act:
return True
else:
return False
Code: Select all
@property
def CCheck(self):
global Location
if self.place == Location:
return True
if self.place == "none":
return True
return False
Code: Select all
@property
def DCheck(self):
if self.repeatable:
return True
else:
if self.num > 0:
return False
else:
return True
Code: Select all
@property
def CanChat(self):
if self.isActive and self.ACheck and self.BCheck and self.CCheck and self.DCheck:
return True
else:
return False
Code: Select all
def Do(self):
self.num += 1
renpy.call(self.func)
Now for my problem
For some reason the CanChat property doesn't seem to be updating. On a dialogue where repeatable = False DCheck still returns True even though self.num is greater than 0. Anyone spot any reason why this might be happening?