[XP] Ryex's Dynamic Sounds UPDATE:Version 2 is out!

Started by Ryex, October 18, 2009, 01:50:39 am

Previous topic - Next topic

Ryex

October 18, 2009, 01:50:39 am Last Edit: November 19, 2010, 06:28:19 pm by Ryexander
Ryex's Dynamic Sounds
Authors: Ryex
Version: 2.04
Type: Sound Effect
Key Term: Custom Environment System



Introduction

This is a dynamic sound system built on the DEE.



Features


  • Creates Dynamic BGS Sound effects
  • Creates Dynamic SE Sound effects
  • Can be easily set up through events
  • Sources and pieces can be muted
  • SE effects can be set up to repeat every x number of frames



Screenshots

NA



Demo

UPDATE: this is a new demo with no lag
Media Fire



Script

UPDATE NO LAG
http://docs.google.com/Doc?docid=0AUKLI9M5vfiOZGdiNXdnMjVfMjFjMzI4Zm5jNg&hl=en

NOTE: if you get the script from here you also need to install the DEE
http://forum.chaos-project.com/index.php?topic=4809.msg89394#new

place the DEE ABOVE Dynamic Sounds

Blizz ABS Plug in

this plug in enables sources that are placed in enemy event to automatically be muted when the enemy dies it is included in the demo (disabled read the top for instructions to re-enable it) or you can get it below
http://docs.google.com/Doc?docid=0AUKLI9M5vfiOZGdiNXdnMjVfMjJkcjJrbWdjbg&hl=en



Instructions

There is a manual located here in PDF form it describes everything you need to know to use this system.


NOTE: It is required to have the DEE installed for this script to work.





Compatibility

should work with just about any thing



Credits and Thanks


  • Ryex



Author's Notes

Thanks to the update on the DEE the system has NO more lag. enjoy and comment.

Updated to version 2 lots of new features! requires the updated DEE v1.6 to work.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

Well I tried the demo its actually really great. I like the dynamic 3-D ish sounds.
I'll look into the script to see if I can try and fix the lag.

Blizzard

Alright, let's see...

1. Math.sqrt is a quite expensive method. Instead of using something like this:

Code: DEE code!
            distance = Math.sqrt(((client.x - j) ** 2) + ((client.y - i) ** 2))
           return true if distance <= piece.power - 1


you should better use something like this:

            squared_distance = (client.x - j) ** 2 + (client.y - i) ** 2
           return true if squared_distance <= (piece.power - 1) ** 2


** is way less expensive than Math.sqrt. Just be careful not to mess up your code, I took a look at it. In any case decrease calculating the same stuff to a minimum. You have a lot of RAM at your disposal and Ruby is a slow language. So trade in CPU time for RAM expense any time you can.

2. Your source update is too CPU heavy (hence the lag). I noticed that you keep calling effective_power which seems to be quite a CPU heavy method. Rather than updating it constantly, it would be a good idea to edit Client#update. I noticed that you add stuff to @source_effective_powers without adding stuff to @sources_in_range and call effective_power regardless if the source is actually in range. I think you should put it both in the if branch.

3. Generally that update is too heavy. Rather than calculating how the effective power is each time, you should create a variable that that indicates how big the effective_power is by default and then simply use a modifier depending on the range. This should take off a load of unnecessary calculation. In fact you should first find the closest source and only then only for that source call the effective_power method. This should take a load off the CPU.

4. The rest of the lag comes from high ranges of the sources.

5. Suggestion: It would be a very good idea if you made the sources work via events since like this it works for one map only. If you make the config work with event comments, keep in mind that you should limit it to having comments in the first line or else noticeable lag can occur when refreshing the map. If you decide to use event names, keep in mind that you won't be able to switch a source, except if you allow renaming the event and reevaluating the source configuration in the name. I suggest the latter since it's faster, I did the same in Blizz-ABS.

6. If you give me credit for this, I won't love you anymore. ._.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Hellfire Dragon

This is really cool Rye :o
Now if the lag was problem was fixed it would definitely be an awesome script ^_^

Ryex

*contemplates what blizz says*


well here is my new "in_range?" method. I think that this is about as good as it gets. instead of all the Math.sqrt it tests two boxes and uses squared_distance <= power - 1 squared on the corners.

Spoiler: ShowHide

Code: New DEE code

def in_range? (client)
      if client.is_a?(DEE::Client)
        @pieces.each { |piece|
          if (client.x >= piece.x && client.x <= (piece.x + piece.width - 1))
            if (client.y >= piece.y - piece.power && client.y <= (piece.y + piece.height - 1 + piece.power))
              return true
            end
          end
          if (client.x >= piece.x - piece.power && client.x <= (piece.x + piece.width - 1 + piece.power))
            if (client.y >= piece.y && client.y <= (piece.y + piece.height - 1))
              return true
            end
          end
          squared_distance = (client.x - piece.x) ** 2 + (client.y - piece.y) ** 2
          return true if squared_distance <= (piece.power - 1) ** 2
          squared_distance = (client.x - (piece.x + piece.width - 1)) ** 2 + (client.y - piece.y) ** 2
          return true if squared_distance <= (piece.power - 1) ** 2
          squared_distance = (client.x - (piece.x + piece.width - 1)) ** 2 + (client.y - (piece.y + piece.height - 1)) ** 2
          return true if squared_distance <= (piece.power - 1) ** 2
          squared_distance = (client.x - piece.x) ** 2 + (client.y - (piece.y + piece.height - 1)) ** 2
          return true if squared_distance <= (piece.power - 1) ** 2
        }
        return false
      else
        return false
      end
    end


