RSS

[Tutorial] 姫Hime’s Choice Options: $game_variable and $game_switches supported conditional statements

17 Sep

This article serves as an extension to Hime’s Choice Options script and deals solely with $game_variables and $game_switches conditions


$game_switches supported conditional statements

We can also disable a choice based on the status of a switch. Imagine that we have an NPC that offers the player a list of weapon to choose from.

To disable an option based on the status of a switch, we need to enter the following command before presenting the player with the choices, disable_choice(x, “s[y]”). Replace x with a number to represent the option to disable, and replace y with the switch number. If we want to disable/hide Hand Axe if switch number 10 is ON, we will need to use disable_choice(1, “s[10]”). Now whenever switch number 10 is ON, option 1, the Hand Axe, will be disabled.

Note: s[…] is the same as $game_switches[…].
disable_choice(x, “s[]”) is the same as disable_choice(x, “$game_switches[]”)


$game_variables supported conditional statements

This is very very similar to switches, except that you use v[…] or $game_variables[…] instead of s[…] or $game_switches[…].

Imagine we have a variable to store the number of Dragons we slayed for a quest, the number will be stored in variable 11. Before that value in variable 11 reaches 10, we do not want player to be able to have access to the “Dragon Shield” option.

Dragon Shield choice will be disabled if the value stored in variable 11 is less than 10.

Note: v[…] is the same as $game_variables[…].
disable_choice(x, “v[]”) is the same as disable_choice(x, “$game_variables[]”)

Advertisements
 
2 Comments

Posted by on September 17, 2015 in Scripts

 

Tags:

2 responses to “[Tutorial] 姫Hime’s Choice Options: $game_variable and $game_switches supported conditional statements

  1. Dragonfly89

    November 6, 2015 at 7:36 am

    Thanks for the very nice tutorial. I have a little question:
    is there a chance to disable a choice if a switch is turned OFF?

    Like

     
    • Sinweaver

      November 6, 2015 at 3:12 pm

      Yes. You can use “s[x] == true” or “s[x] == false”, where x is the switch ID and true/false for ON/OFF
      Don’t forget to include the quotation marks.

      Like

       

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

 
%d bloggers like this: