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 floor event problem

Aevin

Member

I'm trying to make an event where the player visits a set of floors randomly. Each time a floor is visited, a switch is turned on which prevents that floor from being selected again. (At least, that's how it's SUPPOSED to work). Here's what I'm having trouble with:

Event-1.png


So, what's SUPPOSED to happen, is a floor is randomly selected. Then, the resulting number is compared against this set of conditional branches. If the switch for the selected floor number is ON, (the floor was already visited), it turns on a switch kicking the event to page 3. Page three is working perfectly. It just checks to see if EVERY random floor has already been visited, and if they have, it sends the player to a new destination. If it finds one floor that hasn't been visited yet, it turns off self switch B and turns back to this page, which SHOULD make it choose another random number and start the process again. The player should ONLY be transported to a random floor when a floor number is selected that corresponds to an "off" switch. However, I keep getting sent to previously visited floors, as if my conditional branches are being bypassed somehow. Anyone have any ideas? Please help ...
 
Your "Transfer Player" statement is getting executed whether the floor switch is ON or OFF.

Try

@>Conditional Branch: Self Switch B == OFF
Transfer Player......
: Branch end

Then it will only transfer if the floor hasn't been visited

Be Well
 

Aevin

Member

Thank you, it worked perfectly.

But I'm a little puzzled as to why ... When self switch B is turned on, shouldn't it immediately stop looking at page 2 and start looking at page 3 instead? I thought setting a switch like that immediately halted the process when a new page was accessed. How is it that the player transfer command is happening at all when the event should be looking at page 3? Does it wait for the whole process on this page to finish before turning to the next page?

Thanks again for your help ...
 

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