NEED HELP. [RMXP]

Posts

Pages: 1
I need to know how to change the battle start SE during the game. For some reason Enterbrain decided it was a good idea to not let you change it with an event.
Go to the Database. The last tab on the far right will be System tab. You can change all of the default music and sound effects, etc., there.
InfectionFiles
the world ends in whatever my makerscore currently is
4368
Sadly, as far as I know, you can't change the battle start SE with a event of any kind in RM2k(3) :(

I'm not sure how this would work for sure, maybe you can experiment with it, but maybe set the Battle Start SE to NONE, and have SE play at the beginning of the encounter, although I can see this only working if you have the monsters on the map with the player and not random encounters.
You can change the battle start sound effect with
$data_system.battle_start_se = "NAME OF NEW BATTLE START SE"

Making it persist between saves needs a bit more work:
*edit*Nuked this shit*/edit*

Untested, just a quick whip up. Let me know if it doesn't work and what happens when it fails.
Forgot to say that this will break old saves (it's trying to load data that was never saved). To fix it change the Scene_Load script with this:


*edit*Nuked this too*/edit*
If it tries to load a file and errors out it won't change the battle_start_se and it'll just use the last one (not guaranteed to be the default one). I'm not sure how (or if) to pull the default one from the DB right now, I don't have RMXP at work to take a peek.
Sorry to necropost but i havent had internet access for a while.
How exactly would i use this code GRS? I'm feelin' kinda dumb here.
Add the above script into your project else every time the player loads the game you'll have to reassign the battle start sound.

Now when you want to change the battle start sound, use the event command 'Execute Script' or something like that, it's on the third tab iirc. You'll get a small text box where you can put in Ruby code to execute stuff. That's where you put in
$data_system.battle_start_se = "NAME OF NEW BATTLE START SE"
Put the name of the SE to play in the quotes, replacing NAME OF NEW BATTLE START SE (leave the quotes or it will error out) with the name of the sound file in your Audio/SE folder to play. Ignore extensions, RMVXP don't care no shits for extensions..

*edit*
Here's the combined script for ease's sake:
class Scene_Save < Scene_File
  alias write_save_data_save_battle_start_se write_save_data unless $@
  def write_save_data(file)
    write_save_data_save_battle_start_se(file)
    Marshal.dump($data_system.battle_start_se, file)
  end
end

class Scene_Load < Scene_File 
  alias read_save_data_save_battle_start_se read_save_data unless $@
  def read_save_data(file)
    read_save_data_save_battle_start_se(file)
    begin
      $data_system.battle_start_se = Marshal.load(file)
    rescue
    end
  end
end
author=GreatRedSpirit
Add the above script into your project else every time the player loads the game you'll have to reassign the battle start sound.

Now when you want to change the battle start sound, use the event command 'Execute Script' or something like that, it's on the third tab iirc.


Ok, that's what I figured in the first place. Now here's the problem. When I put the code in there, I get this error.

I'm not sure how that is coming up. I'll have to take a look at it when I get some time this weekend. There might be a script incompatibility in there too.
TrainerIntro? sounds like a Pokemon system script is conflicting (which could be likely but not really since you are aliasing the methods)
I don't have any pokemon system scripts.
Sorry, forgot to look at it on the weekend. Does this happen when you start the game (run Game.exe) or does it happen when you load a game?

(plus bump so I remember to check this tonight)
God damnit go figure it's a structure. Sorry, I fucked up :(

Use this instead:
$data_system.battle_start_se = RPG::AudioFile.new( "NAME OF NEW BATTLE START SE")

Due to dumb shit with RMXP make sure the 'RPG::AudioFile.new(' all appear on the same line. I add a space between the ( and the " so RMXP won't break up the line horribly.

I added a demo project to show it off: Download Link
Thanks GRS, works like a dream!
Pages: 1