Making a tall sprite go behind AND in front of a "fence" object

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
Hi all! I'm trying to achieve an effect of having a character sprite stand behind a fence when behind it, and be in front of the fence when in front of it. I've asked elsewhere and have gotten suggestions to use events or layers but VXAce doesn't appear to have layers (I'm relatively new so I'm familiar with layers such as A,B,C etc but don't think they can be switched between?) I tried to find other explanations for how to do this but couldn't find anything, so any help at all is greatly appreciated. Thanks so much! (Also if this isn't the right place to ask I apologize, I'm still new and this site is hard to navigate)

fence problem.png
 

Bex

Regular
Regular
Joined
Aug 2, 2013
Messages
1,987
Reaction score
788
First Language
German
Primarily Uses
RMMZ
I know one Workaround:
If you use Events for the Fence, i mean selecting the Fence as Eventgraphic and than you just need to select as Priority: Same as Charackters in the Eventpage Setting. Than it is displayed like you want it to. In both cases.
 

LucaBicono

Regular
Regular
Joined
May 14, 2015
Messages
120
Reaction score
94
First Language
English
Primarily Uses
RMVXA
I suggest using Neon Black's script here. All you need to do is set the terrain tag of the appropriate tile(s) to 7, or whatever number you set yourself in the script. If you're using a tile that's only one tile high, like the fence, go into the Four-Directional Passability settings on your tileset and remove the up and down passability.
 

gstv87

Regular
Regular
Joined
Oct 20, 2015
Messages
3,290
Reaction score
2,463
First Language
Spanish
Primarily Uses
RMVXA
what IS that fence? is it a B-E tile or an A2?
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,505
First Language
English
Primarily Uses
RMVXA
You basically need to have the fence high enough to have one block set to impassible
1685413132541.png 1685413560673.png
Then use the Large Sprite display fix to correct the fence when below it.
1685413432569.png1685413446953.png
1685413488450.png1685413506622.png
 

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
I suggest using Neon Black's script here. All you need to do is set the terrain tag of the appropriate tile(s) to 7, or whatever number you set yourself in the script. If you're using a tile that's only one tile high, like the fence, go into the Four-Directional Passability settings on your tileset and remove the up and down passability.
Ah ok, this is kind of working! The character can move over the top of the fence and go behind it. However the fence is still a passable object and I want it to be solid, is that possible with this setup?
 

LucaBicono

Regular
Regular
Joined
May 14, 2015
Messages
120
Reaction score
94
First Language
English
Primarily Uses
RMVXA
Ah ok, this is kind of working! The character can move over the top of the fence and go behind it. However the fence is still a passable object and I want it to be solid, is that possible with this setup?
It should be, yeah. In your tileset settings, go to 'Passage (4 dir)' and remove the bottom arrow for your fence tile. My mistake, on my last post I said to remove both the up and down arrows, but I just tested to make sure and it works with just the bottom arrow removed.
 

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
Huh, it is still not working in that way - is there anything in the Neon Black script that I need to edit? I could find anything in their documentation that suggested that but there's probably something I'm missing here
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,808
Reaction score
13,729
First Language
English
Primarily Uses
RMMZ
I worked on this problem in 5 different games over several years and the only solution that always worked was the one Roninator2 suggested.
 

LucaBicono

Regular
Regular
Joined
May 14, 2015
Messages
120
Reaction score
94
First Language
English
Primarily Uses
RMVXA
There shouldn't be, I copy and pasted it directly from their pastebin into a fresh project and it worked. Double check to make sure you have the fence's passage set to a star, passage (4 dir) with all arrows active except the bottom one, and the terrain tag set to the same number as in Neon Black's script. Otherwise I'm not sure what the issue could be.
 

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
I worked on this problem in 5 different games over several years and the only solution that always worked was the one Roninator2 suggested.
Well, that's a shame. I was really hoping to have a 1 tile high fence since its only supposed to be that tall compared to the sprite. Not sure what else to do other than have it be completely impassable
 

Bex

Regular
Regular
Joined
Aug 2, 2013
Messages
1,987
Reaction score
788
First Language
German
Primarily Uses
RMMZ
Edit:
Maybe try:
Having a Invisible Maptile on Layer2 with correct Passability.
And on Layer 3 Putting the Fence Tiles on Star Passability.
Turn on your Plugin to fix Star Passability display fix for big chars.
And it should work. (Not tested)

