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] Creating a Damage Formula
Rukiri
post Aug 20 2009, 04:19 PM
Post #1


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,722
Type: Scripter
RM Skill: Advanced




In Rm2k3/xp/vx you need to make a dividend of numbers, ones, tens, hundreds, thousands etc.

But the actual damage formula is quite simple and it goes like this.

Let's set up some variables.

XXX: Damage = 0;
XXX: Hero_STR = Name Strength
XXX: Hero_DEF = Name Defence
XXX: AI_STR = 4;
XXX: AI_DEF = 6;

In a game you need to know NOT to make a AI to strong or too week basically if it's a AI that's semi strong just add 1 or 2 from his stength variable.

But let's take into account if the AI is intelegent, if so make sure the number is what it needs to be, the ai can be extremely intellegent but weak. But this can also be a very hard to hit AI meaning you have 1-5 chances of hitting the ai. But if the AI is as smart as the Hero the chances of hitting are increased.

Now that we know how to take stats into account let's create that bloody formula.

The Damage variable will be used in just about every line here.

CODE:

CODE
XXX: Damage equal to Hero_STR
XXX: Damage Divided by AI_DEF
XXX: Damage Times 3 by AI_STR
XXX: Damage Mod 3
XXX: Damage Minus AI_INTEL
XXX: Damage Add 5


Than you go ahead and just setup this formula with the dividend and there you go, a damage formula!

Note that you can go much farther with the formula than that, this was only for the tutorial. You can make any damage formula as complex as you need.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Rukiri
post Aug 22 2009, 11:55 PM
Post #2


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,722
Type: Scripter
RM Skill: Advanced




This is only the damage formula, take note that you have to create speed and intel and hit chance formulas for your AIs and Ally Ais.

Btw, this is for the main hero or whatever hero that's in your party, it's the same around for Enemy Ais, so when the code is done, it's done. It's just a matter of copy and paste afterwords.

Enjoy!


for showing multiple damages have a showing variable and create 10 damage events, yea I know a lot but if your firing a Kamehameha wave you want to see it continue right? and you only see about 10 anyway.

Example:

if damage_count = 0
damage 1
end
else if damage_count = 1
damage 2
end

etc.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
DeadDemonDude
post Aug 22 2009, 11:59 PM
Post #3


Level 5
Group Icon

Group: Member
Posts: 73
Type: Artist
RM Skill: Intermediate




QUOTE (Rukiri @ Aug 23 2009, 12:55 AM) *
This is only the damage formula, take note that you have to create speed and intel and hit chance formulas for your AIs and Ally Ais.

Btw, this is for the main hero or whatever hero that's in your party, it's the same around for Enemy Ais, so when the code is done, it's done. It's just a matter of copy and paste afterwords.

Enjoy!



Dude this is awesome! It helps make battles like rpg games and less like you hit with 25 damage every single time, thats kinda lame.
But with this its awesome!


__________________________
i want to die like my grandpa, in my sleep. (not fearing for my life, like all the passangers in his car) ~Zach Schulze

Dont soliciate me, and I wont soliciate you, trust me you dont want that. I never give up.
Bacon Bandage Productions is working on:




[Show/Hide] I chose a pen....

Go to the top of the page
 
+Quote Post
   
Rukiri
post Aug 23 2009, 12:08 AM
Post #4


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,722
Type: Scripter
RM Skill: Advanced




If you want more than 3 random damage counts just make more, just remember the last one is critical. It's best to create your speed formulas and intel formulas soon after.

I'll do speed right now as an example.

if [XXX] Rabite SPD >= M_Hero SPD
[XXX] Rabite avoid chance [0-3]
end
else if
[XXX] Rabite avoid chance [0-10]
end

It's not complete but it's the skeleton and if the enemy AI has a higher speed it's avoid chance is increased, but don't forget the Hero(s) can use speed boost items in game so the enemy might not ALWAYS have a upper hand.

And a tip on Bosses they usually have better stats than the Hero's do, there usually around 2-5 LVs higher, course the first boss is always 1 above.

If you need more Formulas for a RPG just ask, make sure there battle related.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Rukiri
post Aug 23 2009, 07:48 PM
Post #5


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,722
Type: Scripter
RM Skill: Advanced




Part 3: Showing the damage as numbers!

First off you need to know how to split the variables, also a quick note you're going to need a variable for each damage object, so like damage1 ones etc.

http://kobrasrealm.net/view.php?6

Okay, good we got that crap out of the way.

Now it's really up to you if you want to see 'Damage' as numbers but it's a cool effect and a lot of ABS systems use it. Come to think of it, all battle systems use it!

Now the way they're shown is up to you, in some games you'll see a damage of 15 but see 0015 so we need to set some IF statements to prevent such things, and it's always best to go from highest to lowest but that's just how I role/code.

CODE
Comment: Thousands

if [XXX: Damage Thous] = 1

else
end case
^. same just go til 9

Comment: Hundreds

if [XXX: Damage Thous] >=1
if [XXX: Damage Hund] = 0

end case
end case

^. Just repeat the Damage Hundreds variables with else cases until you reach 9
But remember the Damage thousands variable is only connected to the (0) not to 1-9!

Comment: Tens

if [XXX: Damage Hund] >=1
if [XXX: Damage Tens] = 0

end case
end case
if [XXX: Damage Tens] = 1

else
end case

Same as above, the 0 is only connected to the Hundreds variable, 1-9 is connected to the tens and ones variables.

Comment: Ones

Common knowledge, no need for a check for the ones value.


Pretty straight forward.

If you can't follow that maybe you can follow RM2k/3/XP/VX Event Script.



__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Kipe
post Aug 26 2009, 09:50 PM
Post #6


Level 3
Group Icon

Group: Member
Posts: 34
Type: Event Designer
RM Skill: Masterful




blink.gif Just saw this thread! I am so bad at navigating the forums on this website. Anyway! The above event system looks almost exactly how I made mine! Except I used labels to help it process a small bit faster, because I may still have a lot to add on to mine in order to get multiple damages to display in succession. I'm still working on resources most of the time though. IMO contest to see whose evented ABS is better hahah.

Also I will probably end up changing this anyway so that 2 and 1 digit numbers are centered. But that's just a small cosmetic that doesn't really matter for now happy.gif


[Show/Hide] This is what mine looked like

I found a glitch in the above event system when displaying multiple 0's for a number like 1000. Only the 10_ _ would show. That Event system is outdated, but fixed in my most recent version

This post has been edited by Kipe: Aug 28 2009, 10:12 PM


__________________________
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: 21st May 2013 - 10:41 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker