Making an item work in specific areas

Hi guys! This is my first post, and it won't be the last one, for sure!


I am new in RPG Maker VX Ace and am learning a lot of stuff while working in my project but I still can't figure out some things. My problem now:


I have created an item that works in a specific way (not in battles). For example, in my project there are certain places with some special ground tiles. When the item is used, this tiles become a hole in the ground where I can get through. I have make this happen thanks to an common event call. The problem is that I want this object to work when I am close to these certain tiles of ground only. Now, when I use the object, no matter where I am, all those ground tile events in all the maps become holes. I want to make those ground patches become holes individually, when I use the item close to them.


I don't know if I explained my issue very well...


Thank you in advance. 🙂
Instead of a common event, why not make a map event instead where all the ground tiles are placed. If this item is used close to the tiles of ground, then a self switch will be called that will change the graphic to a hole that you can get through. This way the ground tiles don't all go off at the same time.
If you need it to be a common event, you need to check if the tiles can use it or not and use different results depending on position.


Basically you need to read the player position with two control variable commands, recalculate to the event position depending on facing and then use get location info to determine if the item can be used or not.
Thank you for the help, guys. I don't really understand what you mean, though.


I am not very familiar with the "get location info" command... Does it have to be with the region settings? I don't understand how to read the player position via variables either. Can you detail your explanation a bit more?


I think there must be an easy way to do this with the regions settings, but I have never used them before (I thought they were mainly used for battle encounters, and there are not such battles in my project).


EDIT: Nevermind, guys. I just figured it out: I used a combination of variables with set numbers and swithes and made the tiles become holes when the variables set number was satisfied. I don't know if this is what you were trying to tell me. Anyway, thank you very much! 🙂
Good that you were able to solve this.


In the future, if you are using this all over your game, you can scale it much more easily (and reduce potential lag) by using some RGSS3 scripting in your Common Event to check the location of nearby events and, if they are the ground tiles in question, make them into holes.  Since you're new to VX Ace, the way you're doing it is just fine for now.  When you feel like you're very comfortable with complex events, go ahead and ask in the Learning Ruby/RGSS subforum for advice about how to do this kind of thing.
Thanks, Wavelength. You are right. This is not an elegant solution, but it will work for now. I am starting to have lag problems in the whole map, and I don't know if this is because of the amount of events (and if I use a passing time script the lag is extreme while the tiles are tinted to mimic night). Anyway, I will fix this kind of things while I make progress. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/making-an-item-work-in-specific-areas.58938/