Professional Web Applications Themes

Need help with Lingo (Sound) - 3D - Macromedia Director 3D

I created a game in 3D studio max, exported it as W3D (shockwave) format and do some editting in director. It is a car game where we requires to find something in this game. I encountered some problems here with sound. --- Is there such codes for lingo scripting where we can actually make a sound to appear when the car is getting closer to that particular object? Also, an increment of the same sound occur when the car is getting really near to the object? --- Some people asked me to use the locH and locV but i just ...

Sponsored Links
  1. #1

    Default Need help with Lingo (Sound) - 3D

    I created a game in 3D studio max, exported it as W3D (shockwave) format and do
    some editting in director. It is a car game where we requires to find something
    in this game.

    I encountered some problems here with sound.

    --- Is there such codes for lingo scripting where we can actually make a sound
    to appear when the car is getting closer to that particular object? Also, an
    increment of the same sound occur when the car is getting really near to the
    object? ---

    Some people asked me to use the locH and locV but i just cant figure out this
    code, it is impossible to tell the locations of the objects drawn in 3D studio
    max. They also suggested me to use the sound script (pan) to determine the left
    and the right sound so people will know where is the object when they are
    controlling the car in the game.

    Much appreciated if someone can actually assist me with this issue. Many
    thanks to you.

    Tatt.:confused;

    Sponsored Links
    TattHung Guest

  2. #2

    Default Re: Need help with Lingo (Sound) - 3D

    I your are asking for a behavior (drag and drop) i dont know one.

    But with a little lingo you can achieve the desired effec:

    Create a sound channel (with lingo), and asign it a sound cast member.
    Get the distance between the car and the target object (use worldposition
    property of the model). get the magnitude of the vector (a integer)
    Define a function that receives the distance (zero to infinite) and return the
    volume (0 - 255 or 255 - 0).
    Change the volume of the sound channel.
    You have to do this periodic, it can be in an enterframe handler or you can
    use a timeout object. that calls the method, for example, every 500 ms (i would
    do it in the enterframe after update the car's position)

    Luck.



    ensamblador Guest

  3. #3

    Default Re: Need help with Lingo (Sound) - 3D

    Hi

    I am new to this. Can i know how can i get the magnitude of the vector since
    it was created in 3D studio max? I was stuggling at this section. Also, can i
    get some example script as you mentioned in the above "Define a function that
    receives the distance (zero to infinite)" since i don't know one.

    Thank you so much for the help.

    TattHung Guest

  4. #4

    Default Re: Need help with Lingo (Sound) - 3D

    That post is a good outline of a simple "3d sound manager"... but creating a
    re-usable and rigorous script to setup and change sound volumes and panning
    takes work (for example I've made one and it's about 1000 lines of code). Until
    there is some automatic sound handling via lingo, this is how you have to do it.

    But here is some example that may help:


    -- this is the distance from the car to the sound. uses worldposition vectors.
    vDistToSound =
    refCarModel.worldposition.distanceto(refSoundSourc eModel.worldposition)
    -- find a volume factor from 0.0 to 1.0 depending on predetermined max/min
    distances to sound.
    -- use 1.0 - ... so that the factor diminishes with greater distance. her
    than pDistToSoundMAX, you have 0 volume.
    vVolumeFactorRaw = 1.0 - (vDistToSound / pDistToSoundMAX)
    vVolumeFactor = max(0.0, min(vVolumeFactorRaw, 1.0))
    -- this is the new volume
    vVolumeNew = integer(vVolumeFactor * 255.0)
    -- set the new volume of the sound that is playing...
    sound[yourPlayingSoundIndex].volume = vVolumeNew

    tedalde2 Guest

  5. #5

    Default Re: Need help with Lingo (Sound) - 3D

    I will try the script soon and tell you the results ok. I hope it will works well.

    Many thanks.
    TattHung Guest

  6. #6

    Default Re: Need help with Lingo (Sound) - 3D

    Please see my reply to this cross-post on http://director-online.com/forums/read.php?3,23145.
    openspark Guest

Similar Threads

  1. SOUND TUTOTIAL DIRECTOR (LINGO)
    By TXUTXO webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 11
    Last Post: February 20th, 04:26 PM
  2. UNDOENTED LINGO (was:Is it posible to modifiy a sound pitch?)
    By Richard in forum Macromedia Director Lingo
    Replies: 1
    Last Post: December 3rd, 09:31 AM
  3. Lingo Control and the Sound Channel
    By pulpman webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 3
    Last Post: October 30th, 12:09 AM
  4. Flash sound controlling with lingo....
    By Duke Erik webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: October 20th, 01:30 PM
  5. Sound & Lingo Problems
    By Doc Gonzo webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: August 22nd, 05:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139