Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Audio Module - One of the hidden modules of RMXP

Atoa

Member

I need the complete script of module Audio, one of the hidden modules of RMXP

I need it to study the behave of the method "me_play" for one of my scripts.

:thumb:
 
I've never seen it. But if you're really interested in Ruby Audio modules, look up Peter O. (wrote his own Audio module for the Pokemon Starter Kit - RMXP), and Hans Fugal (wrote Audio manipulation modules for translating audio formats).
Hans will probably help you if you buy him a T-shirt :scruff:  (check out his personal site)

I did a bunch of digging when someone else asked for a way to pause BGMs, and stumbled on these guys.

Good Luck
 
Brewmeister":2l161dm5 said:
I've never seen it. But if you're really interested in Ruby Audio modules, look up Peter O. (wrote his own Audio module for the Pokemon Starter Kit - RMXP), and Hans Fugal (wrote Audio manipulation modules for translating audio formats).
Hans will probably help you if you buy him a T-shirt :scruff:   (check out his personal site)

I did a bunch of digging when someone else asked for a way to pause BGMs, and stumbled on these guys.

Good Luck

Peter O is much more commonly known as Poccil. Anyway, the whole point of a hidden module is that it is hidden. If my memory is correct, half of the hidden classes in RMXP aren't even programmed in Ruby. (I believe the Window Class was only part Ruby, but I'm not certain)
 

Zeriab

Sponsor

I really doubt they are encrypted in the RGSS dll file, they are just not readable since they have been compiled.
The reason for them not being written in Ruby is undoubtedly speed issues.
There might be some Ruby wrapper classes present in the RGSS file. (They take care of the communication to the compiled so you just have to do simple Ruby calls. I am guessing though)
Then there are the whole RPG module which can be found in the help file. I don't know if there are any of the other hidden classes that are written in Ruby.

You can try dumping each of the hidden classes. (Marshal.dump)
If it gives you an error then chances are its functionality is written in C. (Or something similar that can be compiled)
 
Glitchfinder":25wy0ntw said:
Peter O is much more commonly known as Poccil.

I did not know that. Hopefully, he'll chime in.

Z, doesn't Marshal.dump encrypt the output?  And only dumps objects. So to see a class you create an object of that
class, then dump it. But how would you dump a Module?  (even if you could read the output)

Be Well
 

Zeriab

Sponsor

Marshal.dump does not encrypt the output. It converts objects to string representations of them. You can read more about the Marshal module here: http://ruby-doc.org/core/classes/Marshal.html

Modules and Classes are objects themselves.
I doubt you will any problems dumping the classes themselves. I meant that you should dump instances of the classes.
Plane for example is a Class. I had no problems what-so-ever dumping Plane.
Plane.new creates an instance of the Plane class. I got an error while trying to dump the instance. Sorry for not being clear.
 

e

Sponsor

Marshal.dump doesn't encrypt, but as far as I know, they sometimes use Zlib to compress data; not exactly encryption per se, I guess, but it makes your data all mumbo-jumbo anyway.
 
Z, how did you dump Plane?

I tried:

Code:
File.open("testdump.txt", "w") { |f|
  Marshal.dump(Plane, f)
}

And the output only shows an address which converts to "\004\010c\nPlane"

Not a big deal, just curious.

Be Well
 

Zeriab

Sponsor

You don't have to give an IO stream.
You can perfectly fine do stuff like this:

Code:
p Marshal.dump(Plane)
p Marshal.dump("I love you brewey <3")

If no IO stream is given it just returns a string.

I believe that classes are singletons which would explain why the output is so short. It just have to link to the class name and tell that it is a class. It might be different if there were class variables present in the class. I dunno.
The trouble would be to dump an instance of the Plane class and be able to load it again properly.
You need to define two method for that:
Code:
def _dump(depth)
  # Return a String representation of the class
end

def _load(string)
  # Return a plane object based on the string
end

Since parts of the Plane class undoubtedly are implemented in C or something similar it might be hard getting those two methods to work properly.

*hugs*
- Zeriab
 
Got it! Thanks

That's pretty much what I was getting reading the Marshal docs.
I thought you meant you were successful dumping the entire Plane class, with methods.

I assume if Plane was just a wrapper class to a "C" function, you would only see the current address of the internal function as well.

I was writing it to a file, because the message window in RGSS (from p or print) doesn't allow cut/paste.

so, Atoa's best bet is to study Poccil's rewrite of the Audio class, or check out some of the other Ruby Audio classes available out there.

The reason I was so curious, is a while back I did a bunch of digging because several people were looking for a way to "pause" BGM, and continue where it left off after a battle.
After a couple hours of digging, I got a brain-cramp & had to let it go.  :scruff:

*hug* back

Be Well
 

Atoa

Member

I've got the audio module forum poccil's pokestarter.
It was a bit hards since the script editor is very messed.

But I was able to do what i wanted to: resume map music after battle =D

Thanks to everyone that helped

@cowlow
omg! just when i finished my work you come whit this xD
I will test your system since the one i made had problems with a few midis, unluckly one off the midis was the boss midi I use in my project, i love the music and i can't chage it XD
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top