afternoon700

Villager
Member
Joined
Sep 4, 2017
Messages
17
Reaction score
1
First Language
Korean
Primarily Uses
RMMV
I'm currently making a puzzle game for a school project.
I got stuck in this "use-specific-item-to-proceed" process...
For example, let's say that the player has to use a key in front of a door.
My objectives are 1) assigning the right key to the door, 2) and showing a message if the player did not insert the right key and 3) making sure the key only works in front of the door (not making it able to use keys in the kitchen when I want to open the basement door or something.)
Ex) Player stands in front of a golden door and opens the item menu. Player uses a silver key. Message: Wrong key. The player opens the item menu. Player uses a golden key. The door opens. Player stands in front of a tree. The player opens the item menu and uses a golden key. Message: This is not the time to use that.
I've messed up with Select Items, Common Events and setting the player location as variables (doing this, however, did not allow my player character to move), but no luck. Could anyone guide me on how to achieve my goal/or inform me of a tool that allows me to do so? (I've found Yanfly's Advanced variable system, but it was not exactly what I wanted.)

I'm kinda new to this stuff + English is not my first language, so let me know if I made any mistakes. Thanks!
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,366
Reaction score
8,774
First Language
German
Primarily Uses
RMMV
you only need the regular map event for the door that is blocked - no common event needed, and neither do you need to check for player position.

when triggering the door event, you use a show text for "Please select key to open door", followed by a select key item command.
That command returns the ID of the selected item into the variable given.
So next is conditional branch, comparing the variable with the number of the key that should fit here. If yes, open and transfer - if not show text "wrong key".

That's it - nothing more, you just need to make sure that the player can find the key as an item for this to work.

If you need help with this, post a screenshot of the event where you tried to do this and we'll tell you what to change.
 

Kupotepo

Fantasy realist/Advocatus Diaboli
Veteran
Joined
Jul 5, 2017
Messages
1,957
Reaction score
2,107
First Language
Thai
Primarily Uses
RMMV
@afternoon700, I thought it is hard, but Andar's way is corrected. Here is visual. I tested.Capture20.PNG Capture27.PNG
 

Attachments

  • Capture26.PNG
    Capture26.PNG
    7.3 KB · Views: 0

afternoon700

Villager
Member
Joined
Sep 4, 2017
Messages
17
Reaction score
1
First Language
Korean
Primarily Uses
RMMV
I just realized that the "door" example that I mentioned was totally inappropriate for my case. I am terribly sorry...
The case is, I do not want the player to know that an event is a "door" of some sort.
Map004.png
This is what I want to achieve:

1. On standing on the red star, a message appears: "Looks like some sort of switch! But it can't be reached..."
2. The event ends without a select screen or anything. The player needs to open the menu, choose the item window, then use a "balloon."
2-1. Using other items than a balloon will print a text "No use."
2-2. If the player is not on the red star and the balloon is used, the text "This is not the time to use that." will be printed.
3. When the "balloon" is used on the red star, a key will be dropped.

Again, thank you for the tips (which were very useful in other parts of my project!) and sorry for the confusion I brought about.
 

Kupotepo

Fantasy realist/Advocatus Diaboli
Veteran
Joined
Jul 5, 2017
Messages
1,957
Reaction score
2,107
First Language
Thai
Primarily Uses
RMMV
@afternoon700, Please note that Key Count #1 can change to be any name.

Yes, 1. On standing on the red star, a message appears: "Looks like some sort of switch! But it can't be reached..."
Yes, 2. The event ends without a select screen or anything. The player needs to open the menu, choose the item window, then use a "balloon."
Yes 2-1. Using other items than a balloon will print a text "No use." Note: it is going to cost you a lot of common events to make each item respond saying "No use" when trying to use it.
No, 2-2. If the player is not on the red star and the balloon is used, the text "This is not the time to use that." will be printed. (I am not very good at a variable location yet sorry or you could try Yanfly Event Region Trigger plugin):kaoswt2:
Yes, 3. When the "balloon" is used on the red star, a key will be dropped.

That is why Andar stopped you because it can turn into a complicated solution if you do not want to change your vision.
 

Attachments

  • Capture33.PNG
    Capture33.PNG
    124.2 KB · Views: 3
  • Capture34.PNG
    Capture34.PNG
    24 KB · Views: 3
  • Capture35.PNG
    Capture35.PNG
    23.7 KB · Views: 3
  • Capture36.PNG
    Capture36.PNG
    71.6 KB · Views: 3
  • Capture37.PNG
    Capture37.PNG
    70.6 KB · Views: 4
Last edited:

afternoon700

Villager
Member
Joined
Sep 4, 2017
Messages
17
Reaction score
1
First Language
Korean
Primarily Uses
RMMV
@afternoon700, Please note that Key Count #1 can change to be any name.

Yes, 1. On standing on the red star, a message appears: "Looks like some sort of switch! But it can't be reached..."
Yes, 2. The event ends without a select screen or anything. The player needs to open the menu, choose the item window, then use a "balloon."
Yes 2-1. Using other items than a balloon will print a text "No use." Note: it is going to cost you a lot of common events to make each item respond saying "No use" when trying to use it.
No, 2-2. If the player is not on the red star and the balloon is used, the text "This is not the time to use that." will be printed. (I am very good at a variable location yet sorry or you could try Yanfly Event Region Trigger plugin):kaoswt2:
Yes, 3. When the "balloon" is used on the red star, a key will be dropped.

That is why Andar stopped you because it can turn into a complicated solution if you do not want to change your vision.


Huge thanks! You're a lifesaver!!
 

Kupotepo

Fantasy realist/Advocatus Diaboli
Veteran
Joined
Jul 5, 2017
Messages
1,957
Reaction score
2,107
First Language
Thai
Primarily Uses
RMMV
@afternoon700, no problem, if you do not like the simple way. :kaojoy:You could wait for others who have JavaScript knowledge to guide you in different ways which might be better than mine.
 

afternoon700

Villager
Member
Joined
Sep 4, 2017
Messages
17
Reaction score
1
First Language
Korean
Primarily Uses
RMMV
I just realized that the "door" example that I mentioned was totally inappropriate for my case. I am terribly sorry...
The case is, I do not want the player to know that an event is a "door" of some sort.
View attachment 116296
This is what I want to achieve:

1. On standing on the red star, a message appears: "Looks like some sort of switch! But it can't be reached..."
2. The event ends without a select screen or anything. The player needs to open the menu, choose the item window, then use a "balloon."
2-1. Using other items than a balloon will print a text "No use."
2-2. If the player is not on the red star and the balloon is used, the text "This is not the time to use that." will be printed.
3. When the "balloon" is used on the red star, a key will be dropped.

Again, thank you for the tips (which were very useful in other parts of my project!) and sorry for the confusion I brought about.

Could anyone help me achieve 2-2?
 

afternoon700

Villager
Member
Joined
Sep 4, 2017
Messages
17
Reaction score
1
First Language
Korean
Primarily Uses
RMMV
Could anyone help me achieve 2-2?

Okay, I finally did it with the help of UnPropro's Conditional Branch Assistant.20190527002534_1.jpg 20190526231327_1.jpg
Just do this instead of using Yanfly's Region Trigger or Region Events. It works like a charm.
 

Darniela

Villager
Member
Joined
Mar 16, 2019
Messages
17
Reaction score
5
First Language
Czech
Primarily Uses
RMMV
Okay, I finally did it with the help of UnPropro's Conditional Branch Assistant.View attachment 116334 View attachment 116335
Just do this instead of using Yanfly's Region Trigger or Region Events. It works like a charm.
Hello,
I also want to make a puzzle minigame and I like your solution with The Conditional Branch Assistant plugin, but I can't find it anywhere. Any suggestions for where to get it? :)
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,851
First Language
English
Primarily Uses
RMVXA
@Darniela I looked around and couldn't find a working version of the CBA plugin either. However, if all you need to do is see the Region ID that the player is standing on, and set a variable equal to it, use this Script call:

$gameVariables.setValue(variable_id, $gamePlayer.regionId());

Replace variable_id with the ID of the variable you want to set. Then, use that variable in a conditional branch to make sure that it's the Region ID you want to "fully activate" the item on.
 

Darniela

Villager
Member
Joined
Mar 16, 2019
Messages
17
Reaction score
5
First Language
Czech
Primarily Uses
RMMV
@Darniela I looked around and couldn't find a working version of the CBA plugin either. However, if all you need to do is see the Region ID that the player is standing on, and set a variable equal to it, use this Script call:

$gameVariables.setValue(variable_id, $gamePlayer.regionId());

Replace variable_id with the ID of the variable you want to set. Then, use that variable in a conditional branch to make sure that it's the Region ID you want to "fully activate" the item on.
Thank you very much for your solution, I'll definitely try it out in my project! :)
 

Latest Threads

Latest Posts

Latest Profile Posts

If the world treats you like an enemy... Then the world must be your enemy...
Last monday Hawkzombie played ATV.

Here are the videos:


Yes, I'm alive. No the semester didn't kill me. Though there are days I feel like I am dead.
In the review stages for Pixacrea to be put up on Steam :) Coming Soon page... hopefully coming soon ;)
since all my maps are hand drawn... I admit, I super envy those who can make the tileset's work. I'm garbage at mapping, but slightly less bad at just drawing my own areas. plus it's easier to draw my own sprites than edit others to look like my characters.

Forum statistics

Threads
117,289
Messages
1,106,169
Members
153,477
Latest member
GingaAle
Top