Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Random Event

Status
Not open for further replies.
i wasent to sure if there was an event based way of doing this or not but basically i want a script or tutorial that chooses an event at random.

EG.
lets say a trader comes to town every now and then or lets say the king has randomely selected your land to be seized.
(so a invisble dice or number generator\the number it lands on causes that event)

i hope someone understands me or points me to something alike to my request
O_o
 
There's an easy way to event this, you just need to use one global variable. Set it up like this:

Say you want a 20% chance (1/5)...
@>Control Variables:[0001] = Random No.(0...4)
@>Conditional Branch: Variable [0001] == 0
@> [event stuff here]
: Branch End
@>

You can change the parameters to increase or decrease the % chance (like 0...9 for a 10% chance or 0...99 for a 1% chance). Not sure if this is what you wanted but good luck :thumb:
 
This topic has been resolved. If Rubberducky4u or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top