--------------------------------------------------
Original Answer:
Than you need to make the Map Tile with the Arrows an invisble/empty one, which only has the passability setting O and the arrows but the down one removed.
Ontop of that Maptile you Place an Event with Priority Same as Charackters and the Through check Box marked. Choose as Graphic a Part of the Fence.
Now you have the correct display without any Plugins and you got the correct passability.
Only downside, every Fence Tile needs to be an Event. Depending on the Game you are creating and the Platform it is for, this might be a "Ok" or a "not Ok" Solution. (Edit: oh i just see that it should also work with your plugins without all this Events, i Edit the Idea above)
 
Last edited:

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
Edit:
Maybe try:
Having a Invisible Maptile on Layer2 with correct Passability.
And on Layer 3 Putting the Fence Tiles on Star Passability.
Turn on your Plugin to fix Star Passability display fix for big chars.
And it should work. (Not tested)

--------------------------------------------------
Original Answer:
Than you need to make the Map Tile with the Arrows an invisble/empty one, which only has the passability setting O and the arrows but the down one removed.
Ontop of that Maptile you Place an Event with Priority Same as Charackters and the Through check Box marked. Choose as Graphic a Part of the Fence.
Now you have the correct display without any Plugins and you got the correct passability.
Only downside, every Fence Tile needs to be an Event. Depending on the Game you are creating and the Platform it is for, this might be a "Ok" or a "not Ok" Solution. (Edit: oh i just see that it should also work with your plugins without all this Events, i Edit the Idea above)
I will try this, but what do you mean Layer 2 and 3? Like B and C tiles?
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,505
First Language
English
Primarily Uses
RMVXA
Well, that's a shame. I was really hoping to have a 1 tile high fence since its only supposed to be that tall compared to the sprite. Not sure what else to do other than have it be completely impassable
A little more testing and I think there is a solution
1685573678646.png1685573695257.png
1685573738979.png1685573836296.png notice the missing arrow at the bottom in the blank tile.1685573887052.png

1685573982828.png The red is where I put the blank tile. this fence is on sheet "D". But could be anywhere from B-E.
This is still using the large sprite script mentioned above.
 

spumoni

Ice Cream Alien
Member
Joined
May 26, 2023
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
A little more testing and I think there is a solution
View attachment 263854View attachment 263855
View attachment 263856View attachment 263857 notice the missing arrow at the bottom in the blank tile.View attachment 263858

View attachment 263860 The red is where I put the blank tile. this fence is on sheet "D". But could be anywhere from B-E.
This is still using the large sprite script mentioned above.
Hey, this works!! Though it's not the most elegant solution I am okay with using those blank tiles -- thanks for your help and I'll play around with using this solution. :)
 

Bex

Regular
Regular
Joined
Aug 2, 2013
Messages
1,987
Reaction score
788
First Language
German
Primarily Uses
RMMZ
I will try this, but what do you mean Layer 2 and 3? Like B and C tiles?
Oh oh! I overread that you are using RMVX-Ace, my Solution with the Layers was with RMMZ in mind.
MV and MZ got 1 Layer more and MZ lets you choose the Layer directly.
The Workaround with many Events i mentioned, should also work in VX-Ace, but the other one does not.
Sorry, my mistake.
 

Latest Threads

Latest Profile Posts

The site is being slow and funky again. IS SOMEONE CRAFTING POEMS?!
So yeah, @TRIDIUM @TESTOSTERONE, I wuz like, "What do they mean by borderline and boundaries?"

And then, y'all know this girl?

actress1.png

alice_bikini.png

The clothes? They're just a, um, quick edit. :kaoswt:
I've uploaded the opening cutscene from my game to my channel. It basically introduces us to the first three characters, and what their relationships are:
Cosmic Inferno: Opening dialogue
I don't want to start a panic...but everyone, check the color of your milk!
IMG_20231002_082329.jpg
My One Map Challenge is nearing completion. I am in the multiple run testing phase atm. This is the map. Beware the minotaurs in the maze area. The female ones are more aggressive. Can you prove to the land of Winchell that a dragon and a human can love each other?

Forum statistics

Threads
135,021
Messages
1,253,017
Members
177,949
Latest member
fefemaker
Top