Sound Flags

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 12:03 pm

Okay, on your ALCscript, you have something added that I don't on the first part (that I assume is what makes the object clickable).

Have you tried commenting that out? it's the two lines above Logic: that I'm talking about. I'm fixing to add that to mine and see what happens. If I don't get my hotspot, then that's the problem.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Thu Mar 27, 2008 12:11 pm

What is displayed in the Python logfile depends on the debugging messages the programmer put there. I tend to do a lot of debugging because I want to track as much as I can.

Since the logfile shows you the ID it must be looking in the file.

The lines above the logic script are for cutting down the overhead. I put that script on every object that does not need to "shy away" from the camera, since camera avoidance is now the default behavior (bad decision if you ask me).
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 12:16 pm

Yah, it didn't interfere with the hot spot.

However, I got my hotspot to go away.....and you're going to hate me for asking this as it's what we ask the newbies all the time:

Do you have Bounds turned on for you object? If you turn bounds off, the object looses it's hotspot. I just tried it with my button, and bingo, no more hot spot. Turned bounds back on, and hotspot came back.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Thu Mar 27, 2008 12:21 pm

Checking.... yep, bounds are on. Actor on as well (which is another way to make the hotspot go).
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 12:27 pm

Er........Actor is NOT on for my button....

Is a clickable suppose to be an actor?

And on my problem, your right! :shock:

I opened up my python file, and what is happening is that for the OnNotify, it looks at the ID and they are not matching, One is 1, the other is -1, so none of the stuff in the python file is being processed beyond that point.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Thu Mar 27, 2008 12:30 pm

That should be easy to fix. Just make your Python script match the ID and you are set.

Edit: Actor off did not make a difference.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 12:48 pm

And where in the python file do I do that?

Here's the first part of the file, it's Trylon's for moving his gate, modified by me to move a door.
oh, and BTW- I changed my button to Actor.....and lost my hotspot again. :shrugging: I don't know. The only things I have in Zephyr that are actors is the kickables.
Code: Select all
# emacs-mode: -*- python-*-
from Plasma import *
from PlasmaTypes import *
from PlasmaKITypes import *
from PlasmaVaultConstants import *
from PlasmaNetConstants import *
import xLocalization
import string
import time

DoorStateOpen = 1
DoorStateClosing = 2
DoorStateClosed = 3
DoorStateOpening = 4

actClickableObject = ptAttribActivator(1, 'Act: Clickable Object')
ObjectMsg = ptAttribString(2, 'Object String')

class zcdoorclick(ptModifier):
    __module__ = __name__

    def __init__(self):
        ptModifier.__init__(self)
        self.id = 51110001
        self.version = 1
        self.AgeName = None
        self.doorcollider = None
        self.activedoor = None
        self.StartTime = 0
        self.DoorState = DoorStateClosed
        self.XWidth = 4.5
        self.XClosedPos = 353.072
        self.XOpenPos = self.XClosedPos + self.XWidth
        self.DoorTimerInterval = .03
        self.DoorOpenTimerId = 1
        self.DoorCloseTimerId = 2
        self.DoorMoveDuration = 5.0

    def OnFirstUpdate(self):
        self.AgeName = PtGetAgeName()
       
    def OnServerInitComplete(self):
        # Obtain the gate collision object
        self.doorcollider = PtFindSceneobject("doorcollider",self.AgeName)
        if self.doorcollider == None:
            print 'OnServerInitComplete - could not find doorcollider!'
        # Obtain the visible gate object
        self.activedoor = PtFindSceneobject("activedoor",self.AgeName)
        if self.activedoor != None:
            # Turn off its physics, since we will be moving it
            self.activedoor.physics.suppress(true)
        else:
            print 'OnServerInitComplete - could not find activedoor!'


    def OnNotify(self, state, id, events):
        print 'OnNotfiy: id=',
        print id
        print 'ID of Clickable logicmod:',actClickableObject.id
        if (id == actClickableObject.id):
            print "Message:",ObjectMsg
            print "Value of message: '%s'"%(ObjectMsg.value)
            # Check for the button press
            if ObjectMsg.value == "doorbutton" and self.activedoor != None:
                print "Processing activedoor"
                # Close the gate, if it is open
                if self.DoorState == DoorStateOpen:
                    self.StartTime = time.clock()
                    self.DoorState = DoorStateClosing
                    # Enable the gate collider, to prevent access during the close
                    self.doorcollider.physics.suppress(false)
                    # Register a timer callback for closing the gate
                    PtAtTimeCallback(self.key,self.DoorTimerInterval,self.DoorCloseTimerId)
                # Open the gate, if it is closed
                elif self.DoorState == DoorStateClosed:
                    self.StartTime = time.clock()
                    self.DoorState = DoorStateOpening
                    # Register a timer callback for opening the gate
                    PtAtTimeCallback(self.key,self.DoorTimerInterval,self.DoorOpenTimerId)
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 12:56 pm

Hey, your logic region.

RgnCloud

Do you have anything set on it? Mine is just a region. nothing else.

I'm running out of ideas on your problem.

Only other things I can think of, are things that should be okay, as you already had it working with quickscripts, right?
And those things are: scaling of the region, making sure the clickable object is all the way inside the region.......I'm sure you've got those all right.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Thu Mar 27, 2008 1:01 pm

Hmm, what is happening is that it catches the ID of the sound responder instead of the clickable object. You could make it react on ID -1. Not the way it should work but it will do the trick.

Quick hack:

Change if (id == actClickableObject.id): to if (id == -1):
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Sound Flags

Postby D'Lanor » Thu Mar 27, 2008 1:08 pm

andylegate wrote:Hey, your logic region.

RgnCloud

Do you have anything set on it? Mine is just a region. nothing else.

I'm running out of ideas on your problem.

Only other things I can think of, are things that should be okay, as you already had it working with quickscripts, right?
And those things are: scaling of the region, making sure the clickable object is all the way inside the region.......I'm sure you've got those all right.


All my regions are actors too. I think that was the way PyPRP 0.5 added them. Not sure though. This is a very old age that I re-imported with PyPRP 0.5 and then converted to the GoW PyPRP. The older clickables even have gotten the pinned: true property through all those conversions.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

PreviousNext

Return to Building

Who is online

Users browsing this forum: Google [Bot] and 5 guests