bluechuii

Villager
Member
Joined
Mar 26, 2022
Messages
17
Reaction score
10
First Language
English
Primarily Uses
RMMV
I'm trying to make a 'menu' of sorts. I was told Loops and Conditional branches would be a good way to do it.

So, basically, I have pictures that are like a menu. I want the player to be able to press up and down to flick through the options and press ok so they can choose an outfit etc. I managed to get this far but no matter what I tried; It would stick after pressing down once and won't do anything else or if I try adding in the third picture; I press down and it skips the second and goes to the third.

Here's what I have so far (Up to where it works fine)
help.png
There are 9 choices btw (9 pictures) Picture 2 needs to be able to go back up to picture 1 and also be able to Ok and go down and so on ect ect with the rest.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,631
Reaction score
509
First Language
German
Primarily Uses
RMMV
You do not need the Loop if this is on a Parallel Eventpage.
If this is a Event triggered by Action Button, than yes the Loop would be needed.
But we should skip it for now until the rest of the needed Logic is build.

In the following example you can change the Image Cursors Position as fast as you can Press that Button again and again, but when you keep it pressed, it will take half a second before it changes to the next Cursor Position. Thatway it feels more smooth and it shows the usage of the Eventcommand Loop, but not in the way you asked for. This is incomplete but i hope it still helps you getting started with building this. Else just ask more.

Code:
◆If:Button [Up] is pressed down
  ◆Control Variables:#0006 Var6 CursorImgPosition -= 1
  ◆Control Switches:#0001 Switch1 = ON
  ◆
:End
◆If:Button [Down] is pressed down
  ◆Control Variables:#0006 Var6 CursorImgPosition += 1
  ◆Control Switches:#0001 Switch1 = ON
  ◆
:End
◆If:Switch1 is ON
  ◆Control Switches:#0001 Switch1 = OFF
  ◆If:Var6 CursorImgPosition = -1
    ◆Control Variables:#0006 Var6 CursorImgPosition = 8
    ◆
  :End
  ◆If:Var6 CursorImgPosition = 9
    ◆Control Variables:#0006 Var6 CursorImgPosition = 0
    ◆
  :End
  ◆Common Event:PictureDisplay <-- This is the missing code i was talking about.
  ◆Control Variables:#0009 Var9 Timer = 30
  ◆Loop
    ◆If:Var9 Timer = 0
      ◆Break Loop
      ◆
    :Else
      ◆Control Variables:#0001 TimerCount -= 1
      ◆
    :End
    ◆If:Button [Up] is pressed down
      ◆Wait:1 frame
      ◆
    :Else
      ◆If:Button [Down] is pressed down
        ◆Wait:1 frame
        ◆
      :Else
        ◆Control Variables:#0009 Var9 Timer = 0
        ◆
      :End
      ◆
    :End
    ◆
  :Repeat Above
  ◆
:End
◆If:Button [OK] is pressed down
  ◆Common Event:Ok Button Code
  ◆Comment:All Code could be inserted here, but its easier to read
  :       :if we use Eventcommand Call Comon Event here.
  ◆
:End
◆If:Button [Cancel] is pressed down
  ◆Comment:Exit Code depends on the kind of Event this is.
  :       :Info about Event Trigger is needed.
  :       :If Action Button or Parallel or Common Event.
  ◆
:End
Edit: Maybe the Code could be structured differently or shorter, this was the first that came in mind.
 
Last edited:

Latest Threads

Latest Profile Posts

Why the heck do I keep comparing my games to ones made by huge companies? I'd love them to have that level of polish but I'm simply not good enough.
Hell of a day at the London Games Market! :D

1656892272017.png

Check out my haul!

Forum statistics

Threads
123,294
Messages
1,155,585
Members
161,712
Latest member
Norfaiz03
Top