xAgeSDLBoolRespond confusion (bug?)

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

xAgeSDLBoolRespond confusion (bug?)

Postby tachzusamm » Thu Jul 25, 2013 9:40 am

xAgeSDLBoolRespond class definition:

Code: Select all
class xAgeSDLBoolRespond(ptResponder):
    """Runs a given responder based on the value of an SDL boolean"""

    def __init__(self):
        ptResponder.__init__(self)
[..]


Now, D'Lanor mentioned that ptResponder when it initializes sets self.sceneobject to None.
D'Lanor wrote:ptResponder is derived from ptModifier. The only difference is that ptResponder when it initializes sets self.sceneobject to None. This is only relevant for the BuiltIn prp file. Anywhere else pythonfile mods are attached to scene objects. So in effect it makes no difference which one you use.

( viewtopic.php?p=48943#p48943 )

But self.sceneobject is used in the code, for example here:
Code: Select all
        ageSDL = PtGetAgeSDL()
        if not ageSDL:
            PtDebugPrint("xAgeSDLBoolRespond._Initialize():\tAgeSDL is None. Initing %s to its default" % self.sceneobject.getName())
            self._Execute(defaultValue.value, initFastFwd.value)
            return


So, wouldn't this cause PtDebugPrint to fail writing the sceneobject name?

Not sure if this is a bug and the class definition should read
Code: Select all
class xAgeSDLBoolRespond(ptModifier):
    """Runs a given responder based on the value of an SDL boolean"""

    def __init__(self):
        ptModifier.__init__(self)
[..]


or am I getting something wrong here?
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: xAgeSDLBoolRespond confusion (bug?)

Postby Tsar Hoikas » Thu Jul 25, 2013 12:11 pm

self.sceneobject is set to the plSceneObject target of any ptResponder by the C++ code. It's the same way the ptAttributes get their values ;)

I used to be savvy on the exact difference between the two base classes, but I have forgotten. When I have some time, I'll rifle through the engine code and try to figure it out :geek:
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia


Return to Plasma Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron