Dynamic footstep sounds with minimal input

  • #1, by LebosteinFriday, 06. February 2015, 11:23 6 years ago
    Dynamic footstep sounds with minimal input

    1. We need two values only. We can define these two values inside our main character. We select our main character and add the value "underground = 0" to define the specific underground of our scene (or area) and the value "randomsound" to play the sounds randomly later.

    https://dl.dropboxusercontent.com/u/13472834/visionaire/footsteps_1.png

    2. And now we need a few scripts. For every type of underground we use in our adventure, we add one script inside our main character with names like "footsteps_sand" or "footsteps_wood". The type of these scripts should be "Called by other action". In these scripts we set our random variable "randomsound" to a random value between 1 and the number of sounds we have for that underground. In the next lines we play the corresponding sound to the current random value:

    https://dl.dropboxusercontent.com/u/13472834/visionaire/footsteps_2.png
    https://dl.dropboxusercontent.com/u/13472834/visionaire/footsteps_3.png

    3. And now we need a script, that plays our sounds depending on the underground. We add a new script (type "Called by other action" again) with the name "footsteps". In this script we call the corresponding script to the current underground:

    https://dl.dropboxusercontent.com/u/13472834/visionaire/footsteps_4.png

    4. Now we have to trigger the "footsteps" script every time our character touches the ground. We go to the walk animation, select one of our "stomp to the ground" frames and add the script "footsteps" to the frame:

    https://dl.dropboxusercontent.com/u/13472834/visionaire/footsteps_5.png

    5. Now we are ready. The only thing we have to do is to set the value "underground" to the specific underground. There are many ways to do that. For example we can set the underground value to 0 (sand in this example) if we enter a beach scene or to 1 (wood) if we enter a wooden lodge. Or we use the walk-in action of an action area to change the underground value inside a scene locally.

    Have fun.

    Key Killer

    601 Posts


  • #2, by afrlmeFriday, 06. February 2015, 11:35 6 years ago
    Very good. smile

    I can add it to the wiki tutorial section later on if you like? I'd do it now but I'm going out for a bit in a little while.

    Imperator

    6842 Posts

  • #3, by LebosteinFriday, 06. February 2015, 11:39 6 years ago
    Yes, you can do that. My english is not so good. You can edit or extend the description if you want.

    Key Killer

    601 Posts

  • #4, by afrlmeFriday, 06. February 2015, 11:45 6 years ago
    Ok if you want I can also add it in German too, if you can provide me with the text & screenshots of the editor with German language enabled. Up to you of course.

    Your English seems fine to me, but sure I can edit it a little here & there, no problem.

    Imperator

    6842 Posts

  • #5, by LebosteinFriday, 06. February 2015, 15:39 6 years ago
    English is ok. I have cropped the title bars from the window screenshots now.

    PS: It is possible to put this in one script only. But with the solution above you can easily duplicate a sound set to create a new. It is easier to handle with separate scripts.

    Key Killer

    601 Posts

  • #6, by afrlmeFriday, 06. February 2015, 16:04 6 years ago
    I actually wrote a dynamic sound script the other year before 4.x was actually 4.x & was in fact going to be 3.8, but er yeah.

    The pure Lua script method consists of creating tables with links to the sounds, then you define the ground type (or underground as you have called it) in action areas inside of the way system of each scene. You then write a function which automatically selects a sound from the sound table based on current ground type value - if you want the sounds to be even more dynamic then you have it manipulate the volume / balance of the sounds too (but that is more complicated than it sounds as it's down to perspective). To trigger that function you would just add an execute a script action part calling that function inside of any frames where you wanted to trigger the dynamic footstep sound. Technically you could use a similar method for playing scene sounds dynamically too, but that's a whole other kettle of fish.

    P.S: the above is in regards to a script I wrote but never shared with the community.

    P.P.S: I'm not sure that what you have done would really be called a script as it consists of action parts only, but I know what you mean by it. smile

    P.P.P.S: I'll add your tutorial to the wiki now. Give me 10 minutes or so to format the content.

    Imperator

    6842 Posts

  • #7, by LebosteinFriday, 06. February 2015, 16:37 6 years ago
    Sorry. I mean ground too. Underground seems a false friend. In german "Untergrund" means the walking ground, but underground in english is the area under the earth.... Sorry for that mistake.

    Key Killer

    601 Posts

  • #8, by afrlmeFriday, 06. February 2015, 17:02 6 years ago
    Here's the wiki page. I only edited the text a little bit here & there.

    I added your tutorial to the basic section of the text / image based tutorials table of the tutorial index page which can be found here.

    Imperator

    6842 Posts

  • #9, by LebosteinFriday, 06. February 2015, 18:57 6 years ago
    Thank you! Can you add the last step to the tutorial (or something like that):

    The only thing we have to do is to set the value "underground" to the specific underground. There are many ways to do that. For example we can set the underground value to 0 (sand in this example) if we enter a beach scene or to 1 (wood) if we enter a wooden lodge. Or we use the walk-in action of an action area to change the underground value inside a scene locally.


    That could be useful to know, how it works.

    Key Killer

    601 Posts

  • #10, by afrlmeFriday, 06. February 2015, 19:17 6 years ago
    You mean add a note? not another step! sure, I can do that.

    Ok. Added note to step 1.

    Imperator

    6842 Posts

Write post