Axio Belmot 8 Posted January 8, 2013 I'm trying to make an attack like Metronome from the Pokemon series. For those who don't know, metronome takes all the moves in the game, randomly chooses one, and uses it. How would I accomplish this in an RPG? Share this post Link to post Share on other sites
Apple3.14 0 Posted January 8, 2013 Hey. Just allow that specific enemy to use every possible move / skill. Share this post Link to post Share on other sites
Axio Belmot 8 Posted January 8, 2013 Hey. Just allow that specific enemy to use every possible move / skill. No, I mean a move for the player to use. Share this post Link to post Share on other sites
DP3 188 Posted January 8, 2013 (edited) #============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #============================================================================== class Scene_Battle METRONOME_SKILL_ID = 10 # Skill ID for Metronome ONLY_ACTORS_CAN_USE_METRONOME = true # Only Actors can use this Skill? Enemies won't have their skill # changed if they selected this specific skill ID #-------------------------------------------------------------------------- # * Use Skill/Item #-------------------------------------------------------------------------- alias dp3_scn_battle_useitem_18j use_item #-------------------------------------------------------------------------- def use_item if @subject.current_action.item.is_a?(RPG::Skill) metronome_bool = @subject.current_action.item.id == METRONOME_SKILL_ID metronome_bool = metronome_bool && @subject.is_a?(Game_Actor) if ONLY_ACTORS_CAN_USE_METRONOME @subject.dp3_set_current_action(rand($data_skills.size - 1) + 1) if metronome_bool end dp3_scn_battle_useitem_18j() # Call Original Method end end #============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # A battler class with methods for sprites and actions added. This class # is used as a super class of the Game_Actor class and Game_Enemy class. #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Get Current Action #-------------------------------------------------------------------------- def dp3_set_current_action( skill_id ) @actions[0].set_skill(skill_id) end end This'll do it Edited January 8, 2013 by DP3 1 Max Campbell reacted to this Share this post Link to post Share on other sites
Apple3.14 0 Posted January 8, 2013 (edited) @Axio Belmot Sorry, I misunderstood you. I'm not sure what move would have access to the skills class. I will let you know if I come across the script. Edit: Okay, someone already posted a script for you! ^^ Edited January 8, 2013 by Apple3.14 Share this post Link to post Share on other sites
Max Campbell 3 Posted January 9, 2013 (edited) Ignore this ^^^ just me derping #============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #============================================================================== class Scene_Battle METRONOME_SKILL_ID = 10 # Skill ID for Metronome ONLY_ACTORS_CAN_USE_METRONOME = true # Only Actors can use this Skill? Enemies won't have their skill # changed if they selected this specific skill ID #-------------------------------------------------------------------------- # * Use Skill/Item #-------------------------------------------------------------------------- alias dp3_scn_battle_useitem_18j use_item #-------------------------------------------------------------------------- def use_item if @subject.current_action.item.is_a?(RPG::Skill) metronome_bool = @subject.current_action.item.id == METRONOME_SKILL_ID metronome_bool = metronome_bool && @subject.is_a?(Game_Actor) if ONLY_ACTORS_CAN_USE_METRONOME @subject.dp3_set_current_action(rand($data_skills.size - 1) + 1) if metronome_bool end dp3_scn_battle_useitem_18j() # Call Original Method end end #============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # A battler class with methods for sprites and actions added. This class # is used as a super class of the Game_Actor class and Game_Enemy class. #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Get Current Action #-------------------------------------------------------------------------- def dp3_set_current_action( skill_id ) @actions[0].set_skill(skill_id) end end This'll do it How do you set this up? I tried to use it, but it misses, and does nothing :/ Edited January 9, 2013 by Max Campbell Share this post Link to post Share on other sites
DP3 188 Posted January 9, 2013 See where it says 'METRONOME_SKILL_ID = 10' Basically That is Skill ID 10 (at the moment anyway). In the database, skill ID 10 is 'Shock'. Rename the Shock Skill name to Metronome and use it in battle, tada, metronome. Otherwise you can edit the Skill ID to something else and have that Skill Become Metronome Instead. Share this post Link to post Share on other sites
Axio Belmot 8 Posted January 9, 2013 Is it a requirement that the skill be named Metronome? 'Cause we changed it to "Spell Pool", and that's what got us the problem. Share this post Link to post Share on other sites
DP3 188 Posted January 9, 2013 No it's not required. Your skill can be called whatever you want it to be called, Leave everything in the script alone except the Skill ID (the number, not the name) and the true/false statement on the 'only actors can use the skill'. Share this post Link to post Share on other sites
Max Campbell 3 Posted January 10, 2013 Well, it still isn't working :/ Share this post Link to post Share on other sites
DP3 188 Posted January 10, 2013 (edited) If you made changes to any code, paste all of it here. Otherwise use THIS skill in battle http://img4host.net/upload/1006233750ee50590db44.png Edited January 10, 2013 by DP3 Share this post Link to post Share on other sites