and ya useing effective_power with every source on the map was stupid. if instead I use it only with the sources that are in range, that will decrease lag.

also, I think I can get the same results in the effective_power method by testing 5 boxes and uses Math.sqrt 4 times, I can't remove it altogether because I still need the exact distance on the corners...

just that should dramatically reduce the amount of calculations per update. thanks for point ing out the alternate for Math.sqrt and telling me it was an expensive function. (though now that I think about it I should of been able to tell that).

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

I hope you were able to decrease the lag significantly. :)

Hm... I think you don't really need the "** 2" in the second part of the method. If I understand your code right, the client will always be diagonally positioned to the source if the first two conditions don't apply. It would be enough to just check the sum of their coordinate differences.

C       C

  SSS  
  SSS  
  SSS  

C       C


See what I mean? C are the possible client positions while S is the area covered by the source. Instead of using a squared distance, you can simply used a sum of the x and y differences and it will work. Adding is a cheaper operation that multiplying after all.

Another suggestion I have is to use a different way to check sources with a low width and height (i.e. 1 map square). These sources can easily treated as circular sources and instead of that whole block of code, it would be enough if you just checked the client's distance to the center of the source. It might not seem much, but if i.e. every second source is a point source and you can reduce the calculations for point sources by half, you'd have an improvement of 25% which is incredibly much.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

I was just thinking the same thing i'll add special handling for point (one pixel) and strip (line of pixel) sources
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

No wonder Blizz-ABS and RMX-OS don't lag. I just realized how much I learned to think outside of the box and look at the situation from a higher level of abstraction when I read my post above again and noticed how out-of-place my suggestions really are. O_o

My first suggestion above would remove all uses of **, right? I took a look at Blizz-ABS today and noticed that there is only one single place where I use Math.sqrt. And I use it to calculate Math.sqrt(2) which can easily be calculated in advance, put into a constant and used later one without ever calling Math.sqrt again. o.o;
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

source shapes: ShowHide


and to your edit. not exactly, if the first part of the in_range? method isn't true the source can still be in the 1/4 of a circle at the corners
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Nope. You checked that already in the first 2 if blocks. The code wouldn't even get to that position if the client was located in the orange/yellow/red area.



Also, you need to modify your method a bit. There's no need to calculate the power (because that would be wrong) if you're inside the source rectangle. It should be 100% there, shouldn't it?

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

wait what? what do you mean calculate power? where dose it do that?
also are you saying that there is a way other than

squared_distance = (client.x - piece.x) ** 2 + (client.y - piece.y) ** 2
return true if squared_distance <= (piece.power - 1) ** 2

to test the blue part in the corners?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Nevermind, I thought you were trying to find the closest corner.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

UPDATE: No more lag! no really before I had it skipping 10 frames before updating and I still had a 10 FPS drop
with the new update to the DEE I had it updating every frame and there was still no lag. YAY!
but really, leave the Update_Dynamic_Sound frame skip constant at 10 unless you notice choppy volume changes. even if there is no noticeable lag it still adds unnecessary calculations that in combination with other system or a slow comp can cause lag.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Calintz

WOW!!
This is great!!

It's an orgasm for my ears!!
This really does deserve a level up. Great job Ryexander.

Subsonic_Noise

This is indeed awesome. It will definitely get you on lvl69 :V:

Aqua


Ryex

October 20, 2009, 12:51:45 am #16 Last Edit: October 20, 2009, 01:10:28 am by Ryexander
Just to give you an idea of whats comming...
Quote from:  RRR Topic
User:
I like the idea of using events you can plop anywhere on your map to control where sound comes from, using cords in a script has a lot of guess work and if you later chose that it be better for the sound to be coming from a slightly diff area you'd have to sort out and redo all the cords.

I'd also think using the tile flags be nice way to do it for stuff you always want one sound to come from like water and use diff flags for diff sounds, or just one. *shrugs* In both games I'm working on I have just one script that uses tile flags so thats not much of a prob.

I do like how this works however and feel it would bring a lot more depth to my(and any) game. If it can be more ease of use designed smile.gif

Me:


well I'm sure of one thing I'm NOT doing it from tile tags I'm sorry but when I think about the lag that would create I cringe. Idea dropped.

but ya for events it will end up working something like this

create a comment in the first line

then you would add a line like


SoundSource BGS Point 013-Fire03 300


where BGS is the type of sound
Point is the shape of the source
013-Fire03 is the file name
and 300 is the range of the sound in pixels

another think that will come in V2.0 is the ability to have SE (sound effect) sources.
ie. you have a SE source on top of an anvil that plays every 3 seconds and gets louder as you get nearer it.
or anything like that.



