User Tag List

Results 1 to 2 of 2

Thread: A More Advanced Random

  1. #1
    No Products Registered

    Join Date
    Apr 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A More Advanced Random

    The best way to ask this question is just to give an example. So in my game there are 10 rooms and each room has a global value assigned to it. There is a NPC that will randomly enter one of the rooms.

    I want to make it so actions the player does adds to that rooms global value and adds to the rooms odds of being selected, for example: if all 10 rooms were set to 20 on there global value then theres an equal chance the NPC will enter any of these rooms. Though if Global value 1 is set to 40 and the rest are set to 20, its more likily he will enter the first room then any of the others.

    I want it to be ajustable so i can add to any value and change the odds. Is there a way to do this in MMF2.5? I've never seen one but would love if someone could help me. Thanks a lot! Feel free to post any questions you may have.

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I would probably just add all the numbers up, then use the random function to pick a number from the pool. Depending on the amount of points each room put in, it will affect their odds.

    For example:

    Room 1: 10 points
    Room 2: 40 points
    Room 3: 5 points
    Room 4: 35 points
    Room 5: 5 points
    Room 6: 5 points

    Total: 100 points

    Percentages:

    Room 1: 10/100=10%
    Room 2: 40/100=40%
    Room 3: 5/100=5%
    Room 4: 35/100=35%
    Room 5: 5/100=5%
    Room 6: 5/100=5%

    I made the numbers tally up to 100 to make it easier to understand, but all you would have to do is divide the points each room put in by the total number of points to get percentages. So if one room has more points than the other it has a higher chance of being picked.

Similar Threads

  1. Random Active Spawn in Random Location in Frame
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2016, 03:33 AM
  2. Replies: 5
    Last Post: 7th September 2014, 03:59 PM
  3. Mario ghost random random spawn
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 30th May 2014, 06:48 PM
  4. Random Speed + Ypos at random times
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th May 2011, 05:25 PM

Tags for this Thread

Posting Permissions

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