playMaker

Author Topic: probability calculator  (Read 738 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 479
    • View Profile
probability calculator
« on: January 28, 2015, 12: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, 12:26:00 PM by wheretheidivides »

jrDev

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Re: probability calculator
« Reply #1 on: May 11, 2017, 07:49:54 AM »
Any updates on this?

I was just looking for something like this...

terri

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
    • terrivellmann.tumblr.com
Re: probability calculator
« Reply #2 on: May 12, 2017, 07: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