RSS

[Tutorial] 姫Hime’s Choice Options: $game_party supported conditional statements

17 Sep

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


If you want to do something to the 3rd option when the player has more than 5000 gold:

  • To hide the choice: hide_choice(3, “p.gold > 5000”). You can also use hide_choice(3, “$game_party.gold > 5000”).Doing this will hide the option if the player has more than 5000 gold with him/her.
  • To disable the choice: disable_choice(3, “p.gold > 5000”). You can also use disable_choice(3, “$game_party.gold > 5000”).Doing this will disable the option if the player has more than 5000 gold with him/her.
  • For text_choice where you can replace the name of a choice with something else such as “???” based on some condition: text_choice(3, “???”, “p.gold > 5000”) or text_choice(3, “???”, “$game_party.gold > 5000”).Doing this will make the option show up as ??? instead of the option’s actual name if the player has more than 5000 gold with him/her.

Here’s a code sample where we have an NPC that offers 3 choices to player:

Event Page: Choice 1 will be hidden if the player has more than 5000 gold. Choice 2 will be disabled if the player has more than 5000 gold. Choice 3’s name will be changed to ABC if the player has more than 5000 gold.

When the player has 0 gold, he/she can view all the options.

When the player has more than 5000 gold, the effect will start to kick in. Option 1 is now hidden, Option 2 is disabled and Option 3 is now called ABC.


If you want to do something to the 2nd option when there are more than 2 members in the party:

  • To hide the choice: hide_choice(3, “p.members.size > 2”). You can also use hide_choice(3, “$game_party.members.size > 2”).Doing this will hide the option if the party has more than 2 actors in it.
  • To disable the choice: disable_choice(3, “p.members.size > 2”). You can also use disable_choice(3, “$game_party.members.size > 2”).Doing this will disable the option if the player has more than 5000 gold with him/her.
  • For text_choice where you can replace the name of a choice with something else such as “???” based on some condition: text_choice(3, “???”, “p.members.size > 2”) or text_choice(3, “???”, “$game_party.members.size > 2”).Doing this will make the option show up as ??? instead of the option’s actual name if the party has more than 2 actors in it.

Here’s a code sample where we have an NPC that offers 3 choices to player:

When there is only one member in the party, all the options will show up as Option 1, Option 2, and Option 3.

When there are 2 members in the party, Option 1 will be hidden, Option 2 will be disabled, and Option 3 will be renamed ABC.


Other checks you can perform includes number of steps taken

  • To hide the choice: hide_choice(3, “p.steps > 200”). You can also use hide_choice(3, “$game_party.steps > 200”).Doing this will hide the 3rd option if the party has walked more than 200 steps.
  • To disable the choice: disable_choice(3, “p.steps > 200”). You can also use disable_choice(3, “$game_party.steps > 200”).Doing this will disable the 3rd option if the party has walked more than 200 steps.
  • For text_choice where you can replace the name of a choice with something else such as “???” based on some condition: text_choice(3, “???”, “p.steps > 200”) or text_choice(3, “???”, “$game_party.steps > 200”).Doing this will make the 3rd option show up as ??? instead of the option’s actual name if the party has walked more than 200 steps.

We can achieve all these by check the status of switches, whether they are ON or OFF, or based on variables too. Read the next section to see how we can disable/hide/rename choices based on switches and variables.


Advertisements
 
Leave a comment

Posted by on September 17, 2015 in Scripts

 

Tags:

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 )

Connecting to %s

 
%d bloggers like this: