MP cost based on Actor's Magic stat

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
For those coming from the 'new topic' column, this is a VX Ace request.

I want spells in my game to be based on the user's MAT stat. If the user's MAT is 10, then the MP cost is 10. If MAT is 20, then MP cost is 20.

I tried messing with Yanfly's Skill cost script, and while it's probably possible through a roundabout method, it does not allow me to use display the costs as evals like his MV plugin does. I thought I found a patch from estiole, but it does not appear to work.

I keep feeling like I'm close to the answer, but I can't quite put my finger on it.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Should work technically
Code:
class Game_Actor
  def skill_mp_cost(skill)
    return self.mat if skill.id == xxx
    return super
  end
end
 

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
That was easier than I expected. Thank you.

Just one thing, how can I create multiple instances of this? I know I can use || (or) for spells costing the same MP. But if I wanted other skills to be self.mat * 2. I tried to implement that as a separate line, but it all goes to whatever is displayed first (meaning it's all self.mat regardless if I have mat*2 or mat/2).

Edit: NM, I got it to work with code like this:

class Game_Actor
def skill_mp_cost(skill)
return self.mat if skill.id == 13
return self.mat if skill.id == 22
return self.mat*2 if skill.id == 27
return super
end
end
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Code:
class Game_Actor
  def skill_mp_cost(skill)
   case skill.id
   when 20
    return <formula A>
   when 21
    return <formula B>
   else # use default on database
     return super
   end
  end
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,093
Members
137,587
Latest member
Usagiis
Top