Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Kaiph on February 03, 2016, 07:48:09 am

Title: Using switches to alter menu commands
Post by: Kaiph on February 03, 2016, 07:48:09 am
This is probably a quick fix but my brain is mashed today. I'm using a party changing script for part of my game, and at some point I'm wanting to 'activate' the command in the menu and then 'deactivate' it later when the party becomes smaller, with the use of a switch. You're going to be forced to use the same four party members from this point onwards so once the game reaches this point, the party changer will become null and void.
I've tried tinkering around with the menu script but my RGSS is a little rusty. I've looked at the Game_Switches script and I can't make heads or tails of how to incorporate it correctly.

Here's one of the ways I've tried.

Spoiler: ShowHide
    if $game_switches.switch_id(89) = false
      @command_window.disable_item(5)
    end


This gives me an error saying that 'switch_id' is undefined, which confuses me since in the Game_Switches script it's used freely without any need for definition. If anyone could shed light on this, I'd be grateful. Thanks.

Edit:

Never mind. Moments after posting this, I found the solution. But for anyone else who might have this problem:
I used
Spoiler: ShowHide
 if $game_switches[89] == false
      @command_window.disable_item(5)
    end


And further down where you tell it what to do with each option
Spoiler: ShowHide
      when 5
        if $game_switches[89] == false
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_PartySwitcher.new


Now how do I lock a topic?
Title: Re: Using switches to alter menu commands
Post by: ForeverZer0 on February 05, 2016, 06:42:48 pm
You don't need to lock topics, they can remain open.
Title: Re: Using switches to alter menu commands
Post by: Kaiph on February 05, 2016, 08:19:51 pm
Noted, its been a couple of years since I've been on a forum.