angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
Anyone know how can I use dice for damage?


Ex: You rolled a 7 you've dealt some damage. Kind of like D&D.
 

Badweather4cast

Master Eventer
Veteran
Joined
Jun 27, 2016
Messages
38
Reaction score
37
First Language
English
Primarily Uses
RMVXA
This was a fun one.


First of all, head over to Yanfly's and grab the Random Skill Invoke Script. Using this, you can probably create a pretty efficient system for dice (though I leave animations and such up to you, this was just a simple test to see if it was possible to create what you're looking for using this script). Place the script under Materials, and that's about it for that section. This script doesn't require customization. Quickly, though, if you don't want to go back to it, select the tag "<random invoke: x, x>" and copy it so you can paste it into your skill later.


Now then, pop open the database and let's start the skill work. First, create a normal everyday skill and call it what you want. Here, I dubbed it, "Gamble". I changed its occasion to "Only in Battle" to avoid people using up their MP pool rapidly for no reason. (However, you'll also notice I left the Costs at 0. For your game, make sure to change it, unless you want the skill to be completely free, which is an option too.) For the message, I simply put " rolls dice!" so it appears as "Mark rolls dice!" (Mark was the name of the character in this little test project.)


DiceSkill2.png


You may notice in the bottom right hand corner that I have pasted the tag previously mentioned into the Notebox, and that it uses skills 10-15. Similarly, I have created enough skills for what would be a six-sided die. 10-15 are the IDs of the other skills, in case that wasn't clear. ^^ So, now, if this skill were to be used in battle, the "Gamble" would choose randomly from the pool of skills you have created for it.


Now, here is a screenshot of what one of the skills looks like...


DiceSkill3.png


If this skill activates, it will tell you that you have rolled a 3, and will deal exactly the damage I have allowed it. Of course, in your project, you can change the values to whatever you want. :) What I have also done here is changed the Variance from 20 to 0, making sure that whenever 3 is "Rolled", 100 will always be the damage. If you want it to vary slightly, or even a lot, make sure to change that variance first! (Obviously, you can make critical hits too, it was only off because that's how it defaults.)


You can make several of these, as I have, or perhaps even more. It really depends on what kind of die you want your hero to roll! And you would also change the amount of damage dealt for each one. For example, rolling a 1 would not deal as much damage as a 5 or 8.


But yeah, that's pretty much how it goes! I'm always open to any questions you may have about this. ^^ If you find anything that seems off, I can try and help you with it. Otherwise, I hope this works for you! Enjoy! <3
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
It's not a skill it's a script or formula for a skills. It determines how much damage you deal with on attack mobs.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
just make the skill damage formula's work like the dice system...


so like for example:


base_damage + damage_per_dice*dice_roll


or 


damage_per_dice*dice_roll


You could do a "dice roll" using rand(maximum output)


rand returns from 0 to max output so if you do like


rand(5), it will return a number from 0 to 4


for a six sided die from 1-6 you could do


*(rand(6)+1) this way rand will return from 0 to 5 and add 1 so the end result will be from 1 to 6
 

Latest Threads

Latest Profile Posts

party time.png
If you've played Knight Shift Chapter 1 this image'll mean something to you. If not, that's also fine!
Here's a medical question for ya: Why do I start lightly coughing after I drink coffee?
Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!
Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.

Forum statistics

Threads
117,264
Messages
1,105,958
Members
153,440
Latest member
VicArt
Top