RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Mime Skill

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Mime Skill
Version: 1.0
Author: modern algebra
Date: April 22, 2010

Version History


  • <Version 1.0> 04.22.2010 - Original Release

Description


This script allows you to make mime skills, meaning that the person using such a skill will perform the same action as the ally who went before him/her.

Features

  • Allows you to make a skill where the user will perform the same action as the ally before him/her did
  • Will consume only the MP set for the mime skill, even if the mimed action is itself another skill
  • Will consume an extra instance of an item if the previous action was item use. Will do nothing if out of that item

Instructions

Paste the script in its own slot in the Script Editor, below Materials and above Main

Script


Code: [Select]
#==============================================================================
#    Mime Skill
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: April 22, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to make mime skills, meaning that the person using
#   such a skill will perform the same action as the ally who went before
#   him/her.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script below Materials and above Main in the Script Editor.
#
#    To set up a mime skill, just put the code: \mime in the notebox. It is
#   recommended that you set the scope to None, since the mime skill will
#   use the same targetting mechanism as the action it is miming.
#==============================================================================

#==============================================================================
# ** RPG::Skill
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new method - mime?
#==============================================================================

class RPG::Skill
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Mime Skill?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mime?
    return self.note[/\\MIME/i] != nil
  end
end

#==============================================================================
# ** Game_Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    attr_accessor - km_override_mp_cost
#    attr_writer - action
#    aliased method - calc_mp_cost
#==============================================================================

class Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :km_override_mp_cost
  attr_writer   :action
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Calc MP Cost
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modlba_ken_calcmp_7ux1 calc_mp_cost
  def calc_mp_cost (*args)
    return @km_override_mp_cost unless @km_override_mp_cost.nil?
    return modlba_ken_calcmp_7ux1 (*args) # Run Original Method
  end
end

#==============================================================================
# ** Game Unit
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new attr_accessor :km_last_action
#==============================================================================

class Game_Unit
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :km_last_action
end

#==============================================================================
# ** Scene_Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - execute_action
#==============================================================================

class Scene_Battle
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Execute Battle Actions
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_kntn_mimic_exact_6yh1 execute_action
  def execute_action (*args)
    # If using a mime skill
    if @active_battler.action.skill? && @active_battler.action.skill.mime?
      last_action = @active_battler.action.friends_unit.km_last_action.dup
      if last_action.nil? || (last_action.item? && !$game_party.has_item? (last_action.item))
        # Do nothing
        @active_battler.action.clear
        @active_battler.action.kind = 0
        @active_battler.action.basic = 3
      else
        # Do last action
        @active_battler.km_override_mp_cost = @active_battler.calc_mp_cost (@active_battler.action.skill)
        @active_battler.action = last_action
        @active_battler.action.battler = @active_battler
      end
    else
      # Set this action to the last action of this unit
      @active_battler.action.friends_unit.km_last_action = @active_battler.action.dup
    end
    ma_kntn_mimic_exact_6yh1 (*args) # Run Original Method
    if @active_battler.km_override_mp_cost
      @active_battler.mp -= @active_battler.km_override_mp_cost unless @active_battler.action.skill?
      @active_battler.km_override_mp_cost = nil
    end
  end
end

Credit


  • modern algebra

Thanks

  • kentona, for the request

Support


Please post in this topic at RMRK if you have any issues with the script.

Known Compatibility Issues

It will not work with some exotic battle systems, particularly ones that do not use a similar Scene_Battle script or execute actions quite differently.
« Last Edit: April 23, 2010, 12:23:21 AM by modern algebra »

**
Rep:
Level 83
8-bit games and LEGO.
So I did some quick tests in a new project and I ran into some odd behaviour.  I used Mime every round (for the most part).

-In the first round of the battle, everything worked as expected.  The heroes executed their skills or attacks or guard and the Mime copied the last action.
-In the subsequent rounds, one of 2 things would happen:
1) Only 1 person would act and the rest of the party would do nothing.  The person was casting a Heal skill.
2) Everyone would mime the last action from the previous round.  So if the Mime guarded, everyone on the next round would guard (except for the person who was mimicked, I think).

On subsequent rounds, if the Mime did not use the Mimic skill (so he attacked or guarded or used an item) everyone behaved correctly.

EDIT:
When only 1 person acts, it always seems to be party member #3 (Bennett by default).
« Last Edit: April 22, 2010, 10:49:48 PM by kentona »

..:: Full game is released.  Download it now! ::..

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm, well I changed a few things in the code since I first posted it. Grab it and see if the issues still exist.

I can't guarantee that will fix it as I was unable to reproduce the error, but it might do the trick. If not, I will try again to see what's going wrong.
« Last Edit: April 23, 2010, 01:16:58 AM by modern algebra »

**
Rep:
Level 83
8-bit games and LEGO.
I made a mistake when I was testing - I had Yanfly's Core Fixes script installed.  When I started a fresh game it seems to be working properly.

http://rpgmaker.net/users/kentona/locker/yanfly_core_fixes.txt

I will have to try to figure out where the conflict occurs  :-\

EDIT:
Okay, I can't recreate the error anymore.  I am not sure what is going on.

Thanks for the script!  I really appreciate it.

EDIT2:
I just noticed that you edited your post sometime ago and fixed up the script.  I guess it worked...?  :)
« Last Edit: April 23, 2010, 02:00:24 AM by kentona »

..:: Full game is released.  Download it now! ::..

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
good to hear! It was kind of a dumb error on my part I think.

**
Rep:
Level 81
Dark Matter
The last mime script that I saw was a total fail.

But this one of yours work fine^^

Very nice job.

(maybe later you can upgrade it to make an mime in the opponent move^^)

See ya

**
Rep: +0/-0Level 83
Hrmm... Does this script work with Tankentai SBS with ATB?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I don't know. Maybe, but it depends on how much of the action execution was retained by it. Try it out and see.

@LuKo - I haven't tested it, but I don't see why it wouldn't also work for opponents. Unless you mean that a party member could mime the action of an opponent. I can do that if you want me to.

**
Rep:
Level 82
This is amazing!



**
Rep: +0/-0Level 67
RMRK Junior
Is there a way to set this up so that a user can select an enemy and mimic the last skill they had used?