Hide/make transparent when player walks behind it?

Status
Not open for further replies.

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
When I have a tall building for example and the players walks behind it, then I want the building tile to be transparent (or hidden if not possible) (and preferably the tiles around the player too). I could do this by using events instead of regular tiles. But then every map would have a huge amount of events and it would slow down the designing of maps by a whole lot.

How can I solve this? Or are there any scripts or build-in features for this?
 

Baka-chan

☆*:.。. o(≧▽≦)o .。.:*☆
Veteran
Joined
Dec 19, 2012
Messages
490
Reaction score
148
First Language
German
Change the tiles you want to be transparent on the tileset with an image editor so semi-transparent or full transparent (whatever you prefer). Then use an event (3rd tab -> map -> change tileset...) to change the tileset to the transparent one ones the player walks on region id 1 for example and back to the normal one ones he steps on region id 2.
 

Titanhex

Do-It-All
Veteran
Joined
Jan 3, 2013
Messages
577
Reaction score
216
First Language
English
Primarily Uses
N/A
Other ways would be to do parallax and make the picture transparent on region id.
 
Last edited by a moderator:

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
So 2 identical tilesets, but one of 'em has the tiles that you can walk behind transparent. Then switch tilesets when walking behind a building or when walking out of it again. Great idea! That should do it.

Overlay parallax mapping would work too I think (if I knew how to make it transparent). But I prefer using tiles.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The problem with switching tilesets is that ALL tiles of that type would become transparent when you walk behind one of them. So walk to the end of a road, you could go left or right, behind buildings, and both buildings are the same. You walk behind the right one, which becomes transparent. But the left one would become transparent too.
 

MountainLynx

Villager
Member
Joined
Jan 24, 2013
Messages
24
Reaction score
5
First Language
English
Primarily Uses
I recall seeing mentioned in some other thread (exactly which one escapes me at the moment) that Touch events are coded such that the events themselves don't check to see if the Actor is there, but rather the Actor checks for touch events with each step. Using a series of events that look like normal tiles and decrease in opacity on touch would be fine if this is the case. Would someone more savvy with the engine's mechanics be so kind as to verify this?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The script DOES look at the actor's position and checks if there's a touch event under it. But to do this, it checks the position of ALL events to find one or more that match the player's position. So it does still poll every event on every frame.
 

MountainLynx

Villager
Member
Joined
Jan 24, 2013
Messages
24
Reaction score
5
First Language
English
Primarily Uses
That,s unfortunate. I suppose an overlay script would be the next best option, provided overlay transparency can be changed by events. Failing that, tileset swapping would be the way to go. Could even set up multiple overlay regions for tileset switching, provided you don't mind a bunch of duplicate tilesets.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
The problem with switching tilesets is that ALL tiles of that type would become transparent when you walk behind one of them. So walk to the end of a road, you could go left or right, behind buildings, and both buildings are the same. You walk behind the right one, which becomes transparent. But the left one would become transparent too.
Ugh... Yes that's an unwanted side-effect.

So there are 3 options so far then:

1. duplicate tilesets with transparency

2. parallax overlay + a tiny script I think

3. fill the overlapping area's with events.

Neither option is 'perfect' but they would probably all work.

If I could just make tiles transparent through a script or switch them with another graphic through a script (w/o switching the entire tileset) then i could just do it like this (quick pseudo code):

- story the players position and check if the tile on that location has a flag set to mark it as a 'transparent tile'.

- if it is the same position as last frame then do nothing. else make all 'flagged tiles' around and on the previous position opaque again and make the 'flagged tiles' around and on the new position transparent.

- that's it.

