Probability increase

romyrome2005romyrome2005 Member Posts: 14
edited November -1 in Working with GS (Mac)
I am trying to make a simple rpg game. I am trying to implement some kind of probability system where, for example, if i 'buy' a special sword, it is going to increase the likelihood of my character picking up some special items. Say, +3% chance to pick up a special item.

thank you!

Comments

  • TheHooglerTheHoogler Member Posts: 102
    Here's how I would do it. This can also be used for anything such as chance to miss, chance to hit, chance for monster encounter, etc.

    Create an integer attribute called "Special Pickup Chance - SPC" and set it at 0. Then, on a timer, do a change attribute that sets SPC to random(0,100) (This will choose a random number between 0-100).

    If your hero picks up the special sword, then have a rule that says "if SPC <= 3, collect special item". Lets say your hero picks up a better sword, that gives hero a 5% chance to collect a special item. Change your rule to say "if SPC <= 5, collect special item". I'm working on an RPG as well, and as far as I can tell, this is the best way to do probabilities.
  • romyrome2005romyrome2005 Member Posts: 14
    Thanks!
Sign In or Register to comment.