User Tag List

Results 1 to 7 of 7

Thread: Percent Occurance?

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Location
    Oklahoma
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Percent Occurance?

    I am making a game in which a character has to avoid danger by dodging attacks from enemies. When the player presses down, the character plays her hiding animation and is given a percent chance to dodge an attack. How do I make it so a bad guy has a 100% chance of hitting minus the players dodge %? Let me know if I need to make this a little clearer.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    Here is one way to do it.

    * upon pressing down
    : set counter to random(100)
    : play animation hiding

    * upon beeing attacked
    + counter <= % chance to dodge
    : dodge the attack

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Location
    Oklahoma
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    Well, I am not sure if this is what I want or not. I see that you have a counter that is >= to chance of dodge. That is what I want to find. Should I just give an alterable value to the bad guys that is randomized from 1-99 when they attack and if it is lower or equal to the dodge counter it misses? I want to know if that is a decent way to give a dodge rate. It would work, but I just don't know if this is a good enough way to express it.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    That's pretty much what is in Popcorn's events. However, you may also want to put a modifier on the enemy characters as well depending on their chance of hitting in the first place.

  5. #5
    No Products Registered

    Join Date
    Aug 2006
    Location
    Oklahoma
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    OK.I Think I understand. Sort of. Here is what I am thinking of now. There are two characters: Player and Bad Guy.
    Player has a dodge of 75 for whatever reason.
    Bad guy has a hit of 80 because he is moderately accurate.
    When the hit comes in contact with the player, should I do something like subtract 75 from 80 and mess with random numbers or just do what Popcorn was talking about?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    It's possible to do it all in one formula, but it's probably easier to understand in stages...

    I'd "roll" (pick a random number out of 100) for the enemy's chance to hit, and if the result of the random pick is below the enemy's hit %, then set a flag/indicate somehow that the player is about to be hit and move on to doing another random comparison against the player's "dodge" statistic to see whether the player should actually take damage or not.

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Location
    Oklahoma
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Percent Occurance?

    Hm. I think this is what I'll do. A bad guy could always have a hit % Lower than or greater than 100. When the Good guy dodges, the Good Guy's dodge rating will be subtracted from the Enemy's hit rating. With the number that remains, there will be a random number generated. If this generated number is lower or equal to the remainder of the subtraction, the blow will connect.

    I am open to other approaches.

Similar Threads

  1. percent calculation with counter
    By brett in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 2nd February 2011, 08:43 PM
  2. Opacity/Transparency percent
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd August 2010, 06:01 PM
  3. Converting screen pixels into percent.
    By Nickydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th November 2009, 06:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •