How can I calculate a variable and attack with said variable

Doopis_Doop

Warper
Member
Joined
Feb 2, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I want to use variable calculations to attack.

So say in the battle you click the attack button, well i want this to happen.
This here is what my common event looks like:

Set Variable Attack Random [1-20]
Text: "Your attack is [Attack Variable]"
Set variable Enemy Defense Random [1-20]
Text: "Your opponent's defense is [Enemy Defense Variable]"

Set Variable Attack[Var] - Defense[Var]
Set Variable Attack[Var] + Attack[Stat]

Then do the attack.
I know by putting the commo event in effects it'll go after the attack but I don't want that. I want it before, it's there anyways to do this?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
548
Reaction score
224
First Language
english
Primarily Uses
RMMV
text aside, this can be done in damage formula.
(Math.randomInt(20)+1 + a.atk) - (Math.randomInt(20)+1)

without the +1 the randoms would actually be doing 0-19
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,311
Reaction score
7,644
First Language
German
Primarily Uses
RMMV
if you want the text to be displayed during skill use, then this is impossible by default.

you'll need a plugin to add that function, either a custom one or one that provides action sequences where you can program what will happen during skill use
 

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

Latest Threads

Latest Profile Posts

Hope you are all fine today~
Moderators, you must have so much patience to be able to deal with everything. I mod in a server of sorts and today we just got a message, which, despite it's helpful constructive criticism, basically stated that all of the mods were jerks and that was the only reason our server was unlikeable. So, thank you, for having patience. You are appreciated! :kaoluv:
Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......
i love my game very much

Forum statistics

Threads
105,737
Messages
1,015,982
Members
137,417
Latest member
Knife77
Top