SCRIPT HELP
Posts
Pages:
1
I just don't understand this scirpt well. Can someone tell me how to use this scirpt? Please!
#===============================================================================
#
# Yanfly Engine Melody - Party Influenced Music
# Last Date Updated: 2010.06.24
# Level: Normal
#
# No matter how good an RPG's battle music is, players are going to get sick and
# tired of listening to it for the zillionth time. This script won't rid RPG's
# of that problem, but will hopefully stall the process by playing randomized
# music dependent on who the player has in the active party at the start of any
# normal battle.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.06.24 - Started Script and Finished.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# To use this script, modify the module down below to create the arrays of
# music themes used by each actor. Depending on who is present in the battle,
# a random piece of music will play gathered from the music pool.
#
# To force a theme to play, just set the battle theme to something else other
# than the default battle theme. It will always choose the selected theme over
# the random themes. Once the battle theme is changed back to the default battle
# theme, then random battle themes will trigger once again.
#
#===============================================================================
$imported = {} if $imported == nil
$imported = true
module YEM
module BATTLE_THEMES
# This hash adjusts the random battle themes that may be played depending
# on whether or not the party member is present in the battle when the music
# loads up. Each array contains possible themes that may play for battle.
# Actor 0 is the common pool. Inside of that array contains all of the
# battle themes that can bebe played regardless of who's in the party.
ACTOR_MUSIC ={ # ActorID 0 must exist.
# ActorID =>
0 => , # End Common
1 => , # End Actor1
2 => , # End Actor2
3 => , # End Actor3
4 => , # End Actor3
} # Do not remove this.
end # BATTLE_THEMES
end # YEM
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#===============================================================================
# Game_System
#===============================================================================
class Game_System
#--------------------------------------------------------------------------
# overwrite method: battle_bgm
#--------------------------------------------------------------------------
def battle_bgm
return @battle_bgm if @battle_bgm != nil
former_in_battle = $game_temp.in_battle
$game_temp.in_battle = true
music_list = YEM::BATTLE_THEMES::ACTOR_MUSIC
for member in $game_party.existing_members
next unless YEM::BATTLE_THEMES::ACTOR_MUSIC.include?(member.actor_id)
result = YEM::BATTLE_THEMES::ACTOR_MUSIC
if result.is_a?(Array)
music_list |= result
elsif result.is_a?(RPG::BGM)
music_list.push(result)
end
end
$game_temp.in_battle = former_in_battle
return music_list
end
#--------------------------------------------------------------------------
# overwrite method: battle_bgm=
#--------------------------------------------------------------------------
def battle_bgm=(battle_bgm)
@battle_bgm = battle_bgm
@battle_bgm = nil if @battle_bgm == $data_system.battle_bgm
end
end # Game_System
#===============================================================================
#
# END OF FILE
#
#==============================
#===============================================================================
#
# Yanfly Engine Melody - Party Influenced Music
# Last Date Updated: 2010.06.24
# Level: Normal
#
# No matter how good an RPG's battle music is, players are going to get sick and
# tired of listening to it for the zillionth time. This script won't rid RPG's
# of that problem, but will hopefully stall the process by playing randomized
# music dependent on who the player has in the active party at the start of any
# normal battle.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.06.24 - Started Script and Finished.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# To use this script, modify the module down below to create the arrays of
# music themes used by each actor. Depending on who is present in the battle,
# a random piece of music will play gathered from the music pool.
#
# To force a theme to play, just set the battle theme to something else other
# than the default battle theme. It will always choose the selected theme over
# the random themes. Once the battle theme is changed back to the default battle
# theme, then random battle themes will trigger once again.
#
#===============================================================================
$imported = {} if $imported == nil
$imported = true
module YEM
module BATTLE_THEMES
# This hash adjusts the random battle themes that may be played depending
# on whether or not the party member is present in the battle when the music
# loads up. Each array contains possible themes that may play for battle.
# Actor 0 is the common pool. Inside of that array contains all of the
# battle themes that can bebe played regardless of who's in the party.
ACTOR_MUSIC ={ # ActorID 0 must exist.
# ActorID =>
0 => , # End Common
1 => , # End Actor1
2 => , # End Actor2
3 => , # End Actor3
4 => , # End Actor3
} # Do not remove this.
end # BATTLE_THEMES
end # YEM
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#===============================================================================
# Game_System
#===============================================================================
class Game_System
#--------------------------------------------------------------------------
# overwrite method: battle_bgm
#--------------------------------------------------------------------------
def battle_bgm
return @battle_bgm if @battle_bgm != nil
former_in_battle = $game_temp.in_battle
$game_temp.in_battle = true
music_list = YEM::BATTLE_THEMES::ACTOR_MUSIC
for member in $game_party.existing_members
next unless YEM::BATTLE_THEMES::ACTOR_MUSIC.include?(member.actor_id)
result = YEM::BATTLE_THEMES::ACTOR_MUSIC
if result.is_a?(Array)
music_list |= result
elsif result.is_a?(RPG::BGM)
music_list.push(result)
end
end
$game_temp.in_battle = former_in_battle
return music_list
end
#--------------------------------------------------------------------------
# overwrite method: battle_bgm=
#--------------------------------------------------------------------------
def battle_bgm=(battle_bgm)
@battle_bgm = battle_bgm
@battle_bgm = nil if @battle_bgm == $data_system.battle_bgm
end
end # Game_System
#===============================================================================
#
# END OF FILE
#
#==============================
Hmm...
That version looks different than mine... You'll have better luck with this one:
That version looks different than mine... You'll have better luck with this one:
#===============================================================================
#
# Yanfly Engine Melody - Party Influenced Music
# Last Date Updated: 2010.06.24
# Level: Normal
#
# No matter how good an RPG's battle music is, players are going to get sick and
# tired of listening to it for the zillionth time. This script won't rid RPG's
# of that problem, but will hopefully stall the process by playing randomized
# music dependent on who the player has in the active party at the start of any
# normal battle.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.06.24 - Started Script and Finished.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# To use this script, modify the module down below to create the arrays of
# music themes used by each actor. Depending on who is present in the battle,
# a random piece of music will play gathered from the music pool.
#
# To force a theme to play, just set the battle theme to something else other
# than the default battle theme. It will always choose the selected theme over
# the random themes. Once the battle theme is changed back to the default battle
# theme, then random battle themes will trigger once again.
#
#===============================================================================
$imported = {} if $imported == nil
$imported["PartyInfluencedMusic"] = true
module YEM
module BATTLE_THEMES
# This hash adjusts the random battle themes that may be played depending
# on whether or not the party member is present in the battle when the music
# loads up. Each array contains possible themes that may play for battle.
# Actor 0 is the common pool. Inside of that array contains all of the
# battle themes that can bebe played regardless of who's in the party.
ACTOR_MUSIC ={ # ActorID 0 must exist.
# ActorID => [BGM, BGM, BGM]
0 => [RPG::BGM.new("Battle1", 100, 100),
RPG::BGM.new("Battle2", 100, 100)
], # End Common
1 => [RPG::BGM.new("Battle3", 100, 100),
RPG::BGM.new("Battle4", 100, 100),
], # End Actor1
2 => [RPG::BGM.new("Battle5", 100, 100),
RPG::BGM.new("Battle6", 100, 100),
], # End Actor2
3 => [RPG::BGM.new("Battle7", 100, 100),
RPG::BGM.new("Battle8", 100, 100),
], # End Actor3
4 => [RPG::BGM.new("Battle9", 100, 100),
RPG::BGM.new("Battle10", 100, 100),
], # End Actor3
} # Do not remove this.
end # BATTLE_THEMES
end # YEM
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#===============================================================================
# Game_System
#===============================================================================
class Game_System
#--------------------------------------------------------------------------
# overwrite method: battle_bgm
#--------------------------------------------------------------------------
def battle_bgm
return @battle_bgm if @battle_bgm != nil
former_in_battle = $game_temp.in_battle
$game_temp.in_battle = true
music_list = YEM::BATTLE_THEMES::ACTOR_MUSIC[0]
for member in $game_party.existing_members
next unless YEM::BATTLE_THEMES::ACTOR_MUSIC.include?(member.actor_id)
result = YEM::BATTLE_THEMES::ACTOR_MUSIC[member.actor_id]
if result.is_a?(Array)
music_list |= result
elsif result.is_a?(RPG::BGM)
music_list.push(result)
end
end
$game_temp.in_battle = former_in_battle
return music_list[rand(music_list.size)]
end
#--------------------------------------------------------------------------
# overwrite method: battle_bgm=
#--------------------------------------------------------------------------
def battle_bgm=(battle_bgm)
@battle_bgm = battle_bgm
@battle_bgm = nil if @battle_bgm == $data_system.battle_bgm
end
end # Game_System
#===============================================================================
#
# END OF FILE
#
#===============================================================================
# This hash adjusts the random battle themes that may be played depending
# on whether or not the party member is present in the battle when the music
# loads up. Each array contains possible themes that may play for battle.
# Actor 0 is the common pool. Inside of that array contains all of the
# battle themes that can bebe played regardless of who's in the party.
ACTOR_MUSIC ={ # ActorID 0 must exist.
# ActorID => [BGM, BGM, BGM]
0 => [RPG::BGM.new("Battle1", 100, 100),
RPG::BGM.new("Battle2", 100, 100)
], # End Common
1 => [RPG::BGM.new("Battle3", 100, 100),
RPG::BGM.new("Battle4", 100, 100),
], # End Actor1
2 => [RPG::BGM.new("Battle5", 100, 100),
RPG::BGM.new("Battle6", 100, 100),
], # End Actor2
3 => [RPG::BGM.new("Battle7", 100, 100),
RPG::BGM.new("Battle8", 100, 100),
], # End Actor3
4 => [RPG::BGM.new("Battle9", 100, 100),
RPG::BGM.new("Battle10", 100, 100),
], # End Actor3
} # Do not remove this.
ActorID refers to the ID of the Heroes in question in the database. 1 refers to Ralph in an RTP database, for example. ActorID 0 refers to a "common pool", which is basically battle themes that are always played regardless of who is in the party.
Within each of the ActorID arrays is where you choose which musical tracks play in battle. "Battle1" and so forth are referring to the RTP Battle# MIDI files, and is what you change. For example, if you want pieces of music called "FirehawkBattle" and "RMNCombat" to randomly play in battle for parties with ActorID 1 in them, you'd type:
1 => [RPG::BGM.new("FirehawkBattle", 100, 100),
RPG::BGM.new("RMNCombat", 100, 100),
], # End Actor1With that as a guideline, go on and do whatever it is you want with the script.
thank you is there anyway to force a battle music to play on who's the leader of the party is? Now I got a bigger problem. next unless YEM::BATTLE_THEMES::ACTOR_MUSIC.include?(member.actor_id)
this part of the scirpt keeps giving me a error why and how do i fix it? I'm using this or atleast hope to use this with the rpg tankeia scirpt or whatever that scirpt is called.
this part of the scirpt keeps giving me a error why and how do i fix it? I'm using this or atleast hope to use this with the rpg tankeia scirpt or whatever that scirpt is called.
Pages:
1















