[REQUEST] SCRIPT FOR USING A CERTAIN ITEM IN A CERTAIN SPOT, NEEDED FOR PUZZLE GAME IN RMVX

Posts

Pages: 1
I'm working on a puzzle adventure game right now, and I'm currently trying to either find a script, or figure out how to do it with RMVX's built in tools, that makes it so that if the player uses a certain item in their inventory in the right spot, it will trigger something.

For example, if while standing in front of a locked door, I go to my inventory and select a key, the door will unlock.

I think I saw a script or way to do this a while ago, but I can't remember where it was or how it was done. I'm still experimenting around but any help would be appreciated.
Caz
LET'SBIAN DO THIS.
6813
Urgghhh, had to be VX..

Unfortunately, VX is quite a pain because they decided to take away terrain tagging. There's a script I found for it here but I dunno how good it'll be, or if it even works.

Basically, in the other RPG Makers, you could tag a tile in the editor to be tile type 1, 2, 3, etc. which could be stored on a variable. You could then make it so that the item you used called a common event which checked which variable tile you were stood on before allowing you to use it.

So for example: you have a tile which we will call "sand" and a tile which we will call "grass". Sand is terrain tag 1, grass is tag 2. You have an item in your inventory called "Empty Bucket" which calls a common event. The common event sets variable 1 to whatever terrain tag the hero is stood on and then opens a conditional branch. The conditional branch asks what number variable 1 is storing. If it's 1, the "Empty Bucket" will be removed from the inventory and be replaced by "Bucket of Sand". If it's 2, the game will whinge at you and say you can't pick up grass in a bucket.

If you can get that script to work or find a better terrain tag script, then I hope this helps a little.. In fact, let's just go with "I hope this actually makes sense."
KingArthur
( ̄▽ ̄)ノ De-facto operator of the unofficial RMN IRC channel.
1217
1. Make the "key" item call a Common Event.
2. Within the Common Event, read in and store the Hero's X and Y coordinates on the map.
3. Run a Conditional Branch that checks the Hero's X/Y coordinates against a preset value.
4. If Conditional Branch returns True, unlock the door and do whatever other processing is required. If Conditional Branch returns False, increase "key" item in inventory by 1 and do whatever other processing is required.

No need for any scripts.
author=KingArthur
1. Make the "key" item call a Common Event.
2. Within the Common Event, read in and store the Hero's X and Y coordinates on the map.
3. Run a Conditional Branch that checks the Hero's X/Y coordinates against a preset value.
4. If Conditional Branch returns True, unlock the door and do whatever other processing is required. If Conditional Branch returns False, increase "key" item in inventory by 1 and do whatever other processing is required.

No need for any scripts.


What I ended up doing. A little bit tedious, but at least it works.
Caz
LET'SBIAN DO THIS.
6813
Ahh, I see. I thought you'd have waaaay more doors or other things. Yeah, using X and Y also works. My bad, I'm a bit too sleepy to think straight. ^^;;
author=Caz
Ahh, I see. I thought you'd have waaaay more doors or other things. Yeah, using X and Y also works. My bad, I'm a bit too sleepy to think straight. ^^;;


Hehe naw, the puzzles that use this will essentially just be "Use this item at this spot, happy times occur" x)
Pages: 1