Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
footstep sounds - terrain dependent

blackwater
Registered User
Quote
2017-02-02 01:01:32

As far as I can understand, the scripted behaviour for footstep sounds is only able to be called once per scene. Might be able to be stopped by "stopping all sounds", but more than that is not possible, or?

It would be nice if it could be triggered for example on proximity to something, or "if variable x=1 then play some different footstep sounds...
(to simplify: footsteps sounds on a standard terrain node and another series of sounds for walking/swimming on a water node).

Could this be done in a really simple and smart way for a non-coder, or could some of you smart people out there give a helping hand or three?


niko
Moderator
Quote
2017-02-03 07:57:27

Hm, from looking into the source, I don't see any reason why it shouldn't be working for multiple objects per scene. What result are you getting when using it multiple times?

For different footsteps for water: That should be simple to add via javascript, assuming that your water has a specific height, and if the player is below that height, then you can savely assume he is in the water. In the last line of the behavior, where the sound is played, just check if currentPos.y < theheightofyourwater, and if so, play different sounds.

If you can't figure this out, let me know, I can extend the script for you.


blackwater
Registered User
Quote
2017-02-03 09:33:47

Thanks for replying.
I was a bit unprecise when saying "once per scene", I meant once per object per scene. In other words, the sounds from foot steps can't be switched to another set of sounds when walking somewhere else in that scene with that specific object (player).

Your suggestion should work when it comes to water I guess, but even for shallow puddles? (and not for different areas like a gravel road or a forest in the same scene...)

The coding suggestion sounds simple, but for a non-coder, it's like having dyslexia and struggling for a year, haha (true). So it's greatly appreciated if you could extend the script!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact