Adventure Game Studio | Forums

AGS Support => Modules & Plugins => Topic started by: strazer on 06 May 2005, 00:43

Title: MODULE: CharacterRegionSounds v0.80b - Fixed to work with AGS v2.72
Post by: strazer on 06 May 2005, 00:43
I originally wrote this to complement the CharacterControl script module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28821) 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.

Features:

 * 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 (http://www.strazer.net/ags/CharacterRegionSounds.zip)
Mirror v0.80b (http://www.rudolphuebe.com/ags/CharacterRegionSounds.zip) (Thanks Candle!)

This download includes the script module and documentation.
Title: Re: MODULE: CharacterRegionSounds
Post by: strazer 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.
Title: Re: MODULE: CharacterRegionSounds v0.8
Post by: Barbarian 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.
Title: Re: MODULE: CharacterRegionSounds v0.8
Post by: strazer 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!
Title: Re: MODULE: CharacterRegionSounds v0.8
Post by: The_Creep 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
Title: Re: MODULE: CharacterRegionSounds v0.80b - Fixed to work with AGS v2.72
Post by: strazer on 27 Feb 2007, 18:13
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.