MV-equivalent of VX formula

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,770
Reaction score
730
First Language
French
In VX you could use the following line in the damage formula of a skill to apply a buff on a character:
a.add_buff(2,3); a.mat*1.5-b.mdf*1
(just an example)

This doesn't seem to work anymore in the damage field of MV. Is there any equivalent for it?


Same question about the rand()
[a.atk*1-b.def*1, 1+rand(2)].max
(again, just an example)

This was working on Ace but no longer is on MV. Any equivalent?


And finally (sorry for the many questions) what is the way (if any) to use a variable and to test a condition (for instance if a switch is on) through the damage formula?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,393
Reaction score
872
First Language
EN
Primarily Uses
RMMV
You may find this thread helpful: https://forums.rpgmakerweb.com/index.php?threads/damage-formulas-101.81905/
(Original - rpgmakercentral)

Give the skill user a 3-turn buff to param 2 (atk):
Code:
a.addBuff(2, 3);
In your context:
Code:
a.addBuff(2,3); a.mat*1.5-b.mdf*1

Get a random number from 0~1:
Code:
Math.randomInt(2)
In your context:
Code:
Math.max(a.atk - b.def, 1 + Math.randomInt(2))

Get the value of game variable 15 (these two lines are equivalent, first one is a shortcut for the damage formula box):
Code:
v[15]
Code:
$gameVariables.value(15)
Get the value of game switch 8:
Code:
$gameSwitches.value(8)
Return 100 if switch 8 is on, else return 10:
Code:
$gameSwitches.value(8) ? 100 : 10
Or you can use an "if" statement, e.g. do the addBuff thing above only if the value of variable 15 is more than 20:
Code:
if (v[15] > 20) { a.addBuff(2, 3); }; a.mat * 1.5 - b.mdf
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Trauma, drama, llamas--sadly the only one of those things I'm not experiencing RN is the camelids.
Do you ever just write or say nonsense? String together words to make a sentence that sounds pretty but is meaningless?
Writing down my ideas for my next game during break times at work XD I need to finish my current one very soon.

Forum statistics

Threads
93,654
Messages
914,338
Members
123,239
Latest member
Dat-Writer
Top