random game over music plugin?

judg3

Villager
Member
Joined
Jul 31, 2020
Messages
8
Reaction score
2
First Language
romanian
Primarily Uses
RMVXA
so let's say i have a pool of 12 audio files, okay? and i'd like to have one chosen randomly to play for the game over screen.
is there any plugin/script that allows such a thing?
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,777
Reaction score
5,205
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
55
Reaction score
10
First Language
português
Primarily Uses
RMVXA
* * * removed, use code below * * *
 
Last edited:

judg3

Villager
Member
Joined
Jul 31, 2020
Messages
8
Reaction score
2
First Language
romanian
Primarily Uses
RMVXA
is there a way to make a sound have a very rare chance of playing?
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
55
Reaction score
10
First Language
português
Primarily Uses
RMVXA
is there a way to make a sound have a very rare chance of playing?
probably... i'll try to code it tomorrow, but no promises.
do you need many files to have a rare chance at appearing, or just one?
 

judg3

Villager
Member
Joined
Jul 31, 2020
Messages
8
Reaction score
2
First Language
romanian
Primarily Uses
RMVXA
probably... i'll try to code it tomorrow, but no promises.
do you need many files to have a rare chance at appearing, or just one?
just one
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
55
Reaction score
10
First Language
português
Primarily Uses
RMVXA
Code:
#==============================================================================
# ** Game Over Song Shuffle [VXA]
#------------------------------------------------------------------------------
# Version: 1.1
# Author: zeroscares
# Thread: https://bit.ly/3mdxuJM
#==============================================================================
# Description: 
#------------------------------------------------------------------------------
# Shuffles between song files for the Game Over screen.
# Has the option to add a file that has a much lower chance at playing.
#==============================================================================
# Instructions:
#------------------------------------------------------------------------------
# Paste below Materials above Main. Customize the module below. 
#==============================================================================
# Terms:
#------------------------------------------------------------------------------
# > I'm not adding extra features or compatibility fixes
# > Crediting is optional. Free for all VXA games, edit as you wish.
#==============================================================================
module SCARES_GAMEOVER
  #--------------------------------------------------------------------------
  SONG_EXTENSION = "gameover"
  # Name your game over songs (song extension text + number)
  # example: "gameover1", "gameover2", ...
  #--------------------------------------------------------------------------
  LOWCHANCESONG = "randomsong" 
  # example: write "songfilename", not "songfilename.mp3"
  #--------------------------------------------------------------------------
  RANDOMCHANCE = 10
  # By default, low chance song has a 1 in 10 chance at playing.
  #--------------------------------------------------------------------------
  REGULARCHANCE_SONG_COUNT = 12
  # How many regular-chance songs do you need to be shuffled?
  # This excludes the song in LOWCHANCESONG.
  #--------------------------------------------------------------------------
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================
class Scene_Gameover < Scene_Base
  def play_gameover_music
    @lowchance = rand(SCARES_GAMEOVER::RANDOMCHANCE)
    p @lowchance
    if @lowchance == 1
      @gameoversong = SCARES_GAMEOVER::LOWCHANCESONG
      #p "low chance song"
    else
      @songnumber = rand(SCARES_GAMEOVER::REGULARCHANCE_SONG_COUNT) + 1 
      @gameoversong = SCARES_GAMEOVER::SONG_EXTENSION + @songnumber.to_s
    end
    RPG::BGM.stop
    RPG::BGS.stop
    RPG::BGM.new(@gameoversong, 100, 100).play
  end
end
you can say thanks now :p
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I made some sideview closets for MV!
You can find them in my MV resource thread.
People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
105,507
Messages
1,014,276
Members
137,178
Latest member
negociant
Top