UPDATE:
v1.21 of the DEE fixes a bug when there is more than one map. if your using the script please update the DEE
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

October 25, 2009, 02:47:50 am #17 Last Edit: October 25, 2009, 02:25:20 pm by Ryexander
ok so in my event set up of sources I'm considering changing the sources array in the sound_source class to a hash. that way I can support methods to move sources while in game as well at other things base on a name you give the source it would also make it a whole lot easier to add pieces to a source.
but then i could also do it by creating a new has that bonds names to array indexes. which would be better?

also in terms of adding sources what kind of tage should i use to identify information
should I check for a \ in front of the key word or not, should I require []s around data that needs to be collected? or should I just check after the key word for data without []s? that sort of thing.

also for the SE effect playing every some many seconds should I use a Time.now object or go with Graphics.frame_rate/40

also I'm thinking about adding $globals to turn the Dynamic BGS's and SE's off individually. will this be used do you think?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

It's up to you on ho you implement it.

I rather suggest using Graphics.frame_count/40 than Time.now.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Taiine

Yay you quoted me from the other forum xD

Looking good so fare :3 I still can't wait for this! The demo to my older rm2k remake in rmxp is almost done. Be a nice showcase of how this works in a real game :3

Ryex

well i'm kinda caching up with life right now so It will be a little while till it is done but I should be to do it in as little as one weekend. so If i get the time it will be done. but that dosen't mean it is not being worked on. every time I have a free moment where I don't have much else to think about I'll often go over concepts and pseudo code in my head, so that when it gets time to code it know exactly what I'm doing. just wait  a bit longer (like a week... perhaps two).
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

X-Law

Hey!
A very nice script, this save a lot of work.
Well i found something strange, don't know if it is a glitch or something. In the demo, if you teleport to the other map while the 'fire' sound is playing the sound doesn't stop. It still playing in the new map.I tried it in my game too and got the same "problem". If you teleport while a sound is playing the sound will remain in every new map, i mean:
Map001 + sound ==> Map002 ==> Map003
And the sound's still looping in Map003.
It's not a big thing but just trying to help to improve the script ^^

AlbatrosStorm is on sale now!

Ryex

It should be simple to do, I'll add it in the next up date. but an easy way to fix it for now it to check the auto change BGS box on the map properties page none in an option there and will stop BGS's playing.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

I'll be releasing v2 of this script very soon. that means an event setup system se sources and even a BABS plug-in that allows you to use enemies as sources that stop playing when the enemy is dead! another option the script will have is that ability to use a script call to mute any source!

v2 will be released with an improved version of the DEE too.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

UPDATE to version 2.00
lots of new stuff. the most notable is event set up. Dynamic Position Sources, a BABS plugin, and a Manual that tells you how to set everything up

check the first post for information
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

November 13, 2010, 05:15:10 pm #25 Last Edit: November 13, 2010, 06:09:34 pm by Ryexander
I found a bug that prevented volume limits form working with bgs sources, also fixed a minor bug that would make the script not work properly with other systems using the DEE. the change is made in anticipation of a new script I making, Ryex's Dynamic Weather Effects
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Agckuu Coceg

Quote from: Ryexander on March 11, 2010, 12:31:08 am
UPDATE to version 2.00
lots of new stuff. the most notable is event set up. Dynamic Position Sources, a BABS plugin, and a Manual that tells you how to set everything up

check the first post for information


And I missed it? Damn! So many new goodies ...
I'm not retarded, but I'm busy. Sorry for patience.


Ryex

crap... there was ANOTHER bug with dynamic position sources. fixed now in 2.02
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

November 15, 2010, 10:22:32 pm #28 Last Edit: November 15, 2010, 11:25:57 pm by Ryexander
ok one last bug fixed, I'm positive I cleaned them all out now. I also ensured compatibility with my soon to be released dynamic weather system and cleaned up the code a bit. I also updated the manual as the script calls changed a tiny bit
if your using the script it would be a good idea to update
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

fixed one error to make it work with the new DEE.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

Hello there! Epic script! I love it. There's only one problem, and I know I must be doing something wrong so if somebody would clarify that would great.

I'm trying to use the Blizz-ABS plug in so that a monster can make a sound effect, and the sound would move along with it as it is coming closer. I can get the moving sound part to work, and I'm trying to make it so that when it dies the sound goes away. But I keep getting this error when I kill it:

"Script 'Dynamic Effects Engine' line 574: NoMethodError occurred.
undefined method 'x' for nil:NilClass"

Can anyone help me out here? Thanks in advance. :)

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

Okay it worked! Now there's another thing. I can kill the enemy and the sound will go away. But when I put more than one enemy on the map I get this error:

"Script 'Dynamic Sounds' line 827: ArgumentError occurred.
wrong number of arguments(5 for 3)"

Ryex

ok thats weird. can you find that line and post it? it must be different from my version... because if it's the same it is an error that doesn't make any sense
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

This is the line:
    super(x, y, width, height, power)

Maybe I changed something else in the script?

swick