But afaik there is no option to make tiles transparent or to switch their graphic (ONLY for that specific tile) :( .
 

Titanhex

Do-It-All
Veteran
Joined
Jan 3, 2013
Messages
577
Reaction score
216
First Language
English
Primarily Uses
N/A
You know you don't have to make your entire game Parallax. You could just have that spot and that particular building as a fixed picture. Rinse and repeat for similar buildings. All you need is a fixed picture script and a blank tile that can't be walked on.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Going the parallax route for this will be the easiest way. Simply take a screenshot of your finished map, paste it into an image editing program, save it as a PNG file. Use this as the parallax. Then start removing the parts you don't want to overlap the player (like the ground etc.), leaving only rooftops and some parts of the walls, and trees. Save this as well, and then use the show picture command so that it shows above the player.


You'd need a script to fix the picture to the map. And you need to change the opacity of the picture to make it seem like it's transparent.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
The problem with switching tilesets is that ALL tiles of that type would become transparent when you walk behind one of them. So walk to the end of a road, you could go left or right, behind buildings, and both buildings are the same. You walk behind the right one, which becomes transparent. But the left one would become transparent too.
Use separate tiles for each building, even if they're duplicate.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I got it somewhat working using:

Tsukihime's mapsaver: http://dl.dropbox.com/u/23043573/RPG%20Maker/RMVXA%20Scripts/Tsuki_Map_Saver.txt     (for saving the map to import it into Gimp)

yami's overlay: http://www.rpgmakervxace.net/topic/258-overlay-mapping/        (using 2 images in the parallax layer)

It's a very clean solution and it only takes up like ~200kb per parallax on a 50x50 map because most of it is transparent. Sadly this makes ALL buildings transparent (see attachment). This way the player could see more than you want him too like the hidden treasure chest in this case. I prefer this method above the 'duplicate tileset method'.

Note that I forgot to manually add some shadows to the parallax part.

Using separate images for each building would solve the problem mentioned above but it requires me to manage all those pictures (can be a lot if the project increases it's map-count) and I have to erase all pictures when leaving the map (I better use a script for that too).

So I would need to create a different folder ("overlay" or something) and write a script to show a picture positioned by map-coordinates instead of screen-coordinates and a script that automatically shows/erases the pictures when entering/leaving the map. the pictures must also be shown on top of everything else but below any possible light/fog/weather layers and such. I don't think that I have the skills for that. I think I still need to think a bit more about this.

before.png

after.png
 
  • Like
Reactions: BCj

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
You do not remove the rooftops in the parallax image. Keep everything there, even if it's supposed to overlap the player. Don't remove it.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I'm sorry I don't understand what you're saying. I didn't remove it in the parallax image. I attached the parallax images for this test-project so you can see what I used. I use regular tilesets for everything except for the overlapping areas. Then I use 2 parallax images for the overlapping area's.

I could probably do it with just one parallax image but I haven't figured out yet how to make them 40% transparent and opaque again in code. Or even better, only making the specified region in the parallax transparent.

par1-1.png

par1-2.png
 
Last edited by a moderator:

the Skye Mage

E=MC Squire
Veteran
Joined
Dec 30, 2012
Messages
154
Reaction score
5
First Language
english
Primarily Uses
I just got gimp... is there a way to convert the files you're saving in Gimp to PNG?
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
Skye Magus, please do not hijack my topic or PM me instead please. Create your own topic for questions that are not related to my first post.. (ctrl+e and then just add ".png" to the filename or just Google it and the first hit will tell you the same)
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Step 1: make the map inside RPG Maker.


Step 2: take a screenshot of the entire map.


Step 3: paste the map into an image editing software. Have everything intact, such as rooftops. SAVE IT AS A PNG FILE. Add file to the parallax folder.


Step 4: using the same image, remove all excess material in this map, anything that shouldn't overlap the player should be removed. Keep the rooftops. SAVE IT AS A PNG FILE. Add file to the pictures folder.


Step 5: show parallax in editor, and use the show picture command (with opacity lowered) to show the picture that needs to overlap the player.


Stop making this harder on yourself, do it like this and everything should work 100%.
 
Last edited by a moderator:

the Skye Mage

E=MC Squire
Veteran
Joined
Dec 30, 2012
Messages
154
Reaction score
5
First Language
english
Primarily Uses
I wanna try that now o.o... is there any size the parallax should be hxw wise?
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top