The obligatory "DnD Skill checks" question for RPG Maker MZ

SoCalAshez

Villager
Member
Joined
Sep 9, 2020
Messages
20
Reaction score
9
First Language
English
Primarily Uses
RMMZ
Hello All!

So I've done a little research and am aware that this question is asked at least once every couple years across the different iterations of the game. I have done pretty well in incorporating DnD-like mechanics, formulas, etc. into RPG Maker MZ either through Plug-ins, self teaching, videos and all that. I nailed down a formula to have DND style combat with dice rolls after doing some tweaks to an article I found online. The end formula for DND style combat:

if (b.def <= Math.randomInt(20)+1+a.agi+a.mdf) {Math.randomInt(a.atk)+1+a.agi} else {0}

Explanation: b.def being enemy defense (AC); the d20 roll, agi representing str/dex; mdf being actors proficiency bonus (i know this sounds silly but it works), atk being the weapons attack while the actors have none (i.e.sword giving 8 attack to represent 1d8). The attack or spell is set to Certain hit, 100 percent success, and 0 variance to bypass RPG Maker Hit Rate and Evasion calculation and make it as pure dice roll as able.

Anyway, I am hoping to use the above formula to do skill checks in events but I am not literate in java enough to make that on my own. Some idea's I've seen floating around include: making skills into variables and doing conditional branches if the numbers are high enough by having choices that the player decides which actor gets to make the attempt based on their variable. That just seems like a killer amount of work to set up and I feel there may be a better way.

Is there a way I can use my above formula but change it up just a bit, for example:

if (TARGET NUMBER <= Math.randomInt(20)+1+SKILL MODIFIER+a.mdf(PROFICIENCY BONUS)) {succeed} else {fail}

The thing is I wouldn't know where to put that or what to use specifically to make it work. Any help from you guys would be GREATLY appreciated.

Thank You!
-SoCalAshez
 

ChatS

Villager
Member
Joined
Mar 6, 2015
Messages
20
Reaction score
11
First Language
French
Primarily Uses
RMMV
Variables are the best way to go with this! First you need a variable named "random roll" (Or whatever you wish!), then you need to create a variable for each stat, for each actor.

Then you can check a random 0-19 check (+ actor stat modifier) VS a DC for whatever purpose you need.

It is tedious at first, but once it's all set up it it works pretty well.
 

SoCalAshez

Villager
Member
Joined
Sep 9, 2020
Messages
20
Reaction score
9
First Language
English
Primarily Uses
RMMZ
Variables are the best way to go with this! First you need a variable named "random roll" (Or whatever you wish!), then you need to create a variable for each stat, for each actor.

Then you can check a random 0-19 check (+ actor stat modifier) VS a DC for whatever purpose you need.

It is tedious at first, but once it's all set up it it works pretty well.
Okay yeah I'll give that a try. Do you know how I should reflect that in the event editor? Would love a quick screenshot if you could get it to work.

I'm such a newb :(
 

ChatS

Villager
Member
Joined
Mar 6, 2015
Messages
20
Reaction score
11
First Language
French
Primarily Uses
RMMV
Actually you just need 1 variable and that's the random roll one. The actor's stats is already stored.

Capture1.JPG

and this is how I would set it up. (Note 1: that you probably should check if the actor is in the party to begin with!) But I forgot about that! (Just make a condition for it before the rest!)


Capture2.JPG

(Note 2: I used MV here, but I'm pretty sure you can do the very same in MZ!)

I always set a random variable to 0 first. You probably can ignore that, but I found that resetting random variables that way makes sure it doesn't call a previous random number first.

Hope that helps!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,960
First Language
English
Primarily Uses
RMMV
If you don't want to go down the route of adding the ability score modifiers as variables in their own right, remember that the mod is just (ability score - 10) / 2 rounded down.

So if you wanted to incorporate, say, the str mod, you'd just do Math.floor((a.atk - 10) / 2)
 

SoCalAshez

Villager
Member
Joined
Sep 9, 2020
Messages
20
Reaction score
9
First Language
English
Primarily Uses
RMMZ
@ChatS , I cannot thank you enough. I cannot wait to put this in my game and give it a shot, means a lot that you went the extra mile for a person like me!
 

ChatS

Villager
Member
Joined
Mar 6, 2015
Messages
20
Reaction score
11
First Language
French
Primarily Uses
RMMV
No need to thank me! Just enjoy making your games! :)
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
I have a bunch of D&D style-plugins for MV. These will eventually get rolled into my current MZ project I'm working on but they won't be quite as easy to just slap onto an existing project.
 

SoCalAshez

Villager
Member
Joined
Sep 9, 2020
Messages
20
Reaction score
9
First Language
English
Primarily Uses
RMMZ
Wow!

When I first got MZ in august and tried to make this game a reality, I saw your work and tried it in MZ. I had no knowledge of how things worked, kinda like now but minus 1, and was pretty disappointed it didn’t just work in MZ, more because I REALLY leaned into the spells and slots for our sorcerer before actually testing it and the game kept crashing. Honestly honored you would visit this humble post.

Your plugins were really inspiring and using the visustella and home plugins I was able to do some similar stuff with race and class stuff, hope you are able to add yours to MZ soon!

Thank you @Frogboy
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
While the changes made from MV to MZ probably weren't as extensive as most of us were hoping for, they changed enough that any complex plugin won't work as-is ... and my plugins ended up getting crazy complex. My work with MV was a learning experience and I'm approaching things differently this time. But when I'm far enough along, I should have a solid D&D inspired RPG Maker engine for us all to enjoy.
 

SoCalAshez

Villager
Member
Joined
Sep 9, 2020
Messages
20
Reaction score
9
First Language
English
Primarily Uses
RMMZ
@ChatS that worked perfectly btw, I made a success and failure common events that tell the player what the roll was and then activate a self switch after doling out the reward or telling them how it failed. I love it!!!
 

Ashouse

Resident Zombie
Veteran
Joined
Oct 25, 2015
Messages
246
Reaction score
98
First Language
English
Primarily Uses
N/A
Super cool thread. When you're familiar with one system, as those of us interested in this thread likely are, it makes it much easier to write everything else. I know I'm old, but I've been writing D&D modules off and on for 30 years. (Literally... And no, not professionally, just for the fam)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,096
Members
137,587
Latest member
Usagiis
Top