• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

RGSS FmodEx extension

MysteriousUser94

Guest
0
Posts
@Juka15 : Screen of the line 10 in your script '^' ?
@The12thGripper : Use the OGG format, I don't know why it can't read metatag of MP3 '^'
Btw the LOOPLENGTH is the length of the loop not the end of the loop.

@lolandbeer : You'll never be able to loop an ME because ME aren't supposed to loop. Use a BGM instead.
 
3
Posts
8
Years
  • Age 25
  • Seen Aug 3, 2015
@The12thGripper : Use the OGG format, I don't know why it can't read metatag of MP3 '^'

I've tried that but it doesn't appear in the debug menu (and the PokéGear) nor does it loop in the sound test. I've gotten the file to loop in VX Ace so it's definitely something with FmodEx. I'll trying doing everything from scratch when I'm able to though.
 

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
437
Posts
12
Years
I've tried that but it doesn't appear in the debug menu (and the PokéGear) nor does it loop in the sound test. I've gotten the file to loop in VX Ace so it's definitely something with FmodEx. I'll trying doing everything from scratch when I'm able to though.

The reason why it doesn't appear in the Jukebox or Debug Menu related areas is because Essentials does not have it set to display .ogg files by default. This can be easily fixed by modifying the arrays that those lists depend on to add ".OGG" and ".ogg" to them.

This is what the Jukebox section would look like, pre-edit, within the PokemonJukebox script section on Pre-v15 builds:
Code:
        when 3
          files=[_INTL("(Default)")]
          Dir.chdir("Audio/BGM/"){
             Dir.glob("*.mp3"){|f| files.push(f) }
             Dir.glob("*.MP3"){|f| files.push(f) }
             Dir.glob("*.mid"){|f| files.push(f) }
             Dir.glob("*.MID"){|f| files.push(f) }     
          }

What you'll want to do is this, I've italicized and underline the lines you need to add:
Code:
        when 3
          files=[_INTL("(Default)")]
          Dir.chdir("Audio/BGM/"){
             Dir.glob("*.mp3"){|f| files.push(f) }
             Dir.glob("*.MP3"){|f| files.push(f) }
             Dir.glob("*.mid"){|f| files.push(f) }
             Dir.glob("*.MID"){|f| files.push(f) }     
             [I][U]Dir.glob("*.ogg"){|f| files.push(f) }[/U][/I]
             [I][U]Dir.glob("*.OGG"){|f| files.push(f) }[/U][/I]             
          }

This will fix ogg files not showing up in the Jukebox, but it will not fix files not showing up in the Debug menus. You'll need to do a similar method for that. Just do a Ctrl+Shift+F search for ".MP3", with the Match Case option on. You'll be where you need to be. The Editor requires a little more work, since you have to rename EditorScripts.rxdata to be Scripts.rxdata (Make sure you backup your Scripts.rxdata first! You do NOT want to lose that!). Then it'll be editable from within RPG Maker. When all is said and done, rename it back to EditorScripts.rxdata, restore your original Scripts.rxdata, and viola - Your External Editor, Debug Menus, and Jukebox will now be able to read and identify .ogg files.

As for why it doesn't loop within the Sound Test option, that's because scripts in the game don't do anything outside the game. .ogg files don't have proper RMXP support, and as such they don't loop normally, even within the Sound Test.
 
3
Posts
8
Years
  • Age 25
  • Seen Aug 3, 2015
The reason why it doesn't appear in the Jukebox or Debug Menu related areas is because Essentials does not have it set to display .ogg files by default. This can be easily fixed by modifying the arrays that those lists depend on to add ".OGG" and ".ogg" to them.

This is what the Jukebox section would look like, pre-edit, within the PokemonJukebox script section on Pre-v15 builds:
Code:
        when 3
          files=[_INTL("(Default)")]
          Dir.chdir("Audio/BGM/"){
             Dir.glob("*.mp3"){|f| files.push(f) }
             Dir.glob("*.MP3"){|f| files.push(f) }
             Dir.glob("*.mid"){|f| files.push(f) }
             Dir.glob("*.MID"){|f| files.push(f) }     
          }

What you'll want to do is this, I've italicized and underline the lines you need to add:
Code:
        when 3
          files=[_INTL("(Default)")]
          Dir.chdir("Audio/BGM/"){
             Dir.glob("*.mp3"){|f| files.push(f) }
             Dir.glob("*.MP3"){|f| files.push(f) }
             Dir.glob("*.mid"){|f| files.push(f) }
             Dir.glob("*.MID"){|f| files.push(f) }     
             [I][U]Dir.glob("*.ogg"){|f| files.push(f) }[/U][/I]
             [I][U]Dir.glob("*.OGG"){|f| files.push(f) }[/U][/I]             
          }

This will fix ogg files not showing up in the Jukebox, but it will not fix files not showing up in the Debug menus. You'll need to do a similar method for that. Just do a Ctrl+Shift+F search for ".MP3", with the Match Case option on. You'll be where you need to be. The Editor requires a little more work, since you have to rename EditorScripts.rxdata to be Scripts.rxdata (Make sure you backup your Scripts.rxdata first! You do NOT want to lose that!). Then it'll be editable from within RPG Maker. When all is said and done, rename it back to EditorScripts.rxdata, restore your original Scripts.rxdata, and viola - Your External Editor, Debug Menus, and Jukebox will now be able to read and identify .ogg files.

As for why it doesn't loop within the Sound Test option, that's because scripts in the game don't do anything outside the game. .ogg files don't have proper RMXP support, and as such they don't loop normally, even within the Sound Test.

Oh wow, thank you! I couldn't find anything when I looked up why .ogg files weren't appearing in the Debug menu and none of my friends could tell me why either so seriously, thank you so much! I'll be giving this a shot now.

My apologies, but the script don't work on my project. See the error:

You know why this error happened?
Because I just Copy and Paste above the Main Script. I am make something wrong.
Can you help me about this error?

EDIT: I'm now having this error. I didn't change any of the scripts and I was able to get it to run before so I have no idea what's wrong.

EDIT 2: If you're having the issue above, try coping and pasting the scripts using the "printer-friendly" version of the page. It fixed the problem for me.
 
Last edited:
91
Posts
14
Years
  • Age 32
  • Seen Sep 5, 2015
@lolandbeer : You'll never be able to loop an ME because ME aren't supposed to loop. Use a BGM instead.

I found all the GetWildVictory and GetTrainerVictory (in PokeBattle_Scene) and changed all the ME for BGM, then placed the file like normal in the BGM folder and make the same change for the file destination at the fmod script (including adding .mp3 to the name).

Still not looping ; _ ; How should I try to make the Victory ME a loop then? I mean, how can I even make it a BGM? I thought this was all the necessary changes.
 

MysteriousUser94

Guest
0
Posts
.mp3 are very tricky, use .ogg and it'll loop.
I'll try to patch the MP3 tag reading when I'll have time ^^

Essentials look's very hard to use, I was lost in the pos #25 and #26 @_@
 
91
Posts
14
Years
  • Age 32
  • Seen Sep 5, 2015
@lolandbeer : You'll never be able to loop an ME because ME aren't supposed to loop. Use a BGM instead.

I can't use a BGM when the game forces it to be a ME file, such as in a Battle Victory. That's a ME. I'll have to rewrite code but, is there an easier way to do this? It would save a lot of time for me and many more to come.

Also your suggestion to use .oggs worked perfectly : - ), but still not compatible with ME.
 
Last edited:

MysteriousUser94

Guest
0
Posts
Two solutions :
1 :
Do CTRL+Shift+F, type me_play and replace the results of the battle script by bgm_play. (I don't think you'll have to put the file in the BGM directory because me_play and bgm_play use a relative path from the root of the game).

2 :
In the FmodEx script search :
Code:
  def me_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @me_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    ::FmodEx.me_play(file_name, volume, pitch)
  end
and replace that by
Code:
  def me_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @me_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    unless file_name.include?("_loop")
      ::FmodEx.me_play(file_name, volume, pitch)
    else
      ::FmodEx.bgm_play(file_name, volume, pitch)
    end
  end
If you put _loop in the victory file name it'll be played as a BGM.
 
91
Posts
14
Years
  • Age 32
  • Seen Sep 5, 2015
Two solutions :
1 :
Do CTRL+Shift+F, type me_play and replace the results of the battle script by bgm_play. (I don't think you'll have to put the file in the BGM directory because me_play and bgm_play use a relative path from the root of the game).

2 :
In the FmodEx script search :
Code:
  def me_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @me_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    ::FmodEx.me_play(file_name, volume, pitch)
  end
and replace that by
Code:
  def me_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @me_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    unless file_name.include?("_loop")
      ::FmodEx.me_play(file_name, volume, pitch)
    else
      ::FmodEx.bgm_play(file_name, volume, pitch)
    end
  end
