Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: TrueCynder on February 17, 2014, 07:03:14 pm

Title: [solved] Making menu points unlockable ?
Post by: TrueCynder on February 17, 2014, 07:03:14 pm
Hey guys so i was wondering if there is a way to
unlock menu points via an in-game switch (for example)

Like in the menu at first you have

-???
-Item
-Equipment
(and so on)

and then once the switch is on
it will be this for example

-Journal
-Item
-Equipment
(and so on)

Title: Re: [unsolved] Making menu points unlockable ?
Post by: chaucer on February 21, 2014, 07:19:56 pm
for changing menu name
Spoiler: ShowHide
def main
    #names
       name  = ???? if $game_switches[ID] = false #change to the id number of the switch you use
       name = status if $game_switches[ID] = true
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "#{name}" #<--- name used here
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index

and if your using default menu (some menus it may be different.)
Spoiler: ShowHide

        when 3  #status  | when id <-- id depends on where in the menu you placed the new scene
        if game $game_switches[ID] = false
        $game_system.se_play($data_system.buzzer_se)
        else
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0

didnt test it but should work, there's probably better ways of doing this though.
Title: Re: [unsolved] Making menu points unlockable ?
Post by: LiTTleDRAgo on February 21, 2014, 08:03:26 pm
@^ your code syntax is wrong

Spoiler: ShowHide
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = journal_switch ? 'Journal' : '????' #<--- name used here
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
  ...



  def journal_switch
    $game_switches[ID]  # replace ID with integer
  end



  when 3  #status  | when id <-- id depends on where in the menu you placed the new scene
    if journal_switch == false  # in conditional branch, you shouldn't use single equal sign
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    .....
Title: Re: [unsolved] Making menu points unlockable ?
Post by: chaucer on February 22, 2014, 06:10:50 pm
lol sorry about that and thank you for correction :)
Title: Re: [unsolved] Making menu points unlockable ?
Post by: TrueCynder on May 04, 2014, 12:54:20 pm
Aw yeah :D thanks alot. Is there also a quick way to grey it out as long as its disabled ?
Title: Re: [unsolved] Making menu points unlockable ?
Post by: ThallionDarkshine on May 04, 2014, 01:48:22 pm
Code: ruby

  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = journal_switch ? 'Journal' : '????' #<--- name used here
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.disable_item(3) unless journal_switch
  ...
Title: Re: [unsolved] Making menu points unlockable ?
Post by: TrueCynder on May 04, 2014, 02:47:46 pm
Thanks :D