Okay actually I replaced the script I had in there with a fresh one from the first page of this thread. Then it gave me an error saying I don't have DEE version 1.5 or higher, so I replaced the DEE that I had in there with a fresh version found on the first page (again). And NOW when I go to test the game it gives me yet another error saying: 'BABS Addon' line 32:NameError occurred. uninitialized constant RyexCFG::D_S

swick

Okay I fixed it. It works fine. For some reason it was giving me a problem with these 2 lines so I deleted the whole thing:

elsif RyexCFG::D_S::VERSION < 2.0
  raise 'ERROR: Ryex\'s Dynamic BABS Monster Sounds requires Ryex\'s Dynamic Sounds v2.0 or higher.'

After I deleted these 2 lines it works like it's supposed to. Is that good or bad?

Ryex

Bad, but not bad bad, I simply forgot that I renamed something. it's fixed now so get the newer version of the plugin.  also did your other problem just go away? what did you do?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

I think I had an older version of the script (I got it from HBGames I think) because I replaced that version with the one from this thread, and it worked after I did that.

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

Sorry about that, it probably wasn't HB I got it from then, I don't exactly remember, I've been looking through several different forums and sites looking for scripts when I came upon this one. All I know is that I replaced the script with the one from the first page of this thread and it worked :P

Btw, I can't seem to find a good Radius and Power for SE's on enemies. I'm working on a Silent Hill fan project, and in the original games, a white noise sound would come from your radio to indicate that enemies were nearby, and it would get louder the closer they came. What do you think a good radius and power would be to duplicate this system using this script do ya think? If you don't mind me asking ofcourse :P

Ryex

I don't really know as I've never played the game, I would suggest setting it so that if the enemy is just out side the visible area of the map, try something around 7 to 12 map tiles remember that the range is in pixels so multiply tiles by 32 to get pixels.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

swick

Sorry for all the questions but it's a bit hard for me to grasp, even after reading the whole PDF guide xD

So when I use the normal "Play BGS" command in an event, it doesn't work the way its supposed to. So what I did was I used a point source to change the BGS (Wind BGS). It works, but when I want to change the wind BGS on the same map (like when it starts raining), I try to use another point source (for rain), to override the wind BGS but the wind BGS I was using before remains, and the rain BGS doesn't come at all. And since it isn't really a dynamic source I can't mute the Wind BGS to replace it with the Rain BGS. How do I go about changing BGS's? Sorry if it's a dumb question haha.

Ryex

ok look closely at the demo, thats why i made it so that people could use it as an example along with the manual.  the map with the mage trying to light a fire should teach you how to play a SE source dynamically (notice that the source it muted by default)  the last map in the moutians teaches how to mute sources. a source does NOT have to be dynamic to be muted I'm not sure how you got that idea. you do how ever need to tell the method  if the source your muteing is dynamic.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Agckuu Coceg

I have a some kind of problem during the formulation of dynamic SE. I put the event code:
Quote\dee[dse|name|radius|power|delay|volume limit]

check that, and sound not works. Where I'm mistakes in the code? I've tried everything, but it have zero sense.
I'm not retarded, but I'm busy. Sorry for patience.


Galick Hou

I'm having some trouble setting up the script to mute a source. I've made an event of a soldier that walks around making noises (using the dynamic position source), but I want to mute him when he stops or see the player. I know I have to use the script call with the [, dynamic] property but it doesn't work! Here's what I'm trying to use:
RyexCFG:: D_S.mute_piece(0, DA, D1[, dynamic ])

How should I place the [, dynamic ] in the script call to make the soldier silent? Thanks for your attention!

Heretic86

I've run into a bit of a bug that I'm not sure how to work around.

I am trying to change the Background Sound to "Quake", but when I do, it plays for a split second, then cuts out.  It needs to be a BGS the sound needs to loop due to waiting for player input.  There are no script conflits, running latest version, yadda yadda yadda.  Any help from anyone (not just the original author) would be appreciated.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Heretic86

Yay, another bug.  Since it seems Ryex is no longer active, I'll have to ask for help.

Simple bug - F12 breaks all dynamic sounds.

Suggestions?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Ryex

Lol, I'm still active, sorry about not responding to your first problem

as for your F12 problem. I assume you have the F12 fix script that fixes the "Stack Level Too Deep" error?
your first problem I cant understand what you mean, you will have to clarify.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Heretic86

February 20, 2013, 03:48:34 am #49 Last Edit: February 24, 2013, 02:59:06 am by Ryex
Wow!  You are still active!  Awesomesauce!

No, I dont have the F12 "Stack Level" error script.  Since we dont know each other, I do some scripting myself, and normally can fix 99% of issues.  One that I saw caused F12 to just exit the game.  Off topic, what I normally find on Stack Level errors is some scripts try to redefine self after instantiated.  My workaround for that is usually two lines.  One global variable so it doesnt get stored when the game is quit, but if the variable already exists, dont try to redefine self or the class name.

module Input
 unless $input_class_defined # F12 Fix 1
   $input_class_defined = true # F12 Fix 2
   class << Input
   or
   class << self
     (some code)
   end
 end
end


Exiting game kills the global variable, but hitting F12 does not get rid of the global, thus, the class is not redefined again, which is usually where the Stack Too Deep crashes on most crashable scripts I've seen.  Might not be the best way to do it, but it is simple and seems to be compatible and effective.  End of off topic.

The F12 bug that I mentioned doesnt cause a Stack Level Too Deep crash.  It doesnt crash.  But all dynamic sounds stop playing altogether after F12 is pressed.  I took a crack at fixing it, but didnt come up with any solutions at all.

The older problem that I mentioned had more to do with my lack of understanding of how to use the script.  Through some eventing, I wanted to play Quake as a BGS, but the audio would start for a split second, then just stop.  I wasnt using script calls, just evented stuff to change the background sound  Event Commands (Page 2), "Play BGS..." button.  Probably dont need a fix for that, just an example of how to do it as a non dynamic sound.  Sometimes certain sounds play better as dynamic, sometimes they dont.  Maybe def bgs_play should be aliased to stop background sounds if that is what is causing it?  Not spending much time thinking on solutions here...

---

But what the hell, while we're at it, I'll just unload.  I also have an event that I want to play a Dynamic BGS once the player activates it.  Light a Campfire basically, but the Fire animation (where I want the SE) is on another Event Page.  Cant seem to get Page Changes and Dynamic Sounds to work right for me.  Im thinking alias event refresh in class Game_Event < Game_Character to scan the active page for that event for sound effects, and play them from there.  Its your script, so I wont mess with it, but just a thought.

Also, an option to Fade In BGM / BGS / SE would be nice.

And, I want a Pony, and a shiny new bicycle with frilly tassles, and peace and love for everyone in the world!

Thanks Santa!

Sarcasm aside, I get there are some limitations due to the audio nature of RMXP, and hope just a few things in the script that could be tweaked a bit.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Ryex

well I applaud your ingenuity for fixing the problem that method will for the most part fix the stack overflow error with the F12 reset on MOST scripts.

however the F12 rest in RMXP is imperfect and implemented incorrectly which is why the error happens in the first place. instead of actually restarting the interpreter and clearing memory so the reset get a clan state they merely stops current execution and tells it to re run the scripts form the beginning. this means things can go wrong quite easily when you take into account that the memory for things like sounds and the drawing context aren't being properly handled.  I can not pinpoint the exact cause of the error nor is it likely that something I could do in the script itself would fix it.

but there IS a solution

#==============================================================================
# F12 fix
#==============================================================================

if $game_exists
 Thread.new {system('Game')}
 exit
end

$game_exists = true


this is the accepted solution for the F12 reset fix. it forces the game to start another, clean, process and exit the current one. you do have to change the 'Game' text if you have renamed the 'Game.exe' to match but it works far better and more consistently than nay other solution I know. your current problem will for the most part vanish using this solution. you just make that gode the FIRST script in your stack and all will be well.


as for your other question you will note that I included to mute sources and pieces of a source. you can even have a source start muted with an autorun event and a short script call. you can then use a script call to unmute the source. but the source event comment on the first page as normal but have it start muted. then on the second page unmute it with a script call.
if you cant get this process to work as you need feel free to let me know and I'll update the script with some added utility (new script calls ect.).
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Heretic86

Alright, I have a couple of requests:

- Fade In Background Sound / Music
- Play Non Dynamic Background Sounds  **

Right now, I cant get the option of "Play BGS..." to change to a Non Dynamic Sound at all.  It plays for a sec, then cuts out.

If you're bored, how about some Pitch Shifting over Time too?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

exile360

This is pretty great, loving this script!

It's a shame rmxp doesn't allow playing 2 BGS'es at once, it'd make things a lot more realistic. It's a tad strange when my ambiance sound of birds cuts out whenever you go near a campfire or something, but I don't really want to use SE's because they don't have that dynamic fade effect. :P Guess I'll make do with BGS'es.

Anyway, I do seem to have a slight issue. Is it just me, or does max volume for BGS not work at all? Maybe it's just me because it's 4 am and I'm tired, but I can't seem to understand what I'm doing wrong.
Here's the bit of comment I have, but the BGS is still played at what seems to be 100%, no matter what I set the last number to (seems to be the same in your demo).
\dee[bgs|point|env_fireburn4|250|fire|50]


Terv

As for the multiple BGSs I'd still appreciate it if you could make it use FMod which supports multiple audio channels. Maybe even add stereo panning for 3D sound :D

Kiwa

Hey this is a real fun script!!
I can think of probably 100 uses for this.. I'm playing with your demo to learn it.
i was looking to find dynamics for music with fade in and fade out and thought id check this out.

Its really great!
Its almost exactly what i was looking for...It doesn't include dynamic music...(or ME as of now that is)

But anyone wishing to add music into the dynamics make a copy of your song or tune and place it into the SE folder. I played with a 30 second .wav file that worked well that way.

If i use it or not, thanks for such a cool script Ryex!

Heretic86

Nasty bug found!

Save your game, DO NOT EDIT, then start it back up again.  Dynamic Sounds dont load from Save Games properly when there is no EDIT occuring.

When we edit, Magic Number changes so the map is refreshed, but when we dont Edit, as in playing a completed game, the map doesnt refresh so we end up with some data being lost if it isnt saved.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Ryex

ah yes, I remember finding that a while back but I never got around to posting up a fix. should be a simple as modifying the script to rescan for sound sources during updates. thouse would allow sounds to be added to the map by adding events via script as well. done intelligently it shouldn't add load either.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Heretic86

July 31, 2016, 07:42:09 am #57 Last Edit: August 22, 2016, 08:51:29 pm by Heretic86
I took a swing at it.  I just ended up writing a patch for it tho...

Dynamic Sounds Patch for Save Game Crashes
Spoiler: ShowHide
Redacted - See two posts down for updated patch


I had to add in a way to disable dynamic sounds so I could play Rain without D_S messing with a sound I didnt want to be dynamic.  It would be nice to do multiple sounds, but maybe I'll take a crack at that too once I have time and am done with Dynamic Lighting...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Ryex

not a bad fix at all.  if you want the sounds mute state to restore from savegames  you can do one more edit to save and restore the DEE::MapSources data structure with the save game. doing this actually provides a path to a better fix for your original problem as you no longer need to perform a event search just call the D_S.setup on the map ID.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Heretic86

I just dumped the entire $DEE to File, but is this what you meant?

Patch Code:
Spoiler: ShowHide
#=============================================================================
#
#          DYNAMIC SOUNDS PATCH
#          Author: Heretic
#          Version: 1.0
#          Date: Saturday, July 30th, 2016
#
#   Instructions: Place Below Dynamic Sounds
#
#   ----   Patch for Ryex's Dynamic Sound Engine----
#
# - Fixes a bug that causes a Fatal Game Crash when a Non Edited Save Game
#   has been loaded.  Any Sounds that were Muted before having been saved
#   will be enabled again.
# - Adds the ability to temporarily turn off Dynamic Engine Effects
#   with a Script Call: $game_system.disable_dee
#
#  Intended for use with DEE Version 1.6 and Dynamic Sounds 2.0
#
#=============================================================================

if DEE::DEE_VERSION > 1.6 and RyexCFG::D_S::VERSION > 2.0
  print "ERROR: Ryex\'s Dynamic Sounds Patch isnt needed with\n",
        "versions higher than version 1.6, you may wish to\n",
        "remove the Patch."
end

module DEE
  class System
    #------------------------------------------------------------------------
    # * Update - DEE::System
    #  - Allows disabling DEE
    #------------------------------------------------------------------------
    alias alias_dee_update update unless $@
    def update
      # Return if DEE is Disabled
      return if $game_system.disable_dee
      # Call Original
      alias_dee_update
    end
  end
end

#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
  attr_accessor :disable_dee    # Allow turning off Dynamic Sounds when true
end

#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Write Save Data - Scene_Save
  #  - Saves DEE in addition to other Game Variables
  #     file : write file object (opened)
  #--------------------------------------------------------------------------
  alias dynamic_sounds_patch_write_save_data write_save_data unless $@
  def write_save_data(file)
    # Call Original or other Aliases
    dynamic_sounds_patch_write_save_data(file)
    # Save DEE to File
    Marshal.dump($DEE, file)
  end
end

#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Read Save Data - Scene_Load
  #  - Rebuilds entire Dynamic Sounds for a Map when Game is Loaded
  #     file : file object for reading (opened) 
  #--------------------------------------------------------------------------
  alias dynamic_sounds_patch_read_save_data read_save_data unless $@
  def read_save_data(file)
    # Call Original or other Aliases
    dynamic_sounds_patch_read_save_data(file)
    # Restore DEE
    $DEE = Marshal.load(file)
    # If magic number is different from when saving
    # (if editing was added with editor)
    if $game_system.magic_number == $data_system.magic_number
      # Setup Dynamic Sounds on Loaded Map
      RyexCFG::D_S.setup($game_map.map_id)
    end
  end
end
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Ryex

This is a test post for diagnosing the code formater spoiler problem


Code: ruby
#=============================================================================
#
#          DYNAMIC SOUNDS PATCH
#          Author: Heretic
#          Version: 1.0
#          Date: Saturday, July 30th, 2016
#
#   Instructions: Place Below Dynamic Sounds
#
#   ----   Patch for Ryex's Dynamic Sound Engine----
#
# - Fixes a bug that causes a Fatal Game Crash when a Non Edited Save Game
#   has been loaded.  Any Sounds that were Muted before having been saved
#   will be enabled again.
# - Adds the ability to temporarily turn off Dynamic Engine Effects
#   with a Script Call: $game_system.disable_dee
#
#  Intended for use with DEE Version 1.6 and Dynamic Sounds 2.0
#
#=============================================================================

if DEE::DEE_VERSION > 1.6 and RyexCFG::D_S::VERSION > 2.0
  print "ERROR: Ryex\'s Dynamic Sounds Patch isnt needed with\n",
        "versions higher than version 1.6, you may wish to\n",
        "remove the Patch."
end

module DEE
  class System
    #------------------------------------------------------------------------
    # * Update - DEE::System
    #  - Allows disabling DEE
    #------------------------------------------------------------------------
    alias alias_dee_update update unless $@
    def update
      # Return if DEE is Disabled
      return if $game_system.disable_dee
      # Call Original
      alias_dee_update
    end
  end
end

#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
  attr_accessor :disable_dee    # Allow turning off Dynamic Sounds when true
end

#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Write Save Data - Scene_Save
  #  - Saves DEE in addition to other Game Variables
  #     file : write file object (opened)
  #--------------------------------------------------------------------------
  alias dynamic_sounds_patch_write_save_data write_save_data unless $@
  def write_save_data(file)
    # Call Original or other Aliases
    dynamic_sounds_patch_write_save_data(file)
    # Save DEE to File
    Marshal.dump($DEE, file)
  end
end

#==============================================================================
# ** Scene_Load
#==============================================================================
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Read Save Data - Scene_Load
  #  - Rebuilds entire Dynamic Sounds for a Map when Game is Loaded
  #     file : file object for reading (opened) 
  #--------------------------------------------------------------------------
  alias dynamic_sounds_patch_read_save_data read_save_data unless $@
  def read_save_data(file)
    # Call Original or other Aliases
    dynamic_sounds_patch_read_save_data(file)
    # Restore DEE
    $DEE = Marshal.load(file)
    # If magic number is different from when saving
    # (if editing was added with editor)
    if $game_system.magic_number == $data_system.magic_number
      # Setup Dynamic Sounds on Loaded Map
      RyexCFG::D_S.setup($game_map.map_id)
    end
  end
end

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Kise

October 06, 2017, 09:41:27 am #61 Last Edit: October 06, 2017, 09:42:47 am by Kise
How can I smoothly fade out BGS which is played by default on map ( is set in Map Properties as Auto-Change BGS )? Fade Out BGS doesn't work. :???:

KK20

Just quickly messed with it and this is what I got:

I have Dynamic Sound v2.04 and Dynamic Effects Engine v1.61.
I also have Heretic's Dynamic Sounds Patch above your post.

In Heretic's script, I removed the little message at the top of the script

if DEE::DEE_VERSION > 1.6 and RyexCFG::D_S::VERSION > 2.0
  print "ERROR: Ryex\'s Dynamic Sounds Patch isnt needed with\n",
        "versions higher than version 1.6, you may wish to\n",
        "remove the Patch."
end


In your event, do the script call
$game_system.disable_dee = true

and then do your Fade BGS.

And then when you want to re-enable, just do
$game_system.disable_dee = 
false

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kise

Yeah, that works. I tried this method before, but I didn't know that script call requied " = true" so it didn't work. Thanks!

Heretic86

Quick note on that also:

Any time you do a Script where something = false, the interpreter screws up.  This is known as the Interpreter 355 bug.  Several scripts fix this, but just in case, make sure that on Interpreter command_355 (which is the interpreter for Script calls), remove or comment out the line that says "return false".

    # If return value is false
    if result == false
      # End
      return false
    end
    # Continue
    return true


Change to:
    # If return value is false
    if result == false
      # End
      #return false
    end
    # Continue
    return true
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

But only if you put = false on the same line, which is why I formatted my post like so.
But I'm sure Kise is veteran enough to know that bug exists.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

Agreed, but not everyone actually is.  Hopefully we wont even know if explaining that helps others since they wont need to post if it helps to solve issues.  And, good call on the way you formatted the post.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Sin86

December 23, 2017, 05:50:40 pm #67 Last Edit: December 23, 2017, 05:52:07 pm by Sin86
A very big problem with Blizz ABS plugin I believe.

When applying sounds to an enemy, the sounds will play when I get to the enemy except 2 things.

1. After the enemy dies, the sounds still play, but only at the tile right where the enemy appeared it.

2. When battling the enemy, sounds will play as they should, but only at the enemy's starting tile. If moving around while fighting close ranged at the enemy but away from the spot where it once stood at, the sounds fade out and only activate at the starting tile for the enemy.

This has been tested on the original versions of DEE, Dynamic Sounds and Blizz ABS v 2.7 or higher. Also tested on the latest versions of DEE, Dynamic Sounds as well as with and without Heretic's patch.

KK20

Your event's configuration is wrong.

Here's an example of one that worked for me:
\dee[dbgs|001-Wind01|100|300]


Based on what you described, it sounds like you used bgs instead of dbgs. As the PDF states:
Quote
Dynamic Position Sources
Dynamic Position Sources are sources that follow the event they were placed in; perfect for birds,
enemies, animals, guards in a sneak game, etc.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Sin86

Ah, that's how it is done, thanks.

However, there is an issue with the latest version, the script calls for muting and un-muting crash.

Ryex

you'll have to be a bit more specific. can you snag a screenshot or copy the text of the error message when the script calls crash the game?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Sin86

January 01, 2018, 10:20:47 pm #71 Last Edit: January 01, 2018, 10:21:50 pm by Sin86
The error says:

NameError occurred while running script.

uninitialized constant RyexCGG::D_S

