Terrain Tag Problem

Karbonic

Off Brand OFF
Veteran
Joined
Dec 24, 2015
Messages
57
Reaction score
20
First Language
English
Primarily Uses
RMMV
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,477
Reaction score
6,854
First Language
German
Primarily Uses
RMMV
show us how you check for the terrain tag, then we might be able to answer your question.
 

Karbonic

Off Brand OFF
Veteran
Joined
Dec 24, 2015
Messages
57
Reaction score
20
First Language
English
Primarily Uses
RMMV
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,477
Reaction score
6,854
First Language
German
Primarily Uses
RMMV
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.
 

Karbonic

Off Brand OFF
Veteran
Joined
Dec 24, 2015
Messages
57
Reaction score
20
First Language
English
Primarily Uses
RMMV
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,779
Reaction score
12,207
First Language
English
Primarily Uses
RMMV
I'm guessing it's the script. If you disable that, does the problem still happen?
 

Karbonic

Off Brand OFF
Veteran
Joined
Dec 24, 2015
Messages
57
Reaction score
20
First Language
English
Primarily Uses
RMMV
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.
 

Karbonic

Off Brand OFF
Veteran
Joined
Dec 24, 2015
Messages
57
Reaction score
20
First Language
English
Primarily Uses
RMMV
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,779
Reaction score
12,207
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Free RPG Maker Ready Charging Up Animation

Enjoy -No Credit Needed But Appreciated -
Download it at https://lvgames.itch.io/free-charging-up-pixel-animation-fx-rpg-maker-ready
:/ .... so, thought I’d go to the park to sit in the cool breeze and get out of the house a little. Nope, guess that’s quarantined too. Ok...
How do you do when you want to work on projects but the game companies make so many games available for free because of the quarantine?
Kes
I have just stepped down from being a Mod, so please don't send me any more pm's with Mod questions. Thanks
Made a brief video showcasing early game play... Got a copyright claim by BIG UP! (https://big-up.style/) for using music I bought from here (Future Steam Punk Pack). Now I wonder if I should strip any purchased music from here out of my game. :LZSskeptic:

Forum statistics

Threads
95,486
Messages
929,499
Members
125,726
Latest member
Truvirian
Top