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 chest event problem.

I'm having issues with my treasure chest events. What I want them to do is be able to appear once in a while, not everytime, and the content in them are random. This is my event:

Page 1:
Control Variables:[0001: Chest Appear] = Random No. (0...1)
Control Self Switch: A = ON

Page 2:
Have conditions of variable 0001 Chest Appear is 1 or above
and Self Switch A is on.
Control Variables: [0002: Chest Loot] = Random No. (0....3)
  Conditional Branch:Variable [0002: Chest Loot == 0]
  Change Items: [Red Potion], +1
Else
  Conditional Branch:Variable [0002: Chest Loot == 1]
    Change Items: [Sword], +1
  Else
(repeat with changed condition and loot)
  Branch End
Branch End
Erase Event


The Problem with this event is that the treasure chest always shows and only hands out Red Potions.
Any help on making it work would be great.
 
Here is a chest event which i bake up:

http://img222.imageshack.us/img222/4743/explkb7.png[/img]

It consist of 3 pages, the 3rd one has is empty with the chest open graphic.

Basically, the first page determine the spawn rate and whether the chest is actually spawned.

Second page determine the content of the chest. In the above example, the player has 50% chance to get an a random amount of G (1-2000), 25% chance of getting a Potion and 25% chance of getting a High Potion. The player will get only 1 item.

The problem with your event is how the event spawn and the way the variable is handled.

SBS
 
You might want to considering adding some "Wait" frames on the first page, or an "Erase Event" because it will continue looping forever, as it's on Autorun (so the chest will appear immediately no matter what).
 
Regi":zsnrryr0 said:
You might want to considering adding some "Wait" frames on the first page, or an "Erase Event" because it will continue looping forever, as it's on Autorun (so the chest will appear immediately no matter what).
I see Erase Event on the first page o_O
 

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