#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Metronome Skill in Battle
# Author: DiamondandPlatinum3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Description:
#
# This script puts in a skill similar to pokemon's metronome, in the sense
# that skills will be chosen at random to be used if this skill is used.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
# Instructions:
#
# Simply create a new skill in the database and call it whatever you want,
# set the scope to random enemies (so you don't actually have to choose an
# enemy in battle when trying to use this skill) then set the skill ID below.
#
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module DiamondandPlatinum3
module MetronomeSkill
# Skill ID for Metronome
METRONOME_SKILL_ID = 84
# Skill IDs that you do not wish to be selected with Metronome.
# If you want all skills to be available, simply make the below empty
NON_USABLE_SKILLS = [ 49, 50, 51, ]
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Aliased Method: Execute Battle Action: Skill
#--------------------------------------------------------------------------
alias metronome_scnbat_eas_ihg execute_action_skill
def execute_action_skill(*args)
skill = @active_battler.action.skill
if skill.id == DiamondandPlatinum3::MetronomeSkill::METRONOME_SKILL_ID
text = @active_battler.name + skill.message1
@message_window.add_instant_text(text)
unless skill.message2.empty?
wait(10)
@message_window.add_instant_text(skill.message2)
end
# Setup Metronome
@active_battler.dp3_set_metronome_skill_used(true)
@active_battler.action.set_skill(rand($data_skills.size - 1) + 1) while(!metronome_skillselect_ok?())
end
metronome_scnbat_eas_ihg(*args) # Call Original Method
end
#--------------------------------------------------------------------------
# * Metronome Selected Skill OK?
#--------------------------------------------------------------------------
def metronome_skillselect_ok?()
return false if @active_battler.action.skill_id == DiamondandPlatinum3::MetronomeSkill::METRONOME_SKILL_ID
for id in DiamondandPlatinum3::MetronomeSkill::NON_USABLE_SKILLS
return false if @active_battler.action.skill_id == id
end
return true
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Alised Method: Calculation of MP Consumed for Skills
#--------------------------------------------------------------------------
alias metronome_gamebat_cmpc_ihg calc_mp_cost
def calc_mp_cost(skill)
skill = $data_skills[DiamondandPlatinum3::MetronomeSkill::METRONOME_SKILL_ID] if @dp3_metronome_skill_used
dp3_set_metronome_skill_used(false)
metronome_gamebat_cmpc_ihg(skill) # Call Original Method
end
#--------------------------------------------------------------------------
# * Set Metronome Used? Instance Variable
#--------------------------------------------------------------------------
def dp3_set_metronome_skill_used( set )
@dp3_metronome_skill_used = set
end
end
Ported my VXA Metronome Snippet for you, not sure if it does what you want.
Also did a video showing how to use it... works the same for VX.
Well if you have the demo Ireleased today it should be in there, all the way at the bottom below everything including your spelling fix script. Nothing else added at all
Not currently at the home computer, but I seem to remember having followed just those directions... perhaps it's a fluke; I modified the script and used the battle test under the enemies tab without saving, closing and opening back up ( it seems Vista has a way of effing up one's programming if you don't do that) so I shall look again, but your test gives me hope.
I do know that I set the met skill to the generic Asyura skill, and included the Asyura that actually does something as the ONLY skill it can select. That skill does have an animation. Unless I did that wrong... I set it up like an array:
NON_USABLE_SKILLS = [ 1 ... 276, 278...400 ]
with the missing number being the Asyura skill that does something. I got the healing but no animation. I'm sure it's something small I overlooked.
Heh, yeah... lots of blank spaces that I fill every time I make a new monster! Lots of non-animated skills because I'm not that far yet! In time, those will both be rectified.
Anyhow, thanks again for the help. WhenI get this working in about 6 hours (at work now) I'll let you know.