Saturday 3 September 2016

Shortcuts in the Map Editor

Left Click
Places the currently selected tile

Right Click
Copies every tile on the clicked square and sets that combination as the currently selected tile

Shift + Left Click
Places the currently selected tile
BUT if the currently selected tile is an Auto Tile, then the base tile (without shadows or edges etc) will be placed instead
OR if Shift + Right Click was used prior to this click, places an exact copy of the currently selected tile

Shift + Right Click
Copies the selected tile exactly as it is and sets it as the currently selected tile (very useful when you don't want edges drawn on Auto Tiles)


Secret Passages

Everyone wants to put secret passages in their RPGs, but if your secret passage has to go through an impassable wall, it can get a little complicated.

People have different ways of doing it:

Duplicate Tiles

One of the simplest methods is to just duplicate your impassable wall tile onto another tileset and set it up so that it's passable (with * so the Player is actually hidden beneath it). Then just use those tiles on top of passable ground tiles where you want your secret passage.

The problem with this is that it fills up your available tilesets with redundant tiles, and if your impassable wall tile is an Auto Tile then it is a bit more difficult to duplicate them correctly and you'll likely run into other drawing problems as well. (Do note, however, that holding Shift down when you right click a map tile will copy that tile exactly onto another tile when you left click.)

Forced Movement

Another method I've seen is for the game to take control of the Player's movement while they're in the secret passage, and return control to the Player once they're on the other side.

I personally don't like this method, as it seems to defeat the purpose of having a secret passage in the first place (and I think Player movement should only be controlled during cut scenes).

Yanfly's Move Restrict Region (not a solution)

Yanfly's Move Restrict Region script allows you to specify regions on your map where a Player or NPC cannot go. Of most interest is the option to block passage even if the Player has Through ON.

Region 61 = impassable tiles;
60 = passable tiles.
Using this script, you could use events at the start and end of your secret passage to turn Through ON or OFF on the Player (so they can pass through the impassable tiles freely) and mark an impassable region around your secret passage to prevent the Player from being able to pass through the surrounding walls.

Alternatively, with a few adjustments, you can use similar logic to specify regions on your map where a Player or NPC can always go (even if the tile is impassable!) and this way you no longer need events to toggle Player Through ON or OFF.

This would be the perfect, most efficient, simple, preferred solution, but...

The problem is, the now passable impassable tiles of your secret passage are not drawn on top of the Player. You could create events to turn the Player's transparency on and off, but it's pretty clunky to do so and the animation just isn't smooth.

So if you want to utilise this method, you'd still need additional passable * tiles for your secret passage, which ultimately makes it unnecessary to use this method at all...

Tile Character Sheets

Similar to the Duplicate Tiles option, you could create special character sheets with your impassable wall tiles and then use Events (with those tiles as their graphic, and Priority set to Above Characters) to mark out your secret passage.

If you don't mind having a load of Events that don't do anything on your map, and you don't mind the tediousness of it (especially if you want your Player to also move over the top of these tiles at some point), then this is a pretty simple method that works pretty well once you've set up the character sheets (if your tiles are Auto Tiles, then this can take a bit of work).

Keep in mind that you need to save your character sheet with a ! at the start of its filename for RPG Maker VX Ace to draw them at their proper size.

Hime's Map Overlay 

Hime's Map Overlay script allows you to have another map drawn over the top of an existing map. Using this script, you could put passable ground tiles down on your map where you want your secret passage to be, then create another map of the same size with your Auto Wall Tiles in the same place, and have Hime's script overlay it on top.

The Player would then freely be able to pass through your secret passage, hidden underneath the overlaid wall tiles, and no tricky event logic would be needed on your part. What's more, you can still use the overlay map as a normal map if you want your character to be able to jump across rooftops or something.

The downside is that you end up with extra maps in your map list, you can't see the overlay in the editor, and as such it can be a little tedious lining the two maps up.

Also, Hime's scripts are not free for commercial use.

Player Touch Trigger


The Player Touch trigger behaves differently depending on what Priority you give to your Event, and also depending on whether the Event has Through ON. It's pretty straight forward when the map tile beneath the Event is a passable one, and Through is OFF:

(Where Through is mentioned, it is always referring to the Through setting for the Event unless specifically stated otherwise.)

Events on Passable Map Tiles

Priority = Below Characters

The Player can move on top of the Event, and the Event triggers when the Player does so. The Event's Through setting has no effect on the Player.

Priority = Same As Characters

With Through OFF, the Event will trigger when the Player touches the Event by pressing the arrow keys, but the Player does not and cannot move on to the Event.

With Through ON, the Player can freely pass through the Event, but never actually touches it. Hence, the Event is never triggered. Kind of like an illusion, or a ghost. (The same thing happens if the Player has Through ON.)

HOWEVER, if the logic within the Event sets Through ON (when it's triggered), then the Player can touch the Event, trigger the Event, and pass through the Event. BUT from then on, until Through is set back to OFF, the Event will no longer be touchable or triggerable.

Priority = Above Characters

The Player can move beneath the Event, and the Event triggers when the Player does so. The Event's Through setting has no effect on the Player.

Events on Impassable Map Tiles

Some unexpected behaviour may occur when the map tile the Event is sitting on is impassable.

Priority = Below Characters OR Above Characters

Since the Player cannot move on to the map tile where the Event sits, the Event will never be triggered (even if Through is ON).

Priority = Same As Characters

The Event will trigger when the Player touches the Event by pressing the arrow keys, but of course the Player still does not and cannot move on to the Event. 

This is true even if the Event has Through ON or the Event logic turns Through ON when triggered. (Makes sense, since the Player runs into an impassable map tile.)

Check out what this means for Doors and Secret Passages.

Doors

For an explanation of how Player Touch works with different Priority settings, be sure to read this post about the Player Touch Trigger.

Doors

Priority and Trigger settings for a Door
Doors work by placing a passable map tile (usually a black entrance tile) over the top of an impassable wall tile (which makes the map tile passable, as well as for aesthetics), and having your Door Event on top of that

The reason Priority is set to Same as Characters and not either of the others is purely for aesthetic and animation reasons:
From left to right:
Priority = Above, Same, Below
Above is incorrect when beneath the door. Below is incorrect when on the door.

Priority = Above Characters

If set to Above Characters, the Player will walk underneath the door, the door will open on top of them, and they will remain underneath the door as they walk through it.

Priority = Below Characters

If set to Below Characters, the Player will walk on top of the door, and then the door will open beneath them (if it's a trap door in the floor that they're falling through then this is a good thing). 

Priority = Same As Characters

When set to Same as Characters, however, the Player will be in front of the door when coming from the bottom, and then will automatically switch to being behind the door once they're on the same tile. This makes it actually look like they are passing through a doorway, and things like door frames will be correctly drawn above the character.

Another key difference with Same as Characters is that the Player will open the Door before moving onto the Door tile, rather than moving onto it and then opening it either on top of them or beneath them.

Event Logic

This is the logic supplied by RPG Maker's Quick Event Creation -> Door feature:

The logic supplied by Quick Event Creation > Door

With Priority set to Same as Characters, the Door Event itself is actually impassable, which is why the Door Event sets Through ON when it is opened (to make the Event passable). 

If you read this post about the Player Touch Trigger, you'll recall that an Event set to Same as Characters will not trigger if it has Through ON.

For doors that transfer the Player to a completely different map, this does not matter because the Event resets when the Player returns. Of course, these doors also don't have any closing logic on them, either.

Closing Doors

So if you want doors or gates for aesthetics (eg. inside, or on a castle's exterior wall) that the Player can open, close, and pass through without being transferred to a different map, then you have to make sure to add closing logic and turn Through OFF when the door is closed.

Closing logic

It gets more complicated when there is an impassable wall tile above the door, which leads us to Secret Passages.


Player Touch Trigger


The Player Touch trigger behaves differently depending on what Priority you give to your Event, and also depending on whether the Event has Through ON. It's pretty straight forward when the map tile beneath the Event is a passable one, and Through is OFF:

(Where Through is mentioned, it is always referring to the Through setting for the Event.)

Events on Passable Map Tiles

Priority = Below Characters

The Player can move on top of the Event, and the Event triggers when the Player does so. The Event's Through setting has no effect on the Player.

Priority = Same As Characters

With Through OFF, the Event will trigger when the Player touches the Event by pressing the arrow keys, but the Player does not and cannot move on to the Event.

With Through ON, the Player can freely pass through the Event, but never actually touches it. Hence, the Event is never triggered. Kind of like an illusion, or a ghost.

HOWEVER, if the logic within the Event sets Through ON (when it's triggered), then the Player can touch the Event, trigger the Event, and pass through the Event. BUT from then on, until Through is set back to OFF, the Event will no longer be touchable or triggerable.

Priority = Above Characters

The Player can move beneath the Event, and the Event triggers when the Player does so. The Event's Through setting has no effect on the Player.

Events on Impassable Map Tiles

Some unexpected behaviour may occur when the map tile the Event is sitting on is impassable.

Priority = Below Characters OR Above Characters

Since the Player cannot move on to the map tile where the Event sits, the Event will never be triggered (even if Through is ON).

Priority = Same As Characters

The Event will trigger when the Player touches the Event by pressing the arrow keys, but of course the Player still does not and cannot move on to the Event. 

This is true even if the Event has Through ON or the Event logic turns Through ON when triggered. (Makes sense, since the Player runs into an impassable map tile.)

Check out what this means for Doors and Secret Passages.