Chaos Project

RPG Maker => Event Systems => Topic started by: Rymdpotatis on August 30, 2008, 08:58:44 am

Title: Random treasure chest event. [RESOLVED]
Post by: Rymdpotatis on August 30, 2008, 08:58:44 am
I'm having trouble with my random treasure chest event. I want it to be a random event that determines if the chest will appear or not, and a random event to determine what is in the chest.

This is my Chest event:
Page 1:
@>Control variables:[001:Chest Appear] = Random NO. (0...1)
@>
Page 2:
Variable>0001:Chest Appear is 1 or above
@>Conditional Branch: Variable:[001:Chest Appear] ==0
@>Erase Event
@>
Branch End
@>Conditional Branch:Variable [0001: Chest Appear ==1
@>Control Variables: [0002: Chest Loot] = Random No. (0...3)
@>Conditional Branch:Variable [0002: Chest Loot ==0
@>Change Items: [Red Potion], +1
@>Erase Event
@>
Branch End
@>Conditional Branch: Variable:[001:Chest Appear] ==0
@>Erase Event
@>
Branch End
@>Conditional Branch:Variable [0001: Chest Appear ==1
@>Control Variables: [0002: Chest Loot] = Random No. (0...3)
@>Conditional Branch:Variable [0002: Chest Loot ==1
@>Change Items: [Sword], +1
@>Erase Event
@>
Branch End

(Repeat 2 with changed item name and Chest Loot number.)

What happens is that it's always visible and it deals out items depending on where I stand relative to the chest. If I stand to the right I get the Sword, if I stand to the left I get the potion. And so on and so on. Any tip on what I've done wrong?
Title: Re: Random treasure chest event.
Post by: Aqua on August 30, 2008, 11:16:00 am
Woah... what's with this eventing o.o
It's so repetitive that's it's bad...

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
Title: Re: Random treasure chest event.
Post by: Rymdpotatis on August 30, 2008, 01:53:00 pm
Haha, yeah I know it's not very pretty nor effective. I'm still learning.

And thanks for the better event! =D