Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> No MP = Death, A small edit to the Game_Battler script to make actors die when MP=0
Psycho5554
post Feb 27 2011, 07:51 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Beginner





Psycho
02/27/2011




Introduction
To be honest I'm not a scripter, it's not my talent. But I've been using this site for awhile and I felt like I needed to give something to it. This is something I set up for my game. At first I searched for it, but no one seemed to have made a similar script. So I present to you my first script editing piece. I'm not sure how many people want their actors to die if they run out of MP but now they can, hope someone finds this useful.

Features
Quite simply make it so that when the actors or the enemies MP drops to zero, they become inflicted with the death status.
Both enemies and Actors are effected by this.
Using a skill that would cause your MP to drop to zero will result in death.
Enemy attacks that reduce MP can cause death.

HOWEVER.
If an actor starts a battle with zero MP they will not be inflicted with the death status.
When an actor dies due to MP loss, their HP will also drop to zero.

Script

Script Portion
#--------------------------------------------------------------------------
# * Change HP
# hp : new HP
#--------------------------------------------------------------------------
def hp=(hp)
@hp = [[hp, maxhp].min, 0].max
if @hp == 0 or mp == 0 and not state?(1) and not @immortal
add_state(1) # Add incapacitated (state #1)
@added_states.push(1)
elsif @hp > 0 and state?(1)
remove_state(1) unless @mp == 0 and state?(1) # Remove incapacitated (state #1)
@removed_states.push(1)
end
end
#--------------------------------------------------------------------------
# * Change MP
# mp : new MP
#--------------------------------------------------------------------------
def mp=(mp)
@mp = [[mp, maxmp].min, 0].max
if @mp == 0 or hp == 0 and not state?(1) and not @immortal
add_state(1) # Add incapacitated (state #1)
@added_states.push(1)
elsif @mp > 0 and state?(1)
remove_state(1) unless @hp == 0 and state?(1) # Remove incapacitated (state #1)
@removed_states.push(1)
end
end



Compatibility
Far as I can see it should be compatible with almost anything. Only problems I foresee if the possibility of it clashing with scripts that edit the MP state. If you find any compatibility issues let me know and I'll add it here.

Screenshot
Don't feel it necessary, but if I'm asked I'll post screenshots and a demo.



Installation
Replace the code form the start of Change HP section to the end of the Change MP section of the Default Game_Battler script. (Starts on Line 270)


Credits
You don't have to credit me, anyone could have done this with enough time, but if you did I would appreciate it ^^

Other Information
As I am not a scripter I probably won't take any requests to edit this or make it compatible with something, and to be quite honest I'm not sure if I really could anyway. Still if you post an error maybe I'll look into it. Still if I do it will be on my time frame, so your better off finding someone else or trying to do it yourself.

If you have any questions I'm happy to answer them to the best of my ability.


__________________________

Regardless of who says otherwise I support the Negi x Nodoka relationship! Shes just too cute to not love!!!


"Doing something that could get you killed is stupid, except when you survive, then it's courageous"
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Kread-EX
post Feb 28 2011, 03:16 AM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Approved, however I would recommend you to at least try to fix problems that might happen with your script. Even though, considering its size, there shouldn't arise too often.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   

Posts in this topic
- Psycho5554   No MP = Death   Feb 27 2011, 07:51 PM


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: 22nd May 2013 - 08:24 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker