playMaker

Author Topic: probability calculator  (Read 4249 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
probability calculator
« on: January 28, 2015, 02:22:27 PM »
So I can code this in javascript or BASIC real easily.  In playmaker it takes some work with the states and checks and all.  So it'd be cool to have an action to do this.  Many newbees will want this.

So you have a powerup that pops up.  25% of the time it boosts speed, 25% of the time it doubles the firepower and 50% of the time it gives a shield.  In playmaker you have to set up a random number generator between 1-100 (0 is not needed and 1 is included and 100 is included).  Then you have to do a series of checks and branches.  Wouldn't be easier just to have an action to do this so people won't have to keep re-doing it?  Of couse it would.  That is why you are using playmaker and not C#.

- pick a random INT with low at 1 and high is at 100.  If you need to do a percent less that 1 increments.....OK, you don't need to.  So we'll use an INT.
- array number that you tell number of entries (3 entered will be 3 entries)
-each entry has a name (something for programmer to use)
- each entry has a LOW and a HIGH percent (the low of the current array number has to be 1 higher than previous high amount.  This number can be auto generated).
- each entry has an exit to go to next state
=================================
so it would look like this:

3

1
Speed Boost
1
25
Goto speed state

2
Double Fire power
26
50
goto fire state

3
Shields
51
100
Goto shield state






« Last Edit: January 28, 2015, 02:26:00 PM by wheretheidivides »

jrDev

  • Junior Playmaker
  • **
  • Posts: 59
Re: probability calculator
« Reply #1 on: May 11, 2017, 10:49:54 AM »
Any updates on this?

I was just looking for something like this...

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: probability calculator
« Reply #2 on: May 12, 2017, 10:04:09 AM »
you can just use "send random event" for this
the only thing is that the weights would be 0-1 instead of 1-100

jrDev

  • Junior Playmaker
  • **
  • Posts: 59
Re: probability calculator
« Reply #3 on: July 23, 2019, 12:45:23 AM »
you can just use "send random event" for this
the only thing is that the weights would be 0-1 instead of 1-100
Hello,

This is great!

Thanks,
jrDev

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: probability calculator
« Reply #4 on: July 23, 2019, 07:26:17 AM »
Hi.
@jrDev

On the Ecosystem you can find now many different Random Weighted that might be useful.

Search for 'Random Weighted' and you will get a list of several actions :)