If you put _loop in the victory file name it'll be played as a BGM.

Sadly that didn't work ... But I noticed something! After the ME ends playing, it WILL go back to playing the BGM where it stopped. Could it be that, because the BGM is playing and looping in the background, it can't also loop the ME?

Ive got a feeling you are very close :-P
 

MysteriousUser94

Guest
0
Posts
The second solution didn't worked ?
You really put the _loop in the name of the Victory song ?

What you said about ME is the normal behaviour of the ME in RMXP when they finish the BGM restart where it stopped (that's why they don't loop).
 
91
Posts
14
Years
  • Age 32
  • Seen Sep 5, 2015
The second solution didn't worked ?
You really put the _loop in the name of the Victory song ?

What you said about ME is the normal behaviour of the ME in RMXP when they finish the BGM restart where it stopped (that's why they don't loop).

Yep I made sure it's _loop on the script too. i.e. Victory_loop.ogg
 

MysteriousUser94

Guest
0
Posts
That's weird, put a line with :
Code:
  p file_name.include?("_loop"), file_name
After : unless file_name.include?("_loop")
To see if the script detects the thing well '^'
 
91
Posts
14
Years
  • Age 32
  • Seen Sep 5, 2015
That's weird, put a line with :
Code:
  p file_name.include?("_loop"), file_name
After : unless file_name.include?("_loop")
To see if the script detects the thing well '^'

Haha! Now it it doesnt go back to playing the BGM, but it doesn't loop either! How can this be so complex! ><
 

MysteriousUser94

Guest
0
Posts
You got a window with stuff written on it ? (I'm interested by that '^')
(It's easier on my projet, I do things like that : http://puu.sh/jtSqE/d249f30291.png so I don't have to edit any scripts but it's not essentials '^')
 

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
437
Posts
12
Years
I am curious about something. In an effort to organize my game's root folder, I want to move files into more organized folders. For example, I want to move the dll files for the fmodex extention into a folder named "dll". Now, I've already figured out how to move the dlls into another folder. In the RGSS Linker script section, I did the following:
Code:
  @RGSS_Linker = {:core => Win32API.new("[B][U]dll/[/U][/B]RGSS Linker.dll","RGSSLinker_Initialize","p","i")}
I also did the following to the FmodEX script section:
Code:
  Kernel.load_module("DLL/RGSS FmodEx.dll","Init_FmodEx")
This made it so it would continue to find the dlls in their appropriate folders. However, I can't seem to figure out how I can put the dll named "fmodex.dll" into a folder, since I can't find anything for it in the scripts. Would you know how I could do that?
 

MysteriousUser94

Guest
0
Posts
The only way is to put the fmodEx dll inside C:\Windows\System32 because the dll is loaded implicitely and not explicitly by LoadLibrary like Win32API does. As the GetCurrentDirectory() is the game folder Windows tries to load fmodEx from this path.

You can try a tricky thing like :
Code:
SetCurrentDirectory = Win32API.new("kernel32","SetCurrentDirectoryA","p","i")
if(SetCurrentDirectory.call(".\\DLL\\") == 0)
  raise RuntimeError, "Failed to set path to DLL"
end
#Load the dlls without the "DLL/"
if(SetCurrentDirectory.call("..") == 0)
  raise RuntimeError, "Failed to return to the original path !"
end

Edit : The string in the first condition is .\\DLL\\
I don't know why PC doesn't display it well :(
 

Mellan

Pokémon Chion Developer
85
Posts
9
Years
Hi! I've got this error.

B6XJ2U9.png


I don't get why. It worked fine before the upgrade to version 16 of PE... I'm sure I have all dll files installed into my computer, and in the game folder as well...

Line 24 is:
Code:
    mod = @RGSS_Linker[module_filename] = Win32API.new(module_filename, module_function, "", "")

Thank you.
 

MysteriousUser94

Guest
0
Posts
It looks like the LoadLibrary function fails.
- Check if you really have all the DLL file at the root of your game folder.
- Check if your game is using RGSS104E.dll and not the crappy RGSS102E.dll (open Game.ini to see that).

If that's correct I'll give you some instructions to see where the bug is. (I'll download PE 16 to see if there's no issue with PE itself.)

Edit my RGSS Linker script is 23 lines long and it works well on PE 16 ^^' (Tested)
 
Last edited:
Back
Top