(had to edit the post to make it look like the error because original converted the D into a smiley.)

Also, when having everything installed properly, I can only activate the sounds on Blizz ABS events(events that have enemy tags) and yet will not work on regular events if Pixel movement is set to anything other than 0.

If the pixel rate is however at 0, the sounds play regardless of how close you are to the events, yet can play the sounds on an event regardless if its an enemy or not.

Ryex

 The obvious culprit then is the typo of 'RyexCGG' the Module should be 'RyexCFG'. Since you didn't give a line number I'm assuming the game didn't give a line number for the error which suggests that the error is happening in a script call so double check those if it DID give a line number for the error I'll need that.  Also, the D_S module isn't under the RyexCFG module so any calls to it should remove the 'RyexCFG::' scope.

If you need more help I'll need a screenshot of the error message, a screenshot of the script call that's causing the error,  and you'll have to copy paste the relevant event comments that you're using to create the sound sources that are not working correctly.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Sin86

January 07, 2018, 08:49:30 pm #73 Last Edit: January 07, 2018, 08:51:55 pm by Sin86
My bad, I made the typo when posting the error. I did CFG and still got it. This is what happens. I can run your demo, get to map004 and talk to the girl who shares this piece of script.

RyexCFG::D_S.mute_source(0,
'011-Waterfall01')


In your demo, it works fine but then again, the demo is using an early build of Dynamic Sounds and DDE. My build is using the current versions and if I input that same exact code, I get the error. And when I got the error, I went into the scripts to see if it can pinpoint me to the error and it did not. If you know of a working code, please do post on how to execute it as apparently that no longer works.

Ryex

use just
D_S.mute_source(0, 011-Waterfall01')
and remove the
 RyexCFG::


The two modules are not nested in the current version. I'm fairly sure they never were but I could be wrong if that's is what is used in the Demo.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Sin86

January 10, 2018, 07:18:49 pm #75 Last Edit: January 10, 2018, 07:23:21 pm by Sin86
It's working partially.. I did D_S.mute_source(0, '011-Waterfall01')

However, this only works on bgs formats but on a dbgs format, no effect is taken. I even put in D_S.mute_piece(0, '013-Fire01', 'campfire 1'[, dynamic ]) and all I get is a "syntax error occurred". I don't know what I am doing wrong.

By the way, I found a typo in line 100.

piece.mute = treu

I think it should be saying piece.mute = true

KK20

Whenever someone explains how to use a script, like so
my_script_call(id, amount[, active])

this is saying that the following script calls are valid:

my_script_call(id, amount)
my_script_call(id, amount, active)


In the case of D_S.mute_piece, dynamic (the optional parameter) is either true or false.
If you don't specify a value for dynamic, the script will assume a value of false. Essentially
D_S.mute_piece(0, '013-Fire01', 'campfire 1')

is equivalent to
D_S.mute_piece(0, '013-Fire01', 'campfire 1', false)


So clearly what you want to do is
D_S.mute_piece(0, '013-Fire01', 'campfire 1', true)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

Seems like the links in the original post of this thread are dead.  No screenies either.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

?
Wrong thread you posted in? All the links work. And there were no images to begin with.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Barabian

July 08, 2021, 12:39:10 pm #79 Last Edit: July 08, 2021, 12:53:31 pm by Barabian
Hi! It's passible to make this script working with XPAce script? It returns the following error:
 
undefined method `id' for #<Game_Map:0xb01542c>

[0141]Dynamic Sounds:675:in `interpret_dynamic_sounds_data_bgs'
[0141]Dynamic Sounds:273:in `interpret_dee_data'
[0141]Dynamic Sounds:251:in `block (2 levels) in dee_comment_search'
[0141]Dynamic Sounds:248:in `gsub'
[0141]Dynamic Sounds:248:in `block in dee_comment_search'
[0141]Dynamic Sounds:247:in `each'
[0141]Dynamic Sounds:247:in `dee_comment_search'
[0141]Dynamic Sounds:262:in `block (2 levels) in event_search'
[0141]Dynamic Sounds:260:in `each'
[0141]Dynamic Sounds:260:in `block in event_search'
[0141]Dynamic Sounds:258:in `each_value'
[0141]Dynamic Sounds:258:in `event_search'
[0141]Dynamic Sounds:708:in `setup'
[0076]Scene_Title:132:in `command_new_game'
[0076]Scene_Title:99:in `update'
[0076]Scene_Title:74:in `block in main'
[0076]Scene_Title:68:in `loop'
[0076]Scene_Title:68:in `main'
[0142][XPA] Main:37:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
[0142][XPA] Main:28:in `<main>'
ruby:in `eval'

KK20

You sure it's only happening in XPA? There's no such thing as Game_Map#id to begin with. It might be a typo and is supposed to be map_id.

EDIT: Yeah, I'm pretty sure it's a typo. The reason you don't see the error in vanilla XP is because, in Ruby 1.8, #id is synonymous with #object_id and #__id__, which is like the memory address ID.

From what I can see, there are four instances of this
$game_map.id
, so CTRL + H and replace them all with
$game_map.map_id

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Barabian