Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • How to create, a chance code?
« previous next »
  • Print
Pages: [1]

Author Topic: How to create, a chance code?  (Read 2239 times)

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
How to create, a chance code?
« on: July 19, 2006, 08:55:06 PM »
Well I´ve been working hard and long trying to create a CBS, it´s not going that well but I´m getting the knowledge and I got the basics.

But one thing that has been bugging me is the Accuracy and Evasion along with Critical hits. I just can´t figure out a working code that can be programed.

Well someone helped me with a steal system for the DBS, and he said that the variable called "Chance" decides how big the chance is to steal something. That made me think a bit.

So now I´m just trying to figure out a working code of numbers or whatever that can aid me in this matter.

The code for the stealing was:
-------------
<>Branch: Var[###Chance] is 2 or more
 <>Steal continues, ani, message item+...
 <>Variable Oper:[###Chance] -, 6
 <>

 :Else Handler:
--<>Same thing but fail ani, mess...
--<>Variable Oper:[###Chance]+, 1
--<>

   :End
---<>
----------------------------------------------------

So if anyone can help me get some light to this matter I´d be gratefull.

Any help at all is appreciated actually.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline Meiscool-2

  • Sage
  • *
  • Posts: 7,030
  • If you support n00bs, you support communism.
(No subject)
« Reply #1 on: July 19, 2006, 09:11:05 PM »
 
Logged
Most Recent:

________________________
Old Stuff:

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
(No subject)
« Reply #2 on: July 19, 2006, 09:21:07 PM »
So it is that simple? Just change that to: Between 1 and 4' and there is 25% chance ect.?

Well now I feel stupid.

Thanks for the help Meis.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #3 on: July 19, 2006, 10:27:53 PM »
You also have to use a branch/fork to check the outcome. But yeah, just use the Random function and some math, and you'll have your chance.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

Offline MrMister

  • damn u vile woman
  • Royal
  • *
  • Posts: 3,506
(No subject)
« Reply #4 on: July 19, 2006, 10:47:52 PM »
Teehee.
Prpl_Mage is a RPG Maker noob.
Logged
you look like an orphan

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
(No subject)
« Reply #5 on: July 20, 2006, 07:20:48 AM »
I tried it out today and the random encounters works.

The crit chance run smoothly, it was just to do it as in the original.
And I got my ABS to work more or less. Still needs to be taken care of but still, the idea works.

But I still have some problems finding a good way of fixing the acc and eva. If accuracy is 15 and the evasion is 16...Just how big chance should I have actually hit the guy?
Well that´s probably something that will be solved later on.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #6 on: July 20, 2006, 02:27:17 PM »
A good way to figure in those types of things would be to just make an algorithm that figures in the stat with the random number.

An algorithm like that would look something like this.

(a * c + a * r) / (e + r / c)

Where a = accrecy
r = random
e = evasion
and c is a constant

So if accrecty is 15 and evasion is 16, lets say the constant is 5 and the random is 1- 10, it could look something like this.

(15 * 7 + 15 * 5) / (16 + 5 / 7)

180 / 3

= 60% chance of hitting.

Now that algorithm isn't really the best, but I think you get the idea. Just experiment with differant math expressions until you come up with one that works good for how you want your evasion to go.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • How to create, a chance code?
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum