Need a Passability check.

Hello!

I'm searching for a way, to check, if the player could pass a specific tile, or not. My first try worked with the terrain-tag, but the terrain tag-check from the event-box obvious ignores all terraintags of events. That means, if a ground-Tile is marked with Terraintag 1 (passable), my event discerned this tile as passable. If there is an event on that tile, wich is market by terraintag 2 (NOT passable) it would be ignored by the check.

Is there a way, to check BOTH ... Terrain and Events of it's passability?
only by making two (or more) checks - especially since passability might also be blocked by events or by other means, and it completely changes if you use vehicles.

If you describe what you want to use the passability check for, then we might give you a few tips how to better approach this
An Item, (A carryable bridge) that allows the player, to pass by small creeks.

That mean, if the player want to use that item, i have to check the first tile in move-direction, if this tile is free (no stones etc.) Water. In that case, i have to chek the second tile in line of sight, if this tile is passable land and the player could land and stand here. The player should not be able to land on cliffs, walls, chest, in water ... etc. In that case, the item had to refuse it's service.

Both checks are problematic. Actually the event ignores, if there were event-based stones in the water, and it ignores, if on the other side of the water were event-based obstackles (chests, torches, stones, the player had to push, or pull etc.)
How large are your maps?

If the number of places were the bridge can be used is limited (and it should be if it needs exactly two places of water), simply use the region tool to mark all places where the bridge can be used, and have the event check for Region ID instead of passability.

Migth take some time to place the Region ID on the map, but it's easier than almost any other way of identifying positions.
Do you will say, it is not possible for VX-ACE's scripting language, to get the terrain-ID of the tile, an event is using? oO
It is easy. The real question is whether you really WANT to use terrain tags for this, since terrain tags are applied to all tiles, not just a single tile.
I really don't WANT to use the terrain tags for this task, but actually it is the only way, i could imagine. Regions - like andar suggested - did not work, because they were to static. At some points, there were Objects, which prevent the usage of that item at first, but can destroid or removed later on in the game. A "Allowed" Terrain Tag on the ground layer and a "Not allowed" terrain Tag on an Event, could work ... maybe. That means, if i'm able to check the terrain tag of the event.

But a static Region ID only on the groundlayer does definitevely not, because i'm not able to change the region ID during the game.

If you say, there were other ways, to solve the problem, or there it's a way to simply check the "Passability" (O or X) of a Tile and an Event, that might be working too. But all way's, which provides a static mechanism, don't solve the problem, because the wholen System make sense only, if i could cange the possibility to use the item during the game.
If part of the places can be temporarily blocked, then you best option (in my opinion) is still the use of region IDs, only to have that combined with a second check for the blocking.

You won't be able to get around on that second check, because you can't check the events and the tiles in the same function.

1) Tilecheck:

Using a terrain tag to check the tile passability is less work than painting all possible positions with a region ID, but you will have to check the map structure for the second tile beyond the bridge. With the region-ID, you can preselect only those places where the bridge would fit, preventing that second check.

Your comment about being unable to change the region ID ingame doesn't change anything, because you're also unable to change the Terrain Tag of a given Tile.

2) Blocking Event:

No matter what you do, you have to check for an event temporarely blocking passage in a different way. And that way depends on wether the block is in the water or on land (before the player can reach the water position).

If the block is on land, then you don't need a check - simply have that event "same as player", and the player won't move there.

If the block is in the water, use location info to get the ID of the event there, and then check the properties of that event (unless you decide that all events are blocking, in that case you only need to check if there is an event at that coordinates).

If you're this far into the event data, you no longer need to check a terrain tag of a tilegraphic set in the event (which would be more difficult than checking just the regular event properties)

---------------------------

One more advice:

Search the forum for Tsukihime's Tile Swap Script (I don't have the link at the moment), that would probably make things easier after you have checked your conditions and want to place the bridge.
If the block is in the water, use location info to get the ID of the event there, and then check the properties of that event (unless you decide that all events are blocking, in that case you only need to check if there is an event at that coordinates).
That sounds good. If you could tell me, how i do this, i will give it a try.
No answer?

Please, how could i check the propertys of an event? For my purpose, i only need to know the passability of the event. How could i check this?
You can't in a normal way, maybe with a small script you can. I would suggest you ask for once in the script requests forum.
I have done a maze puzzle in my game, where the player has to use a plank (inventory item) to form a bridge between two platforms.


Instead of checking whether the map is passable at each step, I simply used regions to paint the areas where the player COULD use the plank (the tiles on water between two platforms that were the same height and two tiles apart, due to the length of the plank). Then my event to check whether the player could use the plank simply grabbed the region id of the tile that was in front of the player, and if it was the id I'd allocated, I'd use events to place the plank, and remove it from inventory. I then used events around it to let them pick the plank back up again.


The bridge itself is made from events using tiles in Tileset B (as they would then override the impassible setting on the water tiles below).
Thak you all for the Help. In the meanwhile, i think i'have solved the problem. I made a check, if there is any event on one of the target files, and if it, the item could not be used. That means, if i want to "open" a closed way, i have to remove the blocking item and transfer it to the upper left corner of the map, to make the passage free.

It is not exactly the solution, i have dreamed about, because i had to change all block Event's in the Game now. But - well - at least it is a solution, and it works good.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/need-a-passability-check.20200/