[VX Ace] Get event at specific coordinates?

Hi all! I'm brand freakin' new to RMVX Ace, but I have a background in Java, JS, Python, and C/C++ (and very, very rudimentary experience with Ruby - specifically Rails), to give a perspective of my knowledge in attempting to help me here. Also, this is my first post on the forums, so feel free to move this and call me bad things or something if it's in the wrong spot.

I'm attempting to create an event in which the player chops down a tree. Since the trees I'm using span across several tiles (I hope I'm using correct or understandable terminology) and events can only occupy one, I've run into the problem of turning the tree into a stump.

The bottom tile of the tree is just fine. It's an event that changes its self-switch A under the right conditions, causing its graphic to change to a stump. Whoo! But now I have the top of the tree floating over the stump. I turned to scripting because that seems to be my answer to a lot of things, and I really think it's viable here.

What I want to do:

  • Calculate the X- and Y-coordinate of the tree top using the map coordinates of the tree base
  • Access the event at the calculated X and Y
  • Modify self-switch "A" of that event, removing its graphic (using an event page, which I've already set up anyway)
What I have now:

  • The event signifying the bottom of the tree, which successfully turns into a stump under the right conditions
  • Three map variables: the tree base's X, the tree base's Y, and the equivalent of (the tree base's Y) minus 1
My questions, after all is said and done:

  • Is there a Ruby object containing all of the data about a given event?
  • Is there a way to retrieve an event that occupies a given map coordinate?
  • Can I modify the self-switch of this retrieved event using the script?
  • Am I over-thinking the crap out of this?

Thanks in advance! Google brought me here six or seven times, and I hadn't found what I was looking for.

(Update: I'm using VX Ace. I didn't specify that well enough in the original post. Sorry!)
You are making the task more complex than it needs to be. All you really need is use an image with a normal tree, followed by a stump (see below for an example). Then, after the specified conditions have occurred, you can simply change the graphic to the stump by setting a self-switch.

%24!rpgmw-help-004.png


You can create any size of tree you wish, as long as you conform to the correct resource standards. Normally a character set is 32x3 (width) by 32x4 (height). The above character set is 64x3 by 64x4. Also, the '$' and '!' prefix informs RPG Maker that the character set is 'single' and cancels the four-pixel offset that usually occurs.

Excerpt from the RPG Maker VX Ace help file :

Code:
A character can be of any size, and a total of twelve patterns (four directions (down, left, right, up) × 3 patterns) are arranged in the designated order. In each file, arrange characters two down and four across, for a total of eight. The size of this character is calculated based on one-twelfth the width and one-eighth the height of this file.Note that RPG Maker VX Ace displays characters offset four pixels from tiles so as to more naturally portray them with buildings. - Adding an exclamation point (!) to the beginning of a file name cancels the application of the four-pixel offset, and also turns off the translucent effect applied by the bush attribute. This is used mainly for object-type characters on maps, such as doors and treasure chests. It can also be used in combination with the dollar sign ($) special character. - Adding a dollar sign ($) to the beginning of a file name allows you to treat one character as one file. In this case, the size of the character will be one-third of the width and one-fourth of the height of the file. It can also be used in combination with the exclamation point (!) special character.
Just as info because that is not told in the previous post:

Sprites for events are NOT limited to the 32x32-grid of the map tiles.

That's what that advice above is about: make a sprite covering several map tiles (perhaps 32x64 or 32x96 base size) for the tree, and the top part will automatically vanish (revealing the regular map tiles placed there) when you exchange the tree sprite with a stump sprite.

The rest of the information above deals with the formats how to make a spritesheet for the intended sprite - since all spritesheets need 3x4 sprites at minimum, the sheet for the 32x96-sprite needs a size of 96x384, and it's filename needs to start with $! (for example $!tree.png)
I'm not sure that I understand how to apply this in RMVX, but I think I understand the concept behind it. I'll test when I get home; I'm out of the house at the moment. If needed, I can create a new topic in a different section, since this isn't a scripting question after all.

Thanks for the quick and super-informative responses 🙂
The process is exactly the same in VX, as well.
The process is exactly the same in VX, as well.
Sorry for the confusion, I am indeed using VX Ace. I'll figure out how to edit the title, if I can.

EDIT2: updated.
If you want your entire tree to disappear, don't draw it on the map. Turn it into a character sheet and use it in an event. You'll need one cell in the character sheet for the full tree, and another for the stump only. Make sure you understand the layout and size requirements of character sheets, as a small mistake can completely mess it up.
If you want your entire tree to disappear, don't draw it on the map. Turn it into a character sheet and use it in an event. You'll need one cell in the character sheet for the full tree, and another for the stump only. Make sure you understand the layout and size requirements of character sheets, as a small mistake can completely mess it up.
Makes sense. Not that the others didn't, but I can actually visualize this happening! Thanks, I'll test it out and be sure to (double?) post results.

If you'd be willing to move this thread to a more appropriate section, Shaz, I'd appreciate it! 🙂
No worries. Don't double post. If no-one else has posted since, just edit your post. If the problem is solved, also report your post and ask for the thread to be closed 🙂
No worries. Don't double post. If no-one else has posted since, just edit your post. If the problem is solved, also report your post and ask for the thread to be closed 🙂
Will do. Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-get-event-at-specific-coordinates.18652/