Change actors default attack animation

I was wondering if anyone could help me out with something simple (at least somewhat) 

Im trying to make a code that changes the actors default attack animation 

The code I used in vx ace works great but not in MV 


I was wondering what id have to do for this script to make it mv friendly, thank you


#==============================================================================
# ? Actor Alt Attacks
#------------------------------------------------------------------------------
# ?this script allows you to define a skill to be used for the main attack
#  for each actor the default skill is skill id 1 this can be changed
#==============================================================================


class Game_BattlerBase
  
#--------------------------------------------------------------------------
# ? Get the ID of the skill for normal attacks
#--------------------------------------------------------------------------
  def attack_skill_id
    if @actor_id == 1 # Kenmo
      return 111 # Wind
    end
  else
    return 12 # Attack
  end
  end
 
I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.


MV uses Javascript, so you can't just take a script that worked in VX or Ace and pop it into MV.


Something like this might work (I'm not testing this, so if it gives you any errors, it could be a syntax thing or maybe I've got a function name wrong)

Code:
Game_Actor.prototype.attackSkillId = function() {
  if (this._actorId === 1) // Kenmo
    return 111; // wind
  else
    return 12; // attack
};



You have an extra end in your code.  I've also put this into Game_Actor rather than Game_BattlerBase, because only Game_Actor has an actor Id.  I don't know if Game_Enemy also uses the attackSkillId - I suspect it does, so you would want to use the default method for selecting them.  Note - I haven't even checked to see if attackSkillId is the correct method to return the animation - I would assume based on the name, that it's returning the skill and not the animation, so unless you've done other changes that you haven't shown us, you might be off on the wrong tangent altogether.  My code snippet assumes you've done your homework and found the correct function to change.


I'm sure there are also plugins that let you do this, so you don't even have to write your own unless you really want to go through the exercise.

Original thread: https://forums.rpgmakerweb.com/threads/change-actors-default-attack-animation.56992/