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
662
Reaction score
284
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
32,365
Reaction score
8,087
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
 

Latest Threads

Latest Posts

Latest Profile Posts

TeamEdel.png

Realized halfway through drawing this that the female protagonist's party is growing bigger. :guffaw:
oddly enough, at this point... 3 major things have kept me from porting my project to MZ... animations, and that's mainly because they don't match the artstyle of my game. and two... I NEED a YED Sideview Battler like plugin and I have yet to see one. 3rd, I don't have the money for all the stuff I need plugin wise. and I already have it on MV... lol
Generally speaking, would there be interest in some form of tutorial regarding general project management? I see there are a lot of indie/self-taught devs around here, and looking back i feel like there was a lack of resources on how to properly manage a project that might take several years to finish
I've been working on some ABS team A.I. for 'A New Suburbia', and thought I'd share.

I'm generally quite please although the AI is a little grenade heavy right now :rolleyes: - Sneaking and stalking next! Please excuse the terrible map... it was just for ease of viewing!
Voting for the second round of the Map Madness Tournament is now live! Vote for your favorite in each matchup! https://forums.rpgmakerweb.com/index.php?forums/map-madness-2021-polls.187/

Forum statistics

Threads
110,581
Messages
1,054,396
Members
143,699
Latest member
BigChungus21
Top