MP Costs increase every 10 Levels

it should be

Code:
if self.actor?
using it without ? seems to work fine for me... anyway the thing is he still needs to do it for the custom cost part (the one that actually shows the costs)
actor is only defined in Game_Actor and returns $data_actors[@actor_id] so it won't work if referencing an enemy. but in this case it would work yes.
That is exactly why it is used as a boolean for the if... if it doesn't exist, the statement returns false... I never used it to reference anything on the codes I posted.
if it doesn't exist it will error not return false.
it doesn't seem to do so for me and you can always add a ? to be sure...

most battler scripts that I've seen that needs to check if it's actor or not uses that check...

even Game_Interpreter uses checks like that

actor = $game_actors[@params[1]] if actorbasically, if the object after an "if" doesn't exist, the game takes it as the same as false... if it exists it takes it as truenext time, try things out first will you?
add this below materials

class RPG::UsableItem:😀amage  def eval(a, b, v)    [Kernel.eval(@formula), 0].max * sign  endendand attack an enemy with this formula

Code:
if b.actor;100;else;50;end
why would I even need to add that? that is already defined by default...


anyway I tried it, works fine for me, no errors.


and in case you missed the edit, Even Game_Interpreter uses the check "if actor"


and battler scripts out there uses if actor or if actor? so if what you say is true (that it will error if it doesn't exist), care to explain to me why they work?
the default damage eval method has a rescue.

in all those cases actor has already been declared as a local variable.
Eh? My scripts doesn't declare actor as a local variable, and I use if self.actor or self.actor? as a check if the battler is actor or not. and it works
actor is being declared right there...

actor? is a valid method for all battlers

actor returns $data_actors[@actor_id] and only works for objects that come from Game_Actor.

you have not used if self.actor in any of your scripts 

you have used if self.actor? in 1 of your scripts 
If you want to do it directly the method you want is in Game_BattlerBase (line 638 or thereabouts):

#--------------------------------------------------------------------------# * Calculate Skill's MP Cost#-------------------------------------------------------------------------- def skill_mp_cost(skill) (skill.mp_cost * mcr).to_i endChange the body of the method so that it takes actor level into consideration
@Mouser So you are saying that I can alter that method somehow to take in to consideration the actors level? But this would affect every skill..
@Mouser So you are saying that I can alter that method somehow to take in to consideration the actors level? But this would affect every skill..
Yes, start a blank script which you place right below Materials (where it says "insert here"):

class Game_BattlerBase def skill_mp_cost(skill) <insert your code> endendand your method now replaces the 'stock' version. You can make it apply equally to every skill, you can use conditionals to have it work one way if an actor uses it and other for the Game_Enemy's. You can have it treat different skills differently, you can even add more parameters to the method call if you want - whatever your heart desires. Just stick it between the def and the end.

If you always overwrite the game methods directly and add your own when needed you never have to worry about things like script compatibility and other issues that can come up when mixing blocks of code from different sources. All is in harmony and peace and Zen find their homes in your code.

Of course, this assumes you know Ruby syntax and the basics of Object Oriented design, like the difference between a variable and a method (actor vs actor?) and a class and an instance and things of that nature. But hey, you gotta start somewhere 🙂
I'm not fluent in Ruby, but I have taken some Java so I know the basics of Objects, variables vs methods, etc. I usually just look up examples online when I need to do something similar to this.
I'm not fluent in Ruby, but I have taken some Java so I know the basics of Objects, variables vs methods, etc. I usually just look up examples online when I need to do something similar to this.
This is the _perfect_ type of method for you to start learning on.

No inheritance, it takes one parameter, returns one value, and does a bit of math in between.

You can also see exactly how it's working by watching your MP bar in the game so you know if it's doing what you want it to.
Alright, I will mess around with it. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/mp-costs-increase-every-10-levels.24922/