Xenphir

Nature's Friend
Veteran
Joined
Nov 20, 2017
Messages
198
Reaction score
133
First Language
English
Primarily Uses
RMMV
Hello! So today I am asking for assistance to understand the cleanest and most efficient way to effect an event with an item. Multiple events of the same kind, on various maps. There will be a LOT in my game so I was trying to find something easier than constantly checking player location compared to each event's location.

Example: I am using Galv's tool plugin already to run common events on tool use and have a little UI for it. So right now when player presses ALT it uses an item or tool. For this example an axe.

There are many trees on various maps and I want it so that when I use the axe item it chops down the tree. For this I used to have the events themselves contain parallel processes that when player is above the event and facing down, to the left of the event and facing right, etc, it will check if player uses an item. This was with mogs chrono engine and ABS system. I've since removed it due to multiple bugs it caused.

I was also very worried that having too many events on a map with parallel processes constantly checking the player's location would lag later on. If this is not the case, great! But something tells me it is as I've seen others report too many of these processes causes lag.

What I'm trying to do now:

I need the events to not all be checking and running 24/7 if possible. Instead I want the common event I run to check for the event the player is facing, and effect that event. So when player faces a tree and presses the button to activate the axe item common event, it will trigger that tree and only that tree to be chopped down.
 

NinjaKittyProductions

Professional Murder Hobos
Veteran
Joined
Jul 9, 2013
Messages
484
Reaction score
472
First Language
English
Primarily Uses
RMMV
Could you not just have the tree event check with a condition branch whether or not the player had an axe in their inventory and when the action button is pressed chop down the tree?
I might not be understanding what you are asking @_@
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,757
Reaction score
8,966
First Language
German
Primarily Uses
RMMV
There are two different directions from where to approach this.
One of them is to use code in the event - this would mean that the event needs to be set to action button and check whatever is needed.

The other way is to check what is on the map.
you need to use two variables and control variable as well as conditional branches to check which XY position is in front of the player.
Then use get locaton info to return what is on that position - for example if there is an event, get location info can give you the event id.
then react and change that event.

Both ways have their own advantages and disadvantages.
 

Xenphir

Nature's Friend
Veteran
Joined
Nov 20, 2017
Messages
198
Reaction score
133
First Language
English
Primarily Uses
RMMV
I'm a coding noob haha. I have no idea how to do that.

I'm not quite sure how to get the event ID. If I could do get the event ID from each event the player faces, and then effect that event from a common event using yanfly's selfswitches and variables, that would be ideal.

So basically the variables are always set to player x and y, and more variables change depending on which direction the player is facing? Like conditional branches for if the player is facing left, -1 X or something similar for all directions. Then with those variables somehow check what event is at that location and when using an item it checks what event the player is looking at? I really am a noob at getting event info for interactions. Thats the issue I have right now.

If it helps I'm using yanfly's self switches and variables, as well as the event morpher, copier, and spawner.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,757
Reaction score
8,966
First Language
German
Primarily Uses
RMMV
yes exactly - what you're missing here is that "get location info" is a specific event command available that can get you different data about a map location, including the ID number of the event there (if any).
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.
That awkward moment when you're talking about thinking about writing a limited shop stock plugin for MZ and then find out you already wrote one...last May. My memory is so bad.
When I open my project and I'm like, hell yeah.
Some drawings I made in Lapis, one day I intend to involve them in some RPG Maker project.
* maybe two wall frames
*or some sprite flower tiara, or maybe it inspires someone to do something.
bdd19b62e539d17b3b00cc3d63034f7d.jpg

fcca5c8471b34483da8e032cfe579275.jpg

Forum statistics

Threads
118,426
Messages
1,115,862
Members
155,378
Latest member
TrashWizard
Top