• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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

Ouch, I need to update fmodex.dll as well. The link you provided for version 4.68.97 is down, can you upload it again?
 
The new BGM doesn't play, and bgm remains undefined, so I'm guessing that it's failing to produce any playback?
 
I've placed this code on an event.

Code:
Script: FmodEx.set_unit(FmodEx::TIMEUNIT_PCM)
           : FmodEx.bgm_sound.pause(true)
           : position = FmodEx.bgm_sound.get_position
Conditional branch: bgm = FmodEx.bgm_play("Audio/BGM/celadon_show.ogg",100,100)
    bgm.set_position(position)
End
 
Why a conditional branch ?
Btw RMXP has a misconception with Conditional branch, they only work if the return value is true (which is not how ruby works).

You should put the whole code in only one Script command.
 
I used a conditional branch because of how RMXP handles word wrapping on script commands. Either way, I managed to put the code in a single script command, but the effect remains the same.

Code:
FmodEx.set_unit(FmodEx::TIMEUNIT_PCM)
FmodEx.bgm_sound.pause(true)
position = FmodEx.bgm_sound.get_position
file = "Audio/BGM/celadon_show.ogg"
bgm = FmodEx.bgm_play(file,100,100)
 
Last edited:
There's no bgm.set_position(position) in your script command
 
Oops. Even with that line, the new BGM won't play.
 
Last edited:
When the new bgm is supposed to be playing, the music is silent, but upon commanding the game to play the old bgm, the old one plays normally.
 
Last edited:
Hum... Does the file in question plays with a normal command like BGM change ? (or as a Map BGM)
 
It does play as a Map BGM. Making it to play like the new BGM seems to work as intended. The change is instant, although probably with a PCM sample or two of silence, so a pop efect appears. I can work with this, though, since it's most likely me having a fairly powerful CPU. Merci beaucoup!

EDIT: It seems like FmodEx.set_unit(FmodEx::TIMEUNIT_PCM) is not necessary.
 
Last edited:
De rien :p

Yes, this line was just in case the current unit was MS and not PCM ^^ (I don't know what happen before the command ^^)
 
I noticed a strange bug: Sometimes switching between BGMs causes the music to be played in a position earlier than intended.
If the music happens to be close to the end, it will try to play the music in an invalid position and crashes. I've only been able to get this error once, but if I manage to reproduce it, I'll include the value of the position to check if it's valid or not. That way it may be possible to have a rescue value in case this occurs again.

Here's the error in question:


Code:
Message: Script error within map 80 (Underground Show):
Exception: FmodEx::Error
Message: Section198:7:in `set_position'FMOD error! (38) An invalid seek position was passed to this function. 

***Full script:
file="Audio/BGM/celadon_show.ogg"
bgmPlayPlus(file,90)

Interpreter:243:in `pbExecuteScript'
Audio utils:7:in `bgmPlayPlus'
(eval):2:in `pbExecuteScript'
Interpreter:1606:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'

Interpreter:281:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
And the method bgmPlayPlus:

Code:
def bgmPlayPlus(file,volume=100,pitch=100)
  if FmodEx.bgm_sound!=nil
    FmodEx.set_unit(FmodEx::TIMEUNIT_PCM)
    FmodEx.bgm_sound.pause(true)
    position = FmodEx.bgm_sound.get_position
    bgm = FmodEx.bgm_play(file,volume,pitch)
    bgm.set_position(position)
  else
    bgm = FmodEx.bgm_play(file,volume,pitch)
  end
end
 
Last edited:
I heard the offset on the position yesterday but today I didn't :/ I think that Fmod gives the position a little earlier because it thinks the process is too slow I don't know.

For the "end of music" issue I suggest this :
Code:
def bgmPlayPlus(file,volume=100,pitch=100)
  if FmodEx.bgm_sound!=nil
    FmodEx.set_unit(FmodEx::TIMEUNIT_PCM)
	position = FmodEx.bgm_sound.get_position
    #FmodEx.bgm_sound.pause(true) #If the BGM sound is the same, it just pause the BGM because the script doesn't create new instance when the music is the same
    bgm = FmodEx.bgm_play(file,volume,pitch)
    bgm.set_position(position % bgm.length)
  else
    bgm = FmodEx.bgm_play(file,volume,pitch)
  end
end
 
I know this issue has been brought up and resolved over and over, but I'm still having problems with the RGSS104E.dll. I am getting the error "This isn't the RGSS104 library!" despite changing the FILE NAME in the root FROM "RGSS102E.dll" TO "RGSS104E.dll," and doing the same thing in game.ini

[PokeCommunity.com] RGSS FmodEx extension


Highlighted in the image are the three files I've downloaded for FMOD, plus RGSS104E.dll. Do I have everything? Am I missing something?
Thank you.
 
The RGSS Linker is able to detect if your RGSS DLL is the right one (because otherwise you would get a SEGFAULT).

There's one thing to know : RPG Maker XP has the bad habit to change your RGSS DLL in your Game Folder and that's a huge issue. If you use an illegal version of RPG Maker XP (if your DLL is RGSS100J or RGSS102E/J it's a illegal one) you'll have some issues. It's recommanded to use the steam version of RPG Maker or RPG Maker XP 1.03 (in French).

The only way to fix the problem with an illegal version of RPG Maker is to rewrite the "Game.exe" in order to load a RGSS DLL named an other way than in Game.ini. (I use this trick on Pokémon SDK because RPG Maker XP replace the RGSS3 dll with the RGSS1 one :v )

PS : The dll file you have to use is this one : https://www.mediafire.com/file/49t6lre8r93mir3/RGSS104E.dll You can rename it RGSS102E if you want.
 
Last edited:
The only way to fix the problem with an illegal version of RPG Maker is to rewrite the "Game.exe" in order to load a RGSS DLL named an other way than in Game.ini. (I use this trick on Pokémon SDK because RPG Maker XP replace the RGSS3 dll with the RGSS1 one :v )
Thanks for the reply! But, how would I "rewrite" game.exe exactly? Also, why do you keep recommending we change RGSS104E back to 102E if fmod only works with 104? Is there a way to make fmod compatible with 102E?

Sorry for all the questions. I've realized game.ini resetting itself has been the problem this whole time, but getting a legal version is out of the question (long story).
 
Back
Top