Need help with an item-using event

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
31,355
Reaction score
7,670
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.
 

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,939
Reaction score
2,064
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

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,939
Reaction score
2,064
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
5,624
Reaction score
5,104
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! :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top