How can I make random events?

0 favourites
  • 7 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Hi guys! I am making a life text simulator and I need to make some random events, for example "You have won 1 billion dollars" or "You got into a car accident". Can I make such events in Construct 3? If so, how can I do it? Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set text to choose("You have won 1 billion dollars","You got into a car accident")

  • newt I forgot to say that I need these events to occur in random time. I have a timeline and I need, for example, "You have won 1 billion dollars" to occur from 2030 to 2050 year. Thanks))

  • newt I forgot to say that I need these events to occur in random time. I have a timeline and I need, for example, "You have won 1 billion dollars" to occur from 2030 to 2050 year. Thanks))

    I think to make it easier for yourself you should set the random Year beforehand so you know when it should happen so you can keep looking forwards to that year

    Example:

    For the "You have won 1 billion dollars"

    Create a variable or store them in a dictionary if you have many events like these

    Create Variable >>>> "Won_1_billion"

    On Start of layout >>>>> set "Won_1_billion" = Floor(Random(2030, 2051))

    Then each year that passes compare

    Current_Year => "Won_1_billion" >>>>>> Run the "You have won 1 billion dollars" Event

    The same for the other events

  • tarek2 thank you very much, bro)) and is it possible to create such events, which can occur or can not occur. I mean is there any feature where I can create a possibility of some events. For example, "U won 1b dollars" possibility is 0.01%, "U won 1k dollars" possibility is 1% and "U won 10 dollars" possibility is 100%. If so, how can I create events with such possibility. Thanks.

  • Yarolus

    Np Glad, it helped

    Yes there is a Function on C3 that can create Probability tables

    The Names is "Advance Random"

    But if it is for just simple Probabilities, you can do it with events too:

    Example:

    Here you have:

    0.1% >>> To Win 1 B Dollars

    1% >>> To Win 1 K Dollars

    99.89 or whatever is left >>> To Win 10 Dollars

    Capx: https://www.dropbox.com/s/jq1vrbf0z5uye8k/future%20events.capx?dl=0

  • tarek2 thank yoooou

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)