Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> Yanfly Custom MP Use, Need help figuring out how to add custom MP costs.
nohmaan
post Feb 19 2012, 02:14 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 68
Type: Developer
RM Skill: Skilled




In order to finish my overly complicated games (too many skills), I've condensed the skills into smaller lists so instead of cure I-IV I now have Cure that scales with level.

However, with the BEM I can only assign a skill cost as MP or MP%. Is there a way to make a skill cost both a set MP and an additional percent. I.e. cure should cost 5 and 2%, etc?


__________________________
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Feb 19 2012, 04:44 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,525
Type: Scripter
RM Skill: Undisclosed




The 'how to

First, go to line 815 in the Battle Engine Melody III


And straight after that line insert the following code:

CODE
      
    #------------------------------------------------------------------------
    # <cost: x+y% maxmp>
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # This tag allows you to create skills that cost a percentage of the
    # battler's MaxMP. That said, this value will always fluctuate depending
    # on the MaxMP of the battler.
    # --- Example --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # <cost: 20% maxmp>
    #------------------------------------------------------------------------
    when /(\d+)\+(\d+)([%])[ ](?:MP|SP|MAXMP|MAXSP)/i
      #---
      calc_cost = $1.to_i + maxmp * $2.to_i / 100
      calc_cost = apply_skill_cost_changes(skill, calc_cost, "MP")
      calc_cost /= 2 if half_mp_cost
      #---
      text_cost = calc_cost.to_s
      use_icon = Icon.mp_cost
      suffix = hash[:mp_suffix]
      colour = hash[:mp_colour]
      font_size = hash[:mp_size]
      can_use = @mp >= calc_cost
      @mp -= calc_cost if perform


Like so:


Then you can create items with the tag:
CODE
<cost: 10+10% mp>

like so:

Which uses 10 MP, and then an additional 10 percent


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
nohmaan
post Feb 19 2012, 09:02 PM
Post #3


Level 5
Group Icon

Group: Member
Posts: 68
Type: Developer
RM Skill: Skilled




Perfect, thank you very much good sir!


__________________________
Go to the top of the page
 
+Quote Post
   
nohmaan
post Feb 21 2012, 03:24 AM
Post #4


Level 5
Group Icon

Group: Member
Posts: 68
Type: Developer
RM Skill: Skilled




Maybe I'm doing something wrong but it's not working?

When I put in <cost: 4+2% mp> or <cost: 4+2% maxmp> it ends up costing 1MP with 100 Max MP...?


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 12:57 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker