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.

dumb question please help {xp}

how do i make it so i can make this work? like what is wrong?
if $game_switches[101] == true
#code
elsif
#code
end

also if you dont mind could i use a if statment to control how many options are in the command window. like:

s1 = ""
if $game_switches[101] == true
s2 = ""
end

i dont think it is that simple what do i need to do with this line?
@command_window = Window_Command.new(192, [s1, s2, s3])
 
Mmm... I don't sure if you can erase some commands if the statment is complete. but you can use this for check if the switches are On.

Code:
  def main
    # Make command window
    s1 = your command i
    s2 = Your command 2
    @command_window = Window_Command.new(160, [s1, s2])
    for i in 1..4 #your max number of commands, in this case command 1 to command 4.
    if $game_switches[i] == false # if switch i (1 to 4 is false)
      # Disable items, skills, equipment, and status
      @command_window.disable_item(i)
    end


And to avoid to enter to the command use this, after the update method.

Code:
  if Input.trigger?(Input::C)
      for i in (m=1)..(n=4)
      if $game_switches[i] == false and @command_window.index.between?(m,n)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
     end

Well, I made a little hard, but It's all that i can do, if you need a better explanation a can make a demo for you.

Luck!
 
this is how i did it, prob a few more lines of code then i needed, but it is easier to think about here it is:(not the whole class just the part you would wanna see.
Code:
class Scene_Travel
Number_Of_Options = Number_Of_Options + 1

  def main
    # Make command window
    s1 = Travel_1_name
    s2 = Travel_2_name
    s3 = Travel_3_name
    s4 = Travel_4_name
    s5 = Travel_5_name
    s6 = Travel_6_name
    s7 = Travel_7_name
    s8 = Travel_8_name
    s9 = Travel_9_name
    s10 = Travel_10_name
    s11 = EXIT
   if Number_Of_Options == 2
    @command_window = Window_Command.new(192, [s1, s11])
   end 
   if Number_Of_Options == 3
    @command_window = Window_Command.new(192, [s1, s2, s11])
  end 
  if Number_Of_Options == 4
    @command_window = Window_Command.new(192, [s1, s2, s3, s11])
  end
  if Number_Of_Options == 5
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s11])
  end
  if Number_Of_Options == 6
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s11])
  end
  if Number_Of_Options == 7
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s6, s11])
  end
  if Number_Of_Options == 8
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5 ,s6 ,s7, s11])
  end
  if Number_Of_Options == 9
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s6, s7, s8, s11])
  end
  if Number_Of_Options == 10
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s6 ,s7, s8, s9, s11])
  end
  if Number_Of_Options == 11
    @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11])
   end
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
let me know what you think please!!!!!!!!!
 

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