Using variables as choice options

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
Hey guys!
I wanna make some fast-travel crystals, and to do this, I wanted to see if we can use switches and variables as choices for the Show Choices command. Is that possible?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,672
Reaction score
2,759
First Language
EN
Primarily Uses
RMMZ
Another option is to use Hidden Item A (or B) type items:
  • Make 1 item per travel point; add the item when the point is discovered/activated.
  • Use Select Item to allow the player to choose a destination from those items.
That might not be viable if you want to use both Hidden Item types for something else, though.
 

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
Another option is to use Hidden Item A (or B) type items:
  • Make 1 item per travel point; add the item when the point is discovered/activated.
  • Use Select Item to allow the player to choose a destination from those items.
That might not be viable if you want to use both Hidden Item types for something else, though.
Okay, but this would mean I would make the item non consumable, right? In other, how should I configure the items? And do common events work?
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,672
Reaction score
2,759
First Language
EN
Primarily Uses
RMMZ
Okay, but this would mean I would make the item non consumable, right? In other, how should I configure the items? And do common events work?
The Select Item command gets the user to select an item from the specified category, then stores that item's ID (or 0 if selection was cancelled) in the specified variable. It doesn't "use" the selected item or anything. The travel point items could be consumable, but that shouldn't matter if they're hidden.

You just need to set each item's name and icon (by default that's all that shows in Select Item) and item type (Hidden Item A or B). Then you can structure your event like this:

◆Select Item:item ID, Hidden Item A ◆If:item ID = 11 ◆Text:None, None, Window, Bottom : :Selected item 11! ◆ :End ◆If:item ID = 12 ◆Text:None, None, Window, Bottom : :Selected item 12! ◆ :End ◆Comment:etc
For your case, I assume you'd want to use Transfer Player in each branch instead of just Show Text. And yes, this could be a common event~
 

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
But what am I allowed to use as an ID? I tested it, and it doesn't work. Here's my item's info in case that helps:
1652696464384.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,672
Reaction score
2,759
First Language
EN
Primarily Uses
RMMZ
An item's ID is its number in the list to the left of the area in your cropped screenshot. The first item is ID 1, the second is ID 2, etc.

Here's a very simple test event that shows the selected item's ID in a message:

◆Select Item:#0030, Hidden Item A ◆Text:None, None, Window, Bottom : :Selected item ID \v[30].
 

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
Well, it still doesn't work. Maybe I should introduce the Select Item variable in the crystal's event.
 

padr81

Guy whose game is taking too long.
Veteran
Joined
Apr 26, 2013
Messages
747
Reaction score
769
First Language
english
Primarily Uses
N/A
Well, it still doesn't work. Maybe I should introduce the Select Item variable in the crystal's event.
Are you sure you're running your conditional branches correctly, this should be super easy.
 

Attachments

  • Capture.PNG
    Capture.PNG
    30.7 KB · Views: 9

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,277
Reaction score
9,701
First Language
German
Primarily Uses
RMMV
Well, it still doesn't work.
if the tips above do not help, then you need to show us screenshots of your event so that we can see where you went wrong.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,277
Reaction score
9,701
First Language
German
Primarily Uses
RMMV
Please show us the database for the Seaholme ticket item.

most likely that item does not have the item ID 2, but a different item id
and this time without cutting off the id's like you did in the first screenshot of it above
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,277
Reaction score
9,701
First Language
German
Primarily Uses
RMMV
as assumed, the item id is 13
so your event has to check for ticket ID=13 to trigger that teleport
 

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
so your event has to check for ticket ID=13 to trigger that teleport
I quickly changed it, thanks for the reminder.
At least I know how to implement such a system without plugins now.
 

NikoPalad

Veteran
Veteran
Joined
Nov 29, 2020
Messages
88
Reaction score
43
First Language
English
Primarily Uses
RMMZ
btw, I have one more question concerning this: is it possible to hide an item in the Item Menu, but still make it visible with the Select Item command?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,672
Reaction score
2,759
First Language
EN
Primarily Uses
RMMZ
is it possible to hide an item in the Item Menu, but still make it visible with the Select Item command?
That's what the Hidden Type A and Hidden Type B types do: they are not visible in the inventory, but can be used for Select Item. (As always, plugins might change this.)

If you want to make a Regular Item or Key Item that is hidden in the normal inventory, I'd suggest using a switch or variable instead. E.g. if the switch is on, add the item before showing the Select Item prompt, then remove it afterwards:

◆If:Night is ON ◆Change Items:Darknesss + 1 ◆ :End ◆Select Item:Input, Key Item ◆Change Items:Darknesss - 1 ◆Comment:then check item ID etc
The effect is the same: the item appears in the Select Item window, but not in the inventory.

Otherwise you'll need a plugin for that, e.g. something that can:
  1. Add new categories that are hidden in the inventory, or
  2. Hide specific items in inventory regardless of category.
 

Latest Threads

Latest Posts

Latest Profile Posts

The main game of my trilo/saga 50%OFF on Steam..... its now or never more
I swap between Ace and MZ so I can stay fresh but - what do you mean you can use subfolders in the plugin's folder for easier organization!?
Did some new music again, praise be. To the next song!
Watch Studio Blue play Numina by starlit in our latest RPG Maker Games Critique stream starting NOW!

Forum statistics

Threads
123,139
Messages
1,154,243
Members
161,474
Latest member
nugogo555
Top