Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Eventing]Sacrifice Skill, Give up HP for SP
RzrBladeMontage
post Dec 9 2009, 08:44 PM
Post #1


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




RPG Maker Version: XP
Difficulty Level: 2/10

Well, seeing as how I needed this skill for my own game, I figured that I would share it with all of you. It's a very simple common event that uses variables and it's very easy to understand.
[Show/Hide] Step One

First, go to your common events tab and create a new common event and call it "Sacrifice." Now you need to figure out which of your characters will be the one to gain this skill, I recommend using a black magic user. For this tutorial, I'll use the character "Rid." Go to the skills tab and create a skill and call it "Sacrifice," and under the "Common Event" drop down box, select your Sacrifice common event. You can pick whatever skill icon and animation you want. For the SP Cost and Power, keep them both at zero and for the rest of the ATK-F's and what-not, just put them all at 100. Now go to your classes tab and make sure that Sacrifice is linked with the character of your choice, in my case, "Rid" is my chosen character.

[Show/Hide] Step Two

Now go back to your common event, here we'll start to put this skill together. Create 2 Variables and call them Sacrif. HP and Sacrif. SP. You'll want to start off by making Sacrif. HP equal to your character's HP. Now add a conditional branch checking to see if Sacrif. HP is equal to 1. If it is, add a text message saying something like "Not Enough HP!" and then add the "Exit Event Processing" choice. Under the Else part of the conditional branch, have your Sacrif. HP variable divided by 2. Now Make your Sacrif. SP equal to Sacrif. HP and then have Sacrif. SP divided by 2 as well. Now subtract the HP of your character by the Sacrif. HP variable and add the SP of your character by the Sacrif. SP variable.



Getting confused? I'll break it down for you.

The Sacrif. HP variable gets the HP of your character. Let's say his current HP is 100. The event then checks to make sure his HP is above 1, and if it is it'll let it continue processing. Now we're dividing the characters HP, in this case it's 100, by half, which makes the HP 50. Now we're making the Sacrif. SP equal to Sacfic. HP, which is 50. Then the Sacrif. SP gets divided in half, which makes it 25. Now when we subtract the characters HP by Sacrif. HP, making the characters HP now 50, and we add to the characters SP by Sacrif. SP, which is 25. Basically what this event does it takes the users HP, divides it in half, and then takes that away from the user, and then takes the amount of HP taken away and divides that by half, and then adds that amount to the users SP.

Sorry if I confused anyone with all this, it's supposed to be a simple event lol. I hope you all enjoy!


__________________________





Go to the top of the page
 
+Quote Post
   
mudducky
post Jan 21 2010, 02:59 PM
Post #2


Level 19
Group Icon

Group: Revolutionary
Posts: 392
Type: None
RM Skill: Beginner




I just worked this out on VX recently, but it's a very interesting way to use events. Thank you for the tutoiral RzrBladeMontage. smile.gif
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 - 07:55 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker