Using switches to alter menu commands

Started by Kaiph, February 03, 2016, 07:48:09 am

Previous topic - Next topic

Kaiph

February 03, 2016, 07:48:09 am Last Edit: February 03, 2016, 08:01:28 am by Kaiph
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?

ForeverZer0

You don't need to lock topics, they can remain open.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Kaiph

Noted, its been a couple of years since I've been on a forum.