Zeireth

Veteran
Veteran
Joined
Nov 2, 2013
Messages
68
Reaction score
48
First Language
English
Primarily Uses
RMMZ
I was copying and pasting from the damage formulas page lol
I think I get how it's all supposed to work, I just don't know what order to put it all in. Is this right?
a.equips()[1].params[3] a.addState(2); a.atk * 4 - b.def * 2
Your formula is incorrect. The result will be zero because of an error.

Use this instead a.addState(2); a.equips()[1].params[3] + a.atk * 4 - b.def * 2
 

itachi11115

Veteran
Veteran
Joined
Jun 12, 2018
Messages
59
Reaction score
22
First Language
English
Primarily Uses
RMMV
Your formula is incorrect. The result will be zero because of an error.

Use this instead a.addState(2); a.equips()[1].params[3] + a.atk * 4 - b.def * 2
Ahh, so close lol thank you. Is there a particular order of operations that the system prefers? Just in case I need to try and make something like this again
 

Zeireth

Veteran
Veteran
Joined
Nov 2, 2013
Messages
68
Reaction score
48
First Language
English
Primarily Uses
RMMZ
Ahh, so close lol thank you. Is there a particular order of operations that the system prefers? Just in case I need to try and make something like this again
From what I understand you want your damage number to be at the end. Technically you can keep on using ; before damage like this a.addState(2); a.addState(4); a.equips()[1].params[3] + a.atk * 4 - b.def * 2

What that formula will do is apply guard state to user, then apply poison state to user, then do math to get a value for damage. There is a lot of fun things you can do once you learn more.

Have fun with damage formulas, experiment, but always remember to make backup copies so in case you actually want it to go back to original, then you will have it.

I would highly suggest searching Javascript Math in your search engine. Pretty much all math functions and methods work in the damage formula for skills and items. I love mathematics lol

Also in your game folder called js, you will notice rpg_object.js

It has cool information, however I suggest you make a backup copy if you ever plan to mess around with it, or better yet you could write a script to overwrite functions or do whatever you like.

For instance when I read through rpg_object.js I discovered that I can put a.die() to make the user dead in a damage formula. die() is a function, same is true as addState(). You will find addState() function in rpg_object.js under Game_Battler function. Game_BattlerBase function is also a good one to look through. It is a superclass of Game_Battler.

I am available to chat with whenever you need some help. Send me a dm.

I assume that this thread can now be closed now. I believe your original request has been fullfilled.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,855
First Language
English
Primarily Uses
RMMV
Is there a particular order of operations that the system prefers?
How do you mean? If you mean the order of commands, then as Zeireth and the Damage Formula 101 thread said, the last command must always be a number because that's what the game uses for the actual damage.

If you mean order of operations mathematically, it's the exact same as you learned in math class.
I assume that this thread can now be closed now. I believe your original request has been fullfilled.
I know that you're just being very helpful in this thread; but for future etiquette, only the original author of a thread can request it to be closed.
 

itachi11115

Veteran
Veteran
Joined
Jun 12, 2018
Messages
59
Reaction score
22
First Language
English
Primarily Uses
RMMV
From what I understand you want your damage number to be at the end. Technically you can keep on using ; before damage like this a.addState(2); a.addState(4); a.equips()[1].params[3] + a.atk * 4 - b.def * 2

What that formula will do is apply guard state to user, then apply poison state to user, then do math to get a value for damage. There is a lot of fun things you can do once you learn more.

Have fun with damage formulas, experiment, but always remember to make backup copies so in case you actually want it to go back to original, then you will have it.

I would highly suggest searching Javascript Math in your search engine. Pretty much all math functions and methods work in the damage formula for skills and items. I love mathematics lol

Also in your game folder called js, you will notice rpg_object.js

It has cool information, however I suggest you make a backup copy if you ever plan to mess around with it, or better yet you could write a script to overwrite functions or do whatever you like.

For instance when I read through rpg_object.js I discovered that I can put a.die() to make the user dead in a damage formula. die() is a function, same is true as addState(). You will find addState() function in rpg_object.js under Game_Battler function. Game_BattlerBase function is also a good one to look through. It is a superclass of Game_Battler.

I am available to chat with whenever you need some help. Send me a dm.

I assume that this thread can now be closed now. I believe your original request has been fullfilled.

How do you mean? If you mean the order of commands, then as Zeireth and the Damage Formula 101 thread said, the last command must always be a number because that's what the game uses for the actual damage.

If you mean order of operations mathematically, it's the exact same as you learned in math class.

I know that you're just being very helpful in this thread; but for future etiquette, only the original author of a thread can request it to be closed.
You have both been incredibly helpful, looks like the skill is working as expected now. Thank you again!
 

Latest Threads

Latest Posts

Latest Profile Posts

ScreenShot_6_24_2022_9_20_7.png
Here's Mike when you get a preemptive strike in battle. There's another one for when an enemy sneaks up on you too.
Suddenly, games mean nothing. The money spent was worth it to bring souls towards the light of life. May God bless my path forever. I pray that all are shaken for truth and poured out flat on the table of true understanding, knowledge, and wisdom. Bless you.
Finally I bought OMORI...cant wait to get traumatised!!!
Finished making this pretty ambitious forest map. Was wondering what y'all think of it! :kaopride:
1656136876015.png
All this anger everywhere,Who's happy but me?
Seems to be all the people that don't follow Jesus wholeheartedly. My smile might burn you ahhhhhhhhhhh!

Forum statistics

Threads
123,022
Messages
1,153,463
Members
161,365
Latest member
sieuthitien
Top