The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Script RGSS FmodEx extension

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #26    
Old July 31st, 2015 (3:12 PM).
lolandbeer lolandbeer is offline
     
    Join Date: Feb 2010
    Gender: Male
    Posts: 91
    Quote:
    Originally Posted by 塗 ゆり View Post
    @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.
    Reply With Quote

    Relevant Advertising!

      #27    
    Old August 2nd, 2015 (6:55 AM).
    塗 ゆり's Avatar
    塗 ゆり 塗 ゆり is offline
    Scripter / RGSS Modder
       
      Join Date: Apr 2011
      Location: France
      Age: 24
      Gender: Other
      Posts: 84
      .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 @[email protected]
      __________________
      Nuri Yuri
      Pokémon Workshop | Facebook Page
      Reply With Quote
        #28    
      Old August 6th, 2015 (9:10 AM). Edited August 6th, 2015 by lolandbeer.
      lolandbeer lolandbeer is offline
         
        Join Date: Feb 2010
        Gender: Male
        Posts: 91
        Quote:
        Originally Posted by 塗 ゆり View Post
        @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.
        Reply With Quote
          #29    
        Old August 6th, 2015 (1:02 PM).
        塗 ゆり's Avatar
        塗 ゆり 塗 ゆり is offline
        Scripter / RGSS Modder
           
          Join Date: Apr 2011
          Location: France
          Age: 24
          Gender: Other
          Posts: 84
          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.
          __________________
          Nuri Yuri
          Pokémon Workshop | Facebook Page
          Reply With Quote
            #30    
          Old August 6th, 2015 (1:34 PM).
          lolandbeer lolandbeer is offline
             
            Join Date: Feb 2010
            Gender: Male
            Posts: 91
            Quote:
            Originally Posted by 塗 ゆり View Post
            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
            Reply With Quote
              #31    
            Old August 6th, 2015 (2:29 PM).
            塗 ゆり's Avatar
            塗 ゆり 塗 ゆり is offline
            Scripter / RGSS Modder
               
              Join Date: Apr 2011
              Location: France
              Age: 24
              Gender: Other
              Posts: 84
              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).
              __________________
              Nuri Yuri
              Pokémon Workshop | Facebook Page
              Reply With Quote
                #32    
              Old August 6th, 2015 (2:33 PM).
              lolandbeer lolandbeer is offline
                 
                Join Date: Feb 2010
                Gender: Male
                Posts: 91
                Quote:
                Originally Posted by 塗 ゆり View Post
                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
                Reply With Quote
                  #33    
                Old August 7th, 2015 (11:37 AM).
                塗 ゆり's Avatar
                塗 ゆり 塗 ゆり is offline
                Scripter / RGSS Modder
                   
                  Join Date: Apr 2011
                  Location: France
                  Age: 24
                  Gender: Other
                  Posts: 84
                  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 '^'
                  __________________
                  Nuri Yuri
                  Pokémon Workshop | Facebook Page
                  Reply With Quote
                    #34    
                  Old August 7th, 2015 (11:48 AM).
                  lolandbeer lolandbeer is offline
                     
                    Join Date: Feb 2010
                    Gender: Male
                    Posts: 91
                    Quote:
                    Originally Posted by 塗 ゆり View Post
                    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! ><
                    Reply With Quote
                      #35    
                    Old August 8th, 2015 (4:41 AM).
                    塗 ゆり's Avatar
                    塗 ゆり 塗 ゆり is offline
                    Scripter / RGSS Modder
                       
                      Join Date: Apr 2011
                      Location: France
                      Age: 24
                      Gender: Other
                      Posts: 84
                      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 '^')
                      __________________
                      Nuri Yuri
                      Pokémon Workshop | Facebook Page
                      Reply With Quote
                        #36    
                      Old September 24th, 2015 (7:47 PM).
                      Derxwna Kapsyla's Avatar
                      Derxwna Kapsyla Derxwna Kapsyla is offline
                      Derxwna "The Badman" Kapsyla
                         
                        Join Date: Jun 2011
                        Location: Margate, FL
                        Age: 25
                        Gender: Male
                        Nature: Lax
                        Posts: 394
                        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("dll/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?
                        __________________
                        Development Blog:
                        For more information future news and updates to any projects, the following blogs are where I post information. You can usually hit me with a message there when it comes to bug reports or feedback, or general conversation about something.
                        Game Projects:
                        In Progress:
                        Reply With Quote
                          #37    
                        Old September 30th, 2015 (10:14 PM).
                        塗 ゆり's Avatar
                        塗 ゆり 塗 ゆり is offline
                        Scripter / RGSS Modder
                           
                          Join Date: Apr 2011
                          Location: France
                          Age: 24
                          Gender: Other
                          Posts: 84
                          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 :(
                          __________________
                          Nuri Yuri
                          Pokémon Workshop | Facebook Page
                          Reply With Quote
                            #38    
                          Old October 10th, 2015 (8:02 AM).
                          Syard Syard is offline
                             
                            Join Date: Jun 2014
                            Gender: Male
                            Posts: 6
                            Nice job !!
                            Reply With Quote
                              #39    
                            Old December 9th, 2015 (6:47 AM).
                            Mellan's Avatar
                            Mellan Mellan is offline
                            Pokémon Chion Developer
                               
                              Join Date: May 2014
                              Location: Italy
                              Age: 21
                              Gender: Female
                              Nature: Lonely
                              Posts: 89
                              Hi! I've got this error.



                              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.
                              __________________



                              Reply With Quote
                                #40    
                              Old December 9th, 2015 (10:49 AM). Edited December 9th, 2015 by 塗 ゆり.
                              塗 ゆり's Avatar
                              塗 ゆり 塗 ゆり is offline
                              Scripter / RGSS Modder
                                 
                                Join Date: Apr 2011
                                Location: France
                                Age: 24
                                Gender: Other
                                Posts: 84
                                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)
                                __________________
                                Nuri Yuri
                                Pokémon Workshop | Facebook Page
                                Reply With Quote
                                  #41    
                                Old December 9th, 2015 (12:16 PM).
                                Mellan's Avatar
                                Mellan Mellan is offline
                                Pokémon Chion Developer
                                   
                                  Join Date: May 2014
                                  Location: Italy
                                  Age: 21
                                  Gender: Female
                                  Nature: Lonely
                                  Posts: 89
                                  Spoiler:

                                  It is 29 lines long if you count also comments. xD
                                  You were correct. I forgot to add fmodex to my game folder, I feel so stupid now. :P
                                  Thank you for replying so fast. I'm sorry for making you download PE 16. >.<" I checked my folder many times, I swear, but I really didn't notice that a dll was missing.
                                  Thanks.
                                  __________________



                                  Reply With Quote
                                    #42    
                                  Old December 10th, 2015 (9:45 AM).
                                  塗 ゆり's Avatar
                                  塗 ゆり 塗 ゆり is offline
                                  Scripter / RGSS Modder
                                     
                                    Join Date: Apr 2011
                                    Location: France
                                    Age: 24
                                    Gender: Other
                                    Posts: 84
                                    Oh, on my system it says this : http://puu.sh/lQxhb/65d85fd487.png so I know I forgot something :d
                                    I forgot the comments when I copied the script from my first post so I got the wrong number of line xD (Np for the download of PE16, it tooks me 2 minutes so :p)
                                    __________________
                                    Nuri Yuri
                                    Pokémon Workshop | Facebook Page
                                    Reply With Quote
                                      #43    
                                    Old December 19th, 2015 (3:50 AM).
                                    Telemetius's Avatar
                                    Telemetius Telemetius is offline
                                    Tele*
                                       
                                      Join Date: Nov 2014
                                      Location: Italy
                                      Gender: Male
                                      Nature: Relaxed
                                      Posts: 267
                                      Well I usually just rename the mp3 extension of my music to mid and it loops without problems.
                                      More info: https://www.reddit.com/r/pokemonzetaomicron/comments/26yd2u/do_you_use_custom_music/
                                      __________________

                                      That way!
                                      I thought..uhm, ok.
                                      -----------------------------------------------------------------------------------------------
                                      Beta 50%
                                      Reply With Quote
                                        #44    
                                      Old December 22nd, 2015 (6:36 AM).
                                      塗 ゆり's Avatar
                                      塗 ゆり 塗 ゆり is offline
                                      Scripter / RGSS Modder
                                         
                                        Join Date: Apr 2011
                                        Location: France
                                        Age: 24
                                        Gender: Other
                                        Posts: 84
                                        Hi !
                                        I've updated the RGSS FmodEx API, it now find the LOOPSTART and LOOPLENGTH in MP3 files that uses the ID3 tag version 2.
                                        You just have to change the DLL files contained in this archive :
                                        http://www.mediafire.com/download/jrlci7hwh5z0zhe/Fichiers+DLL+FmodEX.zip

                                        Tell me if there's any problem.
                                        __________________
                                        Nuri Yuri
                                        Pokémon Workshop | Facebook Page
                                        Reply With Quote
                                          #45    
                                        Old January 31st, 2016 (12:18 PM). Edited January 31st, 2016 by WriterRaven.
                                        WriterRaven's Avatar
                                        WriterRaven WriterRaven is offline
                                        I Illustrate Through Words
                                           
                                          Join Date: May 2014
                                          Location: The Sengun Region
                                          Gender: Male
                                          Nature: Careful
                                          Posts: 54
                                          Hi there,

                                          I've been keeping these scripts on hand for a while now, but I only just got around to implementing it. I keep getting a no method error in the second script (placed above the Linker as per instructions):

                                          "undefined method 'load_module' for Kernel:Module"

                                          What's even more strange is that 'Kernel:Module' doesn't appear in any scripts. Using Essentials 15.1 (because I think I'm too far in to upgrade to 16).
                                          __________________
                                          Restrictions Breed Creativity
                                          Reply With Quote
                                            #46    
                                          Old January 31st, 2016 (2:34 PM).
                                          TheKojo's Avatar
                                          TheKojo TheKojo is offline
                                             
                                            Join Date: Sep 2015
                                            Gender: Male
                                            Posts: 181
                                            Quote:
                                            Originally Posted by WriterRaven View Post
                                            Hi there,

                                            I've been keeping these scripts on hand for a while now, but I only just got around to implementing it. I keep getting a no method error in the second script (placed above the Linker as per instructions):

                                            "undefined method 'load_module' for Kernel:Module"

                                            What's even more strange is that 'Kernel:Module' doesn't appear in any scripts. Using Essentials 15.1 (because I think I'm too far in to upgrade to 16).
                                            You misinterpreted the instructions. The second script needs to be placed below the linker script in the script list, not above.
                                            __________________
                                            Reply With Quote
                                              #47    
                                            Old January 31st, 2016 (2:39 PM).
                                            WriterRaven's Avatar
                                            WriterRaven WriterRaven is offline
                                            I Illustrate Through Words
                                               
                                              Join Date: May 2014
                                              Location: The Sengun Region
                                              Gender: Male
                                              Nature: Careful
                                              Posts: 54
                                              Quote:
                                              Originally Posted by TheKojo View Post
                                              You misinterpreted the instructions. The second script needs to be placed below the linker script in the script list, not above.
                                              Ah... that makes more sense. I'm too used to instructions being 'put it above X'.

                                              All fixed. Thanks a bunch. =)
                                              __________________
                                              Restrictions Breed Creativity
                                              Reply With Quote
                                                #48    
                                              Old April 24th, 2016 (6:11 AM).
                                              tustin2121 tustin2121 is offline
                                                 
                                                Join Date: Apr 2016
                                                Gender: Male
                                                Posts: 125
                                                I was wondering if you guys could add a fade up on the resumed BGM when it gets interrupted by a ME playing. It's a little jarring when an item jingle plays and then the background music just starts up again right where it left off, even mid-note. I think the built-in ME support does this already (or at least it feels like it), so it was a little jarring when the RGSS FmodEx dll didn't do so.

                                                (Barring that, if you could point me to the source code of the dll so I could try it myself, that would be nice. :) )
                                                Reply With Quote
                                                  #49    
                                                Old May 7th, 2016 (9:26 PM). Edited May 21st, 2016 by PokeVec40.
                                                PokeVec40's Avatar
                                                PokeVec40 PokeVec40 is offline
                                                Pokémon Exile Developer
                                                   
                                                  Join Date: Dec 2015
                                                  Location: USA
                                                  Gender: Male
                                                  Nature: Modest
                                                  Posts: 64
                                                  I really hope this thread isn't totally dead.

                                                  I just tried installing these scripts, and had to add in the RGSS104E.dll, but I still get an error message stating
                                                  "This isn't the RGSS104 library !" followed by the programmatically thrown exception "Failed to load RGSS Linker." Does this mean I need to install the .dll in my OS folder? and if so does that mean everyone playing the game must do so as well?

                                                  Help would be greatly appreciated- It's probably something really obvious that I'm overlooking.
                                                  ** EDIT **

                                                  Ok, so I figured out the issue- I opened Game.ini with text edit and changed the default library to RGSS104E. It works, but when RPGMaker XP saves data, I have to change it back every time from RGSS102E. Any advice as to how to change the default library in RPGMaker XP?
                                                  Thanks.
                                                  __________________

                                                  Reply With Quote
                                                    #50    
                                                  Old May 26th, 2016 (1:30 PM). Edited May 26th, 2016 by mej71.
                                                  塗 ゆり's Avatar
                                                  塗 ゆり 塗 ゆり is offline
                                                  Scripter / RGSS Modder
                                                     
                                                    Join Date: Apr 2011
                                                    Location: France
                                                    Age: 24
                                                    Gender: Other
                                                    Posts: 84
                                                    Sorry I was going to this forum lately '^'

                                                    You can take the RGSS104E.dll and rename it RGSS102E.dll, it should work, otherwise use the Steam Version of RPG Maker (I think there's no problem with this version '^').

                                                    Quote:
                                                    Originally Posted by tustin2121 View Post
                                                    Spoiler:
                                                    I was wondering if you guys could add a fade up on the resumed BGM when it gets interrupted by a ME playing. It's a little jarring when an item jingle plays and then the background music just starts up again right where it left off, even mid-note. I think the built-in ME support does this already (or at least it feels like it), so it was a little jarring when the RGSS FmodEx dll didn't do so.

                                                    (Barring that, if you could point me to the source code of the dll so I could try it myself, that would be nice. :) )
                                                    : I should add this function but if you want to try the source won't help a lot. The FmodEx.me_play only do the following thing :
                                                    -> pausing the BGM
                                                    -> starting the ME
                                                    -> starting a Thread that resume the BGM if the ME ended

                                                    You'll have to rewrite the whole function so you need to use a RGSS Linker thing to rb_define_module("FmodEx") in order to get the FmodEx module Object and rb_define_singleton_method in order to redefine the me_play, me_stop and me_fade function to manage your fadeup thread.

                                                    I give you the structure of a FmodEx::Sound object :
                                                    Code:
                                                    //---
                                                    //Structure de données d'un son
                                                    //---
                                                    struct RGSSSoundData {
                                                    	FMOD::Sound* sound;
                                                    	FMOD::Channel* channel;
                                                    	HANDLE AdditionalThread;
                                                    	bool freed_by_ruby; //Indique si l'objet a été détruit par Ruby
                                                    };
                                                    
                                                    //---
                                                    //Structure de l'objet Ruby d'un son
                                                    //---
                                                    struct RGSSSOUND {
                                                        struct RBasic basic;
                                                        void (*dmark)(void*);
                                                        void (*dfree)(void*);
                                                        RGSSSoundData *data;
                                                    };
                                                    (My source is written on VS 2012 Ultimate, I doubt it can be compiled on something else, especialy GNU compilers ^^)
                                                    __________________
                                                    Nuri Yuri
                                                    Pokémon Workshop | Facebook Page
                                                    Reply With Quote
                                                    Reply

                                                    Quick Reply

                                                    Join the conversation!

                                                    Create an account to post a reply in this thread, participate in other discussions, and more!

                                                    Create a PokéCommunity Account

                                                    Sponsored Links
                                                    Thread Tools

                                                    Posting Rules
                                                    You may not post new threads
                                                    You may not post replies
                                                    You may not post attachments
                                                    You may not edit your posts

                                                    BB code is On
                                                    Smilies are On
                                                    [IMG] code is On
                                                    HTML code is Off

                                                    Forum Jump


                                                    All times are GMT -8. The time now is 8:29 AM.