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 » Wed Mar 26, 2008 1:04 pm

putting in a 1 sec delay in the python for the door is a piece of cake, since the way the door moves is based on time anyway.

Okay, I'll give what you suggested a try, I was just looking at doing what you're showing (except my way is not the same, there for more than likely wrong, and would cause the world to end. So we'll do it your way.).

I'll post in a little while how it worked.
"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 » Wed Mar 26, 2008 1:16 pm

I have a Python delay which waits for the avatar animation. It is not perfect because quickscript does not allow setting the seektime. I think that could be another plus of the full alcscript method.
"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 Nadnerb » Wed Mar 26, 2008 1:49 pm

Ok, in that case, you probably want the rest.

The quickscript does the animation like this:
Code: Select all
         actions:
          - type: pythonfile
            tag: DoorOpen
            pythonfile:
               file: <python file name>
               parameters:
                - type: activator
                  ref: logicmod:$DoorOpen
                - type: string
                  value: doorbutton
                - type: behavior
                  ref: oneshotmod:$DoorOpen
          - type: oneshot
            tag: DoorOpen
            oneshot:
                animation: <name of animation>
                seektime: <time in seconds (1.0)>
                remote: <animation target (name of empty where avatar feet will be when animating)>

in the python, you'd need a ptBehavior and use it to activate the animation, then wait for it to finish.

On the other hand, I'd do it like this:
Code: Select all
            actions:
             - type: responder
               ref: $SoundResp
             - type: pythonfile
               ref: $DoorOpen
             - type: oneshot
               ref: $DoorOpen
        actions:
          - type: pythonfile
            tag: DoorOpen
            pythonfile:
               file: <python file name>
               parameters:
                - type: activator
                  ref: logicmod:$DoorOpen
                - type: string
                  value: doorbutton
          - type: oneshot
            tag: DoorOpen
            oneshot:
                animation: <name of animation>
                seektime: 1.0
                remote: <animation target (name of empty where avatar feet will be when animating)>

where it is simply another action in the responder. Then you can just have your python wait for <seektime> and run as usual.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Sound Flags

Postby D'Lanor » Wed Mar 26, 2008 1:55 pm

Thanks. I think I will pick the Python behavior method since that is the Cyan way. And that way I can make it multiplayer compatible should we ever be allowed to run shards with user ages.


Edit: Oh wait, are you saying that when I want to have it the way I had it before, then I need to remove that first set of actions? Or was that left out for convenience?

Edit 2: No matter how I try, I cannot get the hotspot on my clickable back. :(

Edit 3: and here is my alcscript.

Code: Select all
LinkSphere:
    physical:
        campassthrough: true
    logic:
        modifiers:
          - cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: RgnCloud
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
            actions:
              - type: pythonfile
                ref: $pythClick
              - type: oneshot
                ref: $pythClick
              - type: responder
                ref: $respClick
        actions:
          - type: pythonfile
            tag: pythClick
            pythonfile:
                file: PradGameState
                parameters:
                  - type: activator
                    ref: logicmod:$pythClick
                  - type: string
                    value: LinkSphere
                  - type: behavior
                    ref: oneshotmod:$pythClick
          - type: oneshot
            tag: pythClick
            oneshot:
                animation: ButtonTouch
                seektime: 3.0
                remote: LinkInPointCloud
          - type: responder
            tag: respClick
            responder:
                states:
                  - cmds:
                      - type: soundmsg
                        params:
                            receivers:
                              - 0011:RingClickEmit
                            cmds:
                              - play
                              - setvolume
                            volume: 1
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detect_trigger

RgnExitMusic:
    region:
        type: soundregion
        soundemitter: ExitMusicEmit

ExitMusicEmit:
    type: soundemit
    sound:
        flags:
          - is3dsound
          - localonly
        file: pradExitMusic
        volume: 0.75
        type: backgroundmusic
        minfdist: 100
        maxfdist: 200
        fadein:
            length: 1
            start: 0.0
            end: 1.0
            type: logarithmic
            stop: false
        fadeout:
            length: 5
            start: 1.0
            end: 0.0
            type: exponential
            stop: false

StarMusicEmit:
    type: soundemit
    sound:
        flags:
          - autostart
          - localonly
        file: pradStarMusic
        volume: 0.75
        type: backgroundmusic

RingClickEmit:
    type: soundemit
    sound:
        flags:
          - is3dsound
        file: pradRingClick
        volume: 1.0
        type: soundfx
"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 5:14 am

Hrmmmm......

Still can't get my door to open up. Sound works just fine and everything. I've taken a look at the script I typed in, and it looks fine. Just looked at the python log and this is what it's say when I click:

Code: Select all
(03/27 07:13:12) OnNotfiy: id= -1
(03/27 07:13:12) ID of Clickable logicmod: 1
(03/27 07:13:12) OnNotfiy: id= -1
(03/27 07:13:12) ID of Clickable logicmod: 1
(03/27 07:13:19) OnNotfiy: id= -1
(03/27 07:13:19) ID of Clickable logicmod: 1
(03/27 07:13:19) OnNotfiy: id= -1
(03/27 07:13:19) ID of Clickable logicmod: 1
(03/27 07:13:21) OnNotfiy: id= -1
(03/27 07:13:21) ID of Clickable logicmod: 1
(03/27 07:13:22) OnNotfiy: id= -1
(03/27 07:13:22) ID of Clickable logicmod: 1


I'll look more at the scripting. I may have done something like added a space or typo
"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 5:43 am

Grrrr.....I think it's me, that I'm typing it in wrong....sigh. I hate trying to figure out the spaces and indents.

Okay, let me verify something here. Here is the script you showed, part of it anyway, I just copied it from your post, is the spacing and indents right?

Code: Select all
actions:
   - type: pythonfile
     tag: DoorOpen
     pythonfile:
          file: <python file name>
          parameters:
           - type: activator
             ref: logicmod:$DoorOpen
           - type: string
             value: doorbutton

As you can see, under parameters, you only have it indented one space, instead of two. Is it suppose to be like that? Also, under Pythonfile it's indented only 3 spaces, not 4. I'm confused.
"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 7:37 am

I know you are asking Nadnerb but to me the indents look wrong. PyPRP seems to have a certain tolerance for indents though.

OK, change of plans here: When I get home I am going to revert to my old quickscript. Next I will try to attach the responder to my sound emitter and point it to my Python file. Then I should be able to use PtAttribResponder and activate the responder with Python code at the proper moment.
"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 Goofy » Thu Mar 27, 2008 8:07 am

ummm silly question, but aren't these scripts just python? if so why not just use the python interpeter to check it for proper syntax?
We keep moving forward,
openning up new doors and doing new things,
Because we're curious... and curiosity keeps
leading us down new paths

Walt Disney

Keep moving forward
Goofy
 
Posts: 162
Joined: Mon Oct 01, 2007 8:51 pm

Re: Sound Flags

Postby andylegate » Thu Mar 27, 2008 8:08 am

Actually, I'm asking anyone that understands ALCscripting! :D

Everything works, except the door won't move. It seems like it's either ignoring this part, or it's getting overwritten.
"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 8:10 am

Oops, didn't see Goofy's reply.

I can try that, but copying and pasting from the code listed here, puts a indent in the whole thing when I paste it either in PlasmaShop or Notepad++, we talked about this way back when. Don't know what causes that.
"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

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests

cron