Terrain Tag Problem

I'm currently running into an issue with terrain tags.
Right now, I'm working on a timed challenge in my game, DashBored.

I'm using GaryCXJk's Free Movement script to have pixel movement.

Every second, a series of Electrical panels will turn on, and the game runs a check to see if the player is standing on one of the panels. If the player is standing on one, they will take damage.

This has become a problem because the game seems to check the terrain tag in a bizarre way, only checking if the top of the player is in the terrain, rather than the actual hitbox.
1577723117257.png

here's a screenshot of a debug room.
As you can see, the player's hitbox is directly on the tile with the terrain tag that should cause damage.
However, since the player's head isn't in, it doesn't register.
1577723358143.png

Here, on the other hand, the player's hitbox is completely outside of the terrain tag, but it still registers the player as being within the terrain tag, and applies damage.

Any idea for why this could be happening? Is there any possible way to fix this?
show us how you check for the terrain tag, then we might be able to answer your question.
show us how you check for the terrain tag, then we might be able to answer your question.
I use
($game_player.terrain_tag==3)
in a conditional branch which is being run by a controller event.
and I would like to see the entire event, not just the line you use to check.

something messed up the game logic or the movement segments, and we need full info to check where this happens.
and I would like to see the entire event, not just the line you use to check.

something messed up the game logic or the movement segments, and we need full info to check where this happens.

I have two Parallel Process Events running in the map.
1577734360672.png

This one acts as a basic timer, just running the variables that activate the graphics for the panels as well as the actual check.
1577734423097.png

This is the event that actually checks for the player's terrain tag, which for this panels, is 3.
Right now I have it set to not actually damage the player, but to just flash the screen and play an SE to confirm that the event has taken notice.

The panel events themselves are actually just for graphical purposes, since the game is checking for the Terrain tag of a hidden marker graphic set under the events.
I'm guessing it's the script. If you disable that, does the problem still happen?
I'm guessing it's the script. If you disable that, does the problem still happen?

It's a possible explanation. Free Movement both enables Pixel Movement as well as changing the player's hitbox from the default 32x32 pixel square to a custom parameter, as you can see in my screenshots with the visible hitboxes.

Interestingly, it seems that the engine is still using a single 1x1 pixel square in the upper left hand corner of the original 32x32 character parameter to check for Region ID. This is possibly hardcoded into VX Ace, as the engine is originally designed with the grid based movement in mind.

To check, I tested out a few other pixel movement scripts to see if the problem persisted, and interestingly, it did, which I feel lends credence to the 1x1 check being a hardcoded portion.

Just so I can check deeper, do you know which default script handles the Region IDs? This could be the key to finding out whether this is a scripting problem, or one related to something else.
Posting again to report that I have found a solution, albeit a bit of a band-aid one.

Instead of using this:
Code:
($game_player.terrain_tag==3)

I have used this:
Code:
$game_map.terrain_tag($game_player.x + 0.5,$game_player.y + 0.75)==3

Now, for anyone who faces this problem in the future, it's important to keep in mind that this isn't properly getting VX Ace to check the hitbox of the player, but just to move the area that it checks a bit to line up with the player's actual position. You'd have to edit the values to fit up with the size and shape of the character you were working with. For the time being, I think this should work for me.
By default, the region id is not pixel based, it's tile based. Any pixel-based checks would be done by whatever script you're using. You didn't actually answer my question whether disabling the pixel movement scripts completely removed the problem.

Based on your last post, I would say that's definitely what's happening, and instead of doing the above in the script call, you could just find the def terrain_tag method in the Game_Player class in your pixel movement/collision script, and add the logic in there.

Original thread: https://forums.rpgmakerweb.com/threads/terrain-tag-problem.116762/