DiGiCORE's Recent Forum Activity

  • Thank you very much guys.

  • Alright, so, int(random(1,3)) only gives me 1 and 2 or 50% when selecting 1 or 2 and int(random(1,5) would give me 1-4 being around 25% when selecting one number between 1-4? Trying to understand exactly.

    Also, when using, lets say, int(random(1,3). Why isn't 3 used? Not that it changes much, just curious.

  • Sounds great, thank's Kyatric. Much appreciated.

  • Haven't tried this one, but I do use Aptana for most of my web projects. Also free.

    Thanks for sharing, I'll try it out.

  • If you do wan't to learn a bit of those subjects, thenewboston.org/index.php has video tutorials and w3schools.com makes a great reference, but also has tutorials.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hard to explain, so I'll start by explaining what I would like to do. I am trying to find a method of calculating a chance for something to happen after an event happens. So, for example, when the player kills a Monster he has a certain percent chance that this monster will drop(spawn) some ammo.

    Now, I've found a way to do it, but I wonder is there's a better one?

    I made a variable called RandomNumber

    <img src="http://www.freeimagehosting.net/newuploads/k4xaq.png" border="0" />

    Then I had an action during the the monsters "death" calculate a random number up too 100for the RandomeNumber variable and the following sub event would find a value between 50 and 100 in it. If it was between those numbers then it would spawn the ammo.

    <img src="http://oi41.tinypic.com/34tbwcl.jpg" border="0" />

    Seems like a solid solution and I theorize 50-100 of 100 is 50% drop rate. In turn, I have a 50% chance of my monster dropping the ammo. Or, for any number, if you choose any numbers between a certain number that is a percent of that number it will be that percent chance to do what you want. If that makes sense. Sorry.

    Anyway, just looking for some input. I did search for this and I apologize in advance if a related topic already exists.

DiGiCORE's avatar

DiGiCORE

Member since 21 Apr, 2012

None one is following DiGiCORE yet!

Connect with DiGiCORE

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies