Can i use chances instead of random integer?

Started by Nanobott on

Topic category: Help with MCreator software

Last seen on 17:09, 14. Jun 2024
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can i use chances instead of random integer?

So i am working on a Black Jack mod, ive got everything working except the cards pulling are random integer, so chances of hitting blackjack, or sidebets are way lower.

https://imgur.com/a/5WjZwgt

Is there any way i can somehow use a different chance? the one blackjack uses for a 52 card deck? Or is this already the case and am i just realy unlucky when testing?

(average 100+ bets)

 

Last seen on 21:48, 26. May 2024
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change your chance to test…
Mon, 05/20/2024 - 13:19

Change your chance to test if it's working.

Last seen on 17:09, 14. Jun 2024
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What do you mean?  
Mon, 05/20/2024 - 20:40

What do you mean?

 

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get a random number between…
Mon, 05/20/2024 - 20:51

Get a random number between 0 and 99 (use the "included" type) and check if it's lower than the percent chance you want.

E.g.

[if [[Random integer between [0] and [99] included] < [50]] do]

|(Interesting things)

[                                             ]

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Or something like that.
Mon, 05/20/2024 - 20:51

Or something like that.

Last seen on 17:09, 14. Jun 2024
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So if it for example returns…
Mon, 05/20/2024 - 21:06

So if it for example returns 45 and i want it to be 50% it will not draw that card?
 

So then i could make 4 suits; Spades, Hearts, Diamonds, and Clubs. And it whould beL

[if [[Random integer between [0] and [99] included] < [25]] do] Spades

[if [[Random integer between [0] and [99] included]  > [25 and  < 51 do]] do] Hearts 

blablabla] do Diamonds

blablabla] do Clubs

 

and after that i could set a chance of 13(there are 13 cards in 1 suit) to be 2-11(ace)

 

Do you think this will work or is there something stupid happening here lol

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
*processing data with…
Mon, 05/20/2024 - 21:19

*processing data with acoustic device*

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't understand. Are you…
Mon, 05/20/2024 - 21:20

I don't understand. Are you saying that for each 25% there's a card? For that you could just use a 1 to 4 and assign a card to each of those values.

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, I don't know Blackjack.
Mon, 05/20/2024 - 21:22

Also, I don't know Blackjack.

Last seen on 17:09, 14. Jun 2024
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
haha, there is a 25% chance…
Mon, 05/20/2024 - 21:23

haha, there is a 25% chance of the card being hearths, spades, diamonds or clubs and a 1-13 chance for an Ace, 2, 3, 4, 5, 6 , 7, 8, 9, Q, J, K.

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh!  
Mon, 05/20/2024 - 21:39

Oh!

 

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's pretty much it.
Mon, 05/20/2024 - 21:40

That's pretty much it.

Last seen on 17:09, 14. Jun 2024
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeaa got it, thanks ! It a…
Mon, 05/20/2024 - 21:48

yeaa got it, thanks ! It a lot more code when you want ace to behaviour as 1/11 and the text change to that lol, but i think im getting there and my brain understanding this makes it a whole lot easier hahah

Last seen on 01:03, 23. May 2024
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yay!
Mon, 05/20/2024 - 22:15

Yay!