MP regenaration script

Status
Not open for further replies.

Takemypassword

Villager
Member
Joined
Mar 21, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Hi everyone,

I'm looking for a script that gives the characters 0 MP at the beginning of a battle and at the start of their turn they get a fixed amount of MP to use which gets added on to their existing MP. As far as I can tell, you can do this with a percentage of yout total MP using states but i'm looking for a fixed regeneration amount. An example of this in a game is Final Fantasy Tactics Advance 2, please see the link below for a visual aid. (Skip forward to about 2:30 for the battle).

http://www.youtube.com/watch?v=ugSbEHloGVw

In the example, the characters get 10 MP at the start of every turn regardless of how much MP they already have.

At the end of the battle, I want the characters to keep the MP they haven't used for out of battle skills (Cures and whatnot) but always reset the MP back to 0 once the next battle starts.

This is a link to what i'm using at the moment, although it doesnt work correctly as it is for vx.

http://forums.rpgmakerweb.com/index.php?/topic/3379-mp-regen-system/

I am also using this little script with the above script, but these together are unreliable and skips turns/gives double MP on occasions.

#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------# This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias tds_mp_turn_regen_scene_battle_battle_start battle_start alias tds_mp_turn_regen_scene_battle_turn_end turn_end #-------------------------------------------------------------------------- # * Battle Start #-------------------------------------------------------------------------- def battle_start # Run Original Method tds_mp_turn_regen_scene_battle_battle_start # Set Game Party Members MP to 0 $game_party.members.each {|m| m.mp = 10} $game_party.members.each {|m| m.mp = 10} # Refresh Status refresh_status end #-------------------------------------------------------------------------- # * End Turn #-------------------------------------------------------------------------- def turn_end # Run Original Method tds_mp_turn_regen_scene_battle_turn_end # Increase Game Party Members HP by 1 $game_party.alive_members.each {|m| m.mp += 10} # Refresh Status refresh_status endend
If you need more information, just let me know!

Thanks
 

Takemypassword

Villager
Member
Joined
Mar 21, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Thanks for the quick reply.

I had a few problems with the script to start off with but I got it working eventually. I had a lookbut I'm not sure how to go about restricting the formula to increasing MP by X at the start of the character's turn and at no other time. Do you know what kind of formula I would have to put in?

And with the battle troop event, would I have to add the event to every troop I make? Is there a script call that can be ran to set it for every battle scene?
 

Takemypassword

Villager
Member
Joined
Mar 21, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
I can't seem to get your script to work, i'm having a problem at line 531. Got the same result in a new game.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
can you post a screenshot? the current version wasn't tested yet coz I don't have access to my RM when I made the edits...

EDIT: try this:

1) Go to the script

2) Hit CTRL+H

3) on the find part, put actor.

4) on the replace with part, put self.actor.

5) hit replace all

6) Hit CTRL+H

7) on the find part, put class.

8) on the replace with part, put self.class.
 
Last edited by a moderator:

Takemypassword

Villager
Member
Joined
Mar 21, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
I tried the fix but I get a new problem.

Line 872: can't find string "self" anywhere before EOF
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
oh wait, make sure that the Class definitions didn't get replaced... things like Class Game_Battler... it could be that they become replaced too... sorry, I just can't upload the edited script right now...
 

Oriceles

Veteran
Veteran
Joined
Apr 4, 2012
Messages
384
Reaction score
71
First Language
English
Primarily Uses
N/A
why you don't work with TP instead of this mana mode?. Just curious
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
as for setting it to 0 at start of battle, find the line in the battle scripts that initiate battle, and set character mp to zero there...

^maybe he's using it for other things...

but if you don't, I suggest just using TP... and set all skills to have the same TP addition value...
 
Last edited by a moderator:

Oriceles

Veteran
Veteran
Joined
Apr 4, 2012
Messages
384
Reaction score
71
First Language
English
Primarily Uses
N/A
as for setting it to 0 at start of battle, find the line in the battle scripts that initiate battle, and set character mp to zero there...

^maybe he's using it for other things...

but if you don't, I suggest just using TP... and set all skills to have the same TP addition value...
What he is looking is not viable since MP mechanics are based on using skills until you deplete the amount to 0; not increasing it as turn passes to use limit breakers with it.

Also what FenixFyreX did with that script for VX is convert the MP System in to a TP system. I think that what he is trying to achieve can be done ith Yanfly TP manager since you can change the TP limit and how actor gain TP in battle, also if you add fixed TRG Ex-Param trait on the database to the actors or classes the system will work as he wants, cuz the fixed amount, he can even change the "TP" vocab to "MP"  :blink:   :thumbsup-right:
 
Last edited by a moderator:

noelburgundy27

Aspiring Jack-of-All-Trades
Veteran
Joined
Oct 12, 2013
Messages
44
Reaction score
8
First Language
English
Primarily Uses
N/A
I think I have an idea for the mechanics. What are you using as a battle script?
I want to make sure it would work with that.
 

noelburgundy27

Aspiring Jack-of-All-Trades
Veteran
Joined
Oct 12, 2013
Messages
44
Reaction score
8
First Language
English
Primarily Uses
N/A
I need you to test this out on a new project without other battle scripts. (BATTLE HUDS may work if it doesn't alter turns)
I think I made something worthwhile.

 

=beginNeil Zero MP Battle v 0.1bDescription:Replicates Tactics Ogre MP Mechanics, where you start out with zero and slowlygain your MP per turn.Free to use for non-commercial games.For commercial games, a verified donation of $1.00to my Paypal (http://bit.ly/feed-calimack) will suffice.Script by California Macky a.k.a. noelburgundy27 a.k.a. mackintosh=endmodule ZERO_MP_GEN #This variable sets Base MP_Regen per turn. Use number values only. #Decimals are rounded off Base_MPGen = 10 endmodule BattleManager def self.nuke_mp $game_party.members.each do |actor| actor.mp = 0 end $game_troop.members.each do |actor| actor.mp = 0 end end def self.battle_start nuke_mp $game_system.battle_count += 1 $game_party.on_battle_start $game_troop.on_battle_start $game_troop.enemy_names.each do |name| $game_message.add(sprintf(Vocab::Emerge, name)) end if @preemptive $game_message.add(sprintf(Vocab::preemptive, $game_party.name)) elsif @surprise $game_message.add(sprintf(Vocab::Surprise, $game_party.name)) end wait_for_message end #-------------------------------------------------------------------------- # * Start Turn #-------------------------------------------------------------------------- def self.turn_start @phase = :turn clear_actor $game_troop.increase_turn make_action_orders end end #MODULE ENDclass Scene_Battle < Scene_Base include ZERO_MP_GEN def mmp_total sum = 0.0 $game_party.battle_members.each do |actor| sum += actor.mmp end $game_troop.members.each do |actor| sum += actor.mmp end return sum end def turn_start @party_command_window.close @actor_command_window.close @status_window.unselect @subject = nil BattleManager.turn_start @log_window.wait @log_window.clear end def turn_end all_battle_members.each do |battler| battler.mp += (Base_MPGen * (1.0 + battler.mrg)).round.to_i battler.on_turn_end refresh_status @log_window.display_auto_affected_status(battler) @log_window.wait_and_clear end BattleManager.turn_end process_event start_party_command_selection end end #CLASS Scene_Battle END 
If this works, let me know so I can release this. If you have suggestions and other ideas, let me know as well. I never knew I missed Engineering like this. T.T

EDIT: I think I realized too late I necro-posted. I'm so sorry. T_T
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You should learn to use Aliases rather than overwriting methods like that to increase compatibility


And yeah, this is a necropost... Sorry
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Necro-posted AND double-posted. ;)
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top