Page 1 of 2

bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Sun Mar 02, 2008 3:33 pm
by D'Lanor
I cannot get the 3d sound to work anymore.

My 1.2.1 alcscript flags looked like this:

Code: Select all
    flags: 3d|local


For 1.3.0 I changed it according to the new tutorial:

Code: Select all
    flags:
      - is3dsound
      - localonly


The sound however is not 3d. I was unable to test the local sound obviously, but it didn't show up in the logfile either.

Re: 1.3.0 and 3d sound

PostPosted: Mon Mar 03, 2008 3:29 pm
by D'Lanor
My 3d sound suddenly started working again after I deleted the pyc files in the scripts folder.

Edit: and now it is non 3d again at the next export. This is driving me nuts.

Re: Bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Tue Mar 04, 2008 6:55 am
by D'Lanor
I think I fixed the flags problem in the alc_SndClasses.py source file. Can the developers evaluate this?

I noticed that in 1.2.1 the flags were set in self.fProperties:

Code: Select all
        flags = FindInDict(objscript,"sound.flags", "")
        flags = flags.replace(" ","")
        f = flags.split('|')
        for prop in f:
            if(prop == "3d"):
                self.fProperties |= plSound.Properties["kPropIs3DSound"]
            if(prop == "loop"):
                self.fProperties |= plSound.Properties["kPropLooping"]
            if(prop == "start"):
                self.fProperties |= plSound.Properties["kPropAutoStart"]
            if(prop == "local"):
                self.fProperties |= plSound.Properties["kPropLocalOnly"]


1.3.0 sets them in self.fFlags like this:

Code: Select all
        flags = FindInDict(objscript,"sound.flags",[])
        if type(flags) == list:
            self.fFlags = 0 # reset
            for flag in flags:
                if flag.lower() in plWin32Sound.scriptProps:
                    idx =  plWin32Sound.scriptProps[flag.lower()]
                    self.fFlags |= idx


self.fProperties is no longer set anywhere after being initialized with a default value.

So I changed self.fFlags back to self.fProperties and everything is ok now. :)

Code: Select all
        flags = FindInDict(objscript,"sound.flags",[])
        if type(flags) == list:
            self.fProperties = 0 # reset
            for flag in flags:
                if flag.lower() in plWin32Sound.scriptProps:
                    idx =  plWin32Sound.scriptProps[flag.lower()]
                    self.fProperties |= idx


Not sure why I thought it was working briefly once before (see previous post). Perhaps I mixed up my plugin versions and accidently loaded 1.2.1. Anyway, it works for me now at every export.

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Tue Mar 04, 2008 8:56 am
by Paradox
o.o

Why did any of my sounds work? I should have noticed a coding error like that long before a release :x

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Tue Mar 04, 2008 9:08 am
by D'Lanor
The sounds worked ok. They just weren't 3d (which can be checked by rotating your avatar). There were no export errors and nothing even shows up differently in the age logfile.

Edit: I uploaded my proposed fix to the contrib section of the SVN. I expected a password protection, but write access seems to be public. :o

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Tue Mar 04, 2008 10:03 am
by Robert The Rebuilder
D'Lanor wrote:I uploaded my proposed fix to the contrib section of the SVN. I expected a password protection, but write access seems to be public. :o


Correct me if I'm wrong, Trylon, but I believe that's the point of the contrib folder: anyone can contribute to the plugin. The contents are reviewed, then eventually incorporated into the trunk.

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Tue Mar 04, 2008 12:46 pm
by Nadnerb
Robert The Rebuilder wrote:
D'Lanor wrote:I uploaded my proposed fix to the contrib section of the SVN. I expected a password protection, but write access seems to be public. :o


Correct me if I'm wrong, Trylon, but I believe that's the point of the contrib folder: anyone can contribute to the plugin. The contents are reviewed, then eventually incorporated into the trunk.

This is correct. Also, D'lanor, your fix has been reviewed and merged with the trunk. Thanks. 8-)

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Sun Mar 09, 2008 11:39 am
by boblishman
So... has this fix been added to the 1.3.0 download and "latest.zip" too (HERE ... or are those still "broken" ... ?

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Sun Mar 09, 2008 12:49 pm
by andylegate
I think (and I do stress that word, think) that it is in the latest. The post by Nadnerb seems to indicate that the fix was reviewed and added to the plugin you would download. I think.

Re: bug: 1.3.0 and 3d sound (incl. fix)

PostPosted: Sun Mar 09, 2008 12:54 pm
by boblishman
andylegate wrote:I think (and I do stress that word, think) that it is in the latest. The post by Nadnerb seems to indicate that the fix was reviewed and added to the plugin you would download. I think.


well... it says it was added to the svn ... not the zip file ... sure, I can go and get it from the trunk, I was just hoping that for less experienced writers that it would have been added to the zips