Change event graphic to blank when player walks under

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
I want to set up the illusion where when the player walks under an event, it switches to an empty graphic (i.e. walking behind a tall building and a portion disappears to not obstruct the view). How would I do this? I have attempted fiddling with the "Event touch" (assuming nothing would happen until the player actually touches the event, silly me) trigger, then having a switch turn on (Self Switch A), then making an event page 2 and setting it to a blank graphic with Self Switch A on. Oh right and the event/graphic needs to reset/reappear once the player is no longer under it.


Oh right if there's also a scriptless way I could involve regions with this that would be great and could potentially simplify things.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I don't think so.

Have priority set to Above Characters, trigger to Player Touch (if the event doesn't actually move - if the event DOES move, change it to Event Touch), and event command will be to turn on self switch A.

On the second tab, still have priority to Above Characters, trigger to Parallel Process, and the event command will be this:

Conditional Branch: Script: $game_player.x != $game_map.events[@event_id].x || $game_player.y != $game_map.events[@event_id].y Control Self Switches: A = OFFBranch EndWait 4 FramesSo this will make it sit there waiting for the player to walk underneath. When they do, it'll change to an empty graphic, and start polling the player's location. As soon as the player moves to another tile, it'll switch back to the original tab/page with the graphic, and stop polling.I am editing your title to make it more meaningful. Please ensure your threads have descriptive titles in future.
 
Last edited by a moderator:

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
I should mention that the event is a giant graphic and not actually a single tile. But I'm beginning to suspect that the engine only considers that one single tile to be valid for any interaction instead of the whole graphic. Which is incredibly silly, but c'est la vie.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Then if your event is always going to be in the same place on the map, figure out the x and y coordinates of the top left and bottom right, and make your condition look like this (we'll assume the event covers tiles 8,11 to 13,14)

Code:
Conditional Branch: Script: !($game_player.x.between?(8,13) && $game_player.y.between?(11,14))
 

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
Ah, I see. So then I assume the very bottom of the map, regardless of size, is 0, and the left edge is also 0.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
I assume the very bottom of the map, regardless of size, is 0
The top is 0, not the bottom. ;)

The red arrows in the picture below depict the way to figure out the map location. :)

 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You don't have to count. When you're in the editor just click on the tiles where the sprite will start and end. Look in the lower right corner. It'll tell you the coordinates of the tile you're on.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
You could also just use an image and show it up on the map. So if you want the player to walk behind tall buildings, simply have the walls and rooftops in the image, and it will automatically overlap the player. You would need a script to fix the image to the map though.
 

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
I may have done something wrong.


So on the first tab, it's player touch, and "Control Self Switch: A = ON". That's it. Everything else is default.


On tab 2, Self Switch A is on, Above Characters, Parallel Process. There's a conditional branch ('set handling when conditions do not apply' is unchecked), and the conditonal is "!($game_player.x.between?(53,45) && $game_player.y.between?(63,58))" with the condition being Self Switch A being on. Wait 4 frame(s).


When I walk against the event, it disappears, but it fails to reappear and it seems to ignore the coordinates I put and doesn't actually reappear. X_x


Sorry I know this must be like mind-numbingly simple for you.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Please post a screenshot of your two event pages. Include the entire window, not just the event commands.


Your coordinates covered by the image, according to that position, are 53,63 to 45,58 - is that correct?


And your command, for when the condition evaluates to true, should turn self switch A OFF, not ON. If you're actually turning it ON on the second page inside that conditional branch, that's what the problem is.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You've got your conditions the wrong way around.


Tab 1 should have no conditions, and in the event it should turn on self switch A.


Tab 2 should have self switch A as a condition, and in the event it should turn self switch A off.
 

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
well now that just makes the event flicker in and out of existence rapidly. rapidly enough to cause lag. Even when I'm not even near it.


Probably because of a script. I'm using several (all by the same author). So I guess this endeavor is pretty much dead. Thanks for all your help, though.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Nope, you've just not got it set properly (or I gave you the wrong formula). I suspect your coordinates are wrong.


Can you do another screenprint of both event pages and post.


In addition, do a screenprint of your map itself, with the event selected (but not opened) - I want to see what the coordinates (shown in the lower right corner of the map) are for the event.


And tell me how many tiles wide and high that image is.


You will also need to use my Large Collision Area script, otherwise it will only disappear when you walk on that exact tile where you've placed it in the editor.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Those are either old screenshots, or you didn't change what I told you to change.


You want NO conditions on tab 1, and you WANT the self switch A as a condition on tab 2.


If you have changed them, then please make sure you're posting screenshots of what your events are, not what they used to be.


And your coordinates are wrong. It's not the top left corner first, then the bottom right corner second. It's this:

!($game_player.x.between?(x1, x2) && $game_player.y.between?(y1, y2))It LOOKS like you've instead got this:
Code:
!($game_player.x.between?(x1, y1) && $game_player.y.between?(x2, y2))
x.between? should have your smallest x value, then your largest x value. y.between should have your smallest y value, then your largest y value.
Also, is that whole building just one big image in a single event? I don't think it's going to work the way you want - using the script I linked to above, the building would disappear even when you're walking around on the transparent area behind it - not just when you walk where you can SEE the building.


You might actually be better off looking for a script ... I seem to remember someone making a script to make certain things 'invisible' or at least semi-transparent when you walk behind them. It MAY have been Neon Black.
 
Last edited by a moderator:

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
sorry, linked the wrong event editor shots. edited previous post. I also figured I could just change the coordinates a little to have a rectangle that was smaller than the actual size of the graphic. you know, making the biggest possible rectangle (with the coordinates) without involving any empty space at all.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yeah, that's better. See my previous post though (I edited to add some more info). Your coordinates in the condition are wrong.


The first two numbers should be your lowest x and highest x, but it looks like you've got your lowest x and lowest y instead. It's NOT the x and y value of the top left corner that's meant to go there - it's the range of the x value for which you want the sprite to be hidden. Similarly, the second two numbers should be your lowest y and highest y.


Try changing it to this instead:

Code:
!($game_player.x.between?(53,63) && $game_player.y.between?(45,58))
 
Last edited by a moderator:

Majora

Villager
Member
Joined
Jul 16, 2013
Messages
17
Reaction score
0
First Language
English
Primarily Uses
okay heeeeeeeeere we go. The building now stays invisible when I walk beneath it, but away from it it flickers in and out of existence.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Did you add that large collision script? You need to make sure the coordinates in the condition exactly match the collision area you've set in that script (keeping in mind the script uses pixels and the condition uses tiles).


It sounds like the collision area is larger than the coordinates you've selected.


If you're at your wits' end, you could load your project up somewhere and I can take a quick look at it.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
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'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top