Author Topic: MODULE: CharacterRegionSounds v0.80b - Fixed to work with AGS v2.72  (Read 4186 times)

I originally wrote this to complement the CharacterControl script module so I thought I might as well post it here:

My CharacterRegionSounds script module for AGS v2.7 and up

This script module simplifies the process of giving ALL characters different footstep sounds for different surfaces like wood, concrete or grass.


 * Different sounds on different regions for all characters
 * Automatic volume scaling

It works very well in combination with the CharacterControl script module.
Any feedback appreciated.

Download v0.80b here
Mirror v0.80b (Thanks Candle!)

This download includes the script module and documentation.
« Last Edit: 19 Mar 2007, 21:37 by strazer »

Re: MODULE: CharacterRegionSounds
« Reply #1 on: 01 Aug 2005, 19:31 »
One feature missing that I'm going to implement soon is to also take into account the scaling of the character when calculating the volume, not only the distance to the player character.
« Last Edit: 14 May 2006, 15:29 by strazer »


  • Mongol General: "Conan, what is best in life?"
    • I can help with AGS tutoring
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with scripting
    • I can help with story design
    • Barbarian worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CharacterRegionSounds v0.8
« Reply #2 on: 20 Jan 2006, 11:23 »
Hi Strazer. I meant to reply here sooner, and I wanted to test out your module a bit before replying as well. Then I got busy and sort of forgot,  :P but then reading a different thread elsewhere recently reminded me I should post some feedback here for you.

I've been using your wonderful CharacterRegionSounds module in my current game-in-production with good results.  After I got the hang of how to use the fairly simple to understand commands, it's now easy to control the characters footstep sounds just how I want according to what area (region) the character is walking over.

I haven't encountered any problems with this module yet, so overall I think you've done a great job on it.

Regarding your recent comment you mention about calculating the volume according to scaling, well as you are probably well aware now that CJ's recent versions of AGS (I think since 2.71 ?) now has that nice option built-in as a choice for the characters in the editor, so it looks like there no need for you to worry about that part anymore.

Thanks for sharing your great work with us.
« Last Edit: 20 Jan 2006, 11:28 by Barbarian »
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Re: MODULE: CharacterRegionSounds v0.8
« Reply #3 on: 20 Jan 2006, 16:51 »
Thanks, I'm glad to hear it works for you!

As for the option in the editor, I think it only affects sounds linked directly to a view frame. But what this module does is check which frame is currently displayed, get the set sound number from its own "database" and play that, at a calculated volume (distance to player character). This allows you to have walking sounds in addition to any sounds you may want to link to the view frames. So using AGS's option probably won't do anything to the walking sounds. I'll have to check though, I haven't been scripting for a while.

Anyway, thanks again for your comments!


  • Later...in the emergency room
Re: MODULE: CharacterRegionSounds v0.8
« Reply #4 on: 23 Feb 2007, 22:09 »
Hey Strazer, I started a project in early 2006, and to various distractions, have not picked up on it since then. I had used your excellent module, which was working like a dream, then  I upgraded to ags 2.72 and opened the file to continue work and all of a sudden I get an error that says:

There was an error compiling your script, the problem was in "CharacterRegionSounds".

[Error line 31] undefined symbol, "GetGameParameter"

Line 31 is    if ((loop < 0) || (loop >= GetGameParameter(GP_NUMLOOPS, view, 0, 0))) AbortGame("Invalid loop specified: '%d'. Use numbers 0 to %d.", loop, GetGameParameter(GP_NUMLOOPS, view, 0, 0) - 1)

can anyone tell me whats gone wrong? I know the new version of ags has moved my sounds to a folder, I'm just unsure how this has affected the code

Edit: Using the the BackwardsCompatible Module, I solved the initial problem, now the game compiles, but crashes before it can run, presenting me with the error:

Error: run_rep_Exec: error -6 (Error: Array index out of bounds (Index: 4, 0..3) in CharacterRegionSounds (line 56)
)Running Function "Repeatedly_Execute_Always"

Any help or insight would be greatly appreciated
« Last Edit: 23 Feb 2007, 22:35 by The_Creep »
If you had nothing left, would you risk it all to change everything?

Version 0.80b now up. I only fixed the module to work with AGS v2.72.

The_Creep, this solves the GetGameParameter error message.
The second error was caused due to a bug in the BackwardsCompatible module. But now you don't need that module anymore so all is well.