Fenix2222

Villager
Member
Joined
Jul 15, 2021
Messages
10
Reaction score
0
First Language
Italian
Primarily Uses
RMMZ
How can I manage to create it? I mean, each card has its rarity: a legendary card is hard to find, so you have a low chance to open a pack with it. How can I simulate these percentages? Example: common cards 60% of chance to find (give item) this card.
Rare card 20% etc...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,670
Reaction score
8,489
First Language
German
Primarily Uses
RMMV
basically a lot of control variable and conditional branches.

control variable can give you a random number, for example between 1 and 100
then check the result with the conditional branch, from 1-5 you give legendary card, from 6-20 you give rare card, from 21 to 40 you give uncommon card, from 41 to 100 you give common card.

you should read into weight mathematics (example: https://ovate.github.io/andar-tips/weight-calc.html) and make a complete card table before you even start to program the event however, because that will be an extreme and tedious list of all cards and you'll mess it up without carefull planning.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,113
Reaction score
5,810
First Language
English
Primarily Uses
RMVXA
Like Andar said, it can all be done with random numbers, conditional branches, and clever use of Show Picture. I would set up the eventing by first choosing a rarity (e.g. if number is between 1 and 5 give legendary, 6 to 15 rare, 16 to 30 uncommon, 31 to 100 common), and then within each rarity you could have a second, evenly distributed random number to choose which card of that rarity to award.

In the long run - especially if you're planning to do more complex stuff like allowing re-rolls or filling out a collection of all cards that have been obtained - you will want to move onto JavaScript programming to do this. It will save you a lot of time and make it easier to scale when you start adding in more features.
 

Fenix2222

Villager
Member
Joined
Jul 15, 2021
Messages
10
Reaction score
0
First Language
Italian
Primarily Uses
RMMZ
Like Andar said, it can all be done with random numbers, conditional branches, and clever use of Show Picture. I would set up the eventing by first choosing a rarity (e.g. if number is between 1 and 5 give legendary, 6 to 15 rare, 16 to 30 uncommon, 31 to 100 common), and then within each rarity you could have a second, evenly distributed random number to choose which card of that rarity to award.

In the long run - especially if you're planning to do more complex stuff like allowing re-rolls or filling out a collection of all cards that have been obtained - you will want to move onto JavaScript programming to do this. It will save you a lot of time and make it easier to scale when you start adding in more features.
How can I make "if number is between" in a simple way? Should I use 2 conditional branches? (ex: if var(x) is >1 ---> if var(x) is < 5 then card(x) appears).
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,113
Reaction score
5,810
First Language
English
Primarily Uses
RMVXA
How can I make "if number is between" in a simple way? Should I use 2 conditional branches? (ex: if var(x) is >1 ---> if var(x) is < 5 then card(x) appears).
Basically yes. You could set it up in nested branches like this:
Control Variables: Set Variable #1 to number between 1 and 100
Conditional Branch: If Variable #1 is less than or equal to 5
..Do processing for legendary card
Else
..Conditional Branch: If Var #1 is less than or equal to 15
....Do processing for rare card
..Else
....Cond Branch: If Var #1 is <= 30
......Do processing for uncommon card
....Else
......Do processing for common card
....End Branch
..End Branch
End Branch
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,670
Reaction score
8,489
First Language
German
Primarily Uses
RMMV
How can I make "if number is between" in a simple way?
no need for that if you sort your conditional branches correctly.
if x< 5 go label 1
if x< 20 go label 2
if x < 40 go label 3

the x=4 will never go to label 2 even if it theoretically fulfills the condition, because it was send away to label 1 before that condition was even checked.
 

Latest Threads

Latest Posts

Latest Profile Posts

Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.
A lot to learn to make a game. Can I handle it?
I've been working on status effects since last thursday, and today I finished the core mechanic of Zombie, Teleport, Curse and Recall. Zombie and Curse are lacking a few things to make them complete atm. Teleport though is the "HAHA" spell for some of my mobs, but can "NOPE" at them with Recall.

Forum statistics

Threads
115,171
Messages
1,087,796
Members
149,718
Latest member
MadAtticProductions
Top