Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Fomula
#1
Okay.. I have a formula...

Serebii.net Wrote:Catch = PokeballEffect (((( 4 * Max HP - 2 * HP ) * Catch Rate ) / Max HP ) + Status + 1 ) / 256

Okay, that's the formula. I have all of the constants. That's not the problem.

The problem is determining wether the trainer actually caught the pokemon or not.

"What's the problem?" Many of you would say.

Well, here it is. The formula, based on the constants given, will produce a number 0-1. If the formula produces a number greater than 1, the trainer will catch the pokemon without fail.

The problem comes in when it doesn't calculate 1. According to the page, http://www.serebii.net/games/capture.shtml, just because you got a number lower then one, doesn't mean you didn't catch the pokemon.

The number is to be looked at as a percentage, in decimal form. Let's say it produces the number .83. That's 83 percent. You still don't understand the problem?

How will I get VB to recognize the percentage and make heads or tail out of it to determine if the player can actually catch the pokemon? Even if the number is 1%, you can still catch the pokemon. But, using VB, I don't know how to go about this problem... The best I got is...

Code:
Percent = 100 * Rnd + 1 '1 out of 100 chance
If Perfect = 1 Then Call GotIt

And that's only a 1:100 ratio, which is viewed as 1%. If I try

Code:
Percent = 100 * Rnd + 100

That's a 100:100 ratio. 1:1, simplified. 100%.

I can't do it any other way. >.< Someone please help me with this problem. >.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)