When walking through a field or water or something like that I want my character's lower half to become slightly transparent, as if they are standing in the water or whatever. Here's a clip without the transparency:

It looks pretty stupid to stand on top of the field like that.
My initial thought was to use transparent Grhs in the foreground, but this would also obscure the character's upper-half as well. So then I thought drawing two different character sprites all the time, one for the upper and one for the lower half would do the trick, but that seems time consuming and I'm wondering if there's an easier way. Any suggestions?
Or you could have like vbGORE had where a layer was either above or below a character depending on their respective Y coordinates. So it'd draw above a character only if the bottom of the grass is greater than the bottom of the character. NetGore sorts all sprites before drawing already, so it wouldn't be much work to add.
Stuff like this is precisely why I didn't want to make a top-down game. ![]()
@Spodi that doesn't work entirely as when you'll just go north in the grass it'll draw above/under/above/under you. This only works when you go left or right.
Stuff like this is precisely why I didn't want to make a top-down game. ![]()
Would it be feasible to have a transparent flag set on a Grh and if the character walked on it, the character or whatever entity would be drawn transparent. Or half transparent?
Ultimately I'm interested in which of the methods mentioned above is the quickest.
I believe it'd work if you break it up into multiple sprites instead of just one large one.
And have them overlap? That would work I guess.
Not being an artist, I have a hard time visualizing how these things will look, but what I am guessing is that it will look like you basically have a lot of flat lines of grass in there. It'd probably look like it does in slightly older 3D games with grass where it is billboarded.
Having the sprite get the bottom half of their body chopped off would look good while in it, but not so good as they walk out of it. You could do a pixel-perfect detection of what parts to "erase" from the sprite, but it becomes quite a bit of work... this is a bit of a tough one.
Pixel perfect detection would be ideal, but too much effort. I think I can get away with the method you mentioned and some clever mapping.
Like this:

Now we have the illusion that pixel perfect things are happening with very little fuss. I just need an idea on how to implement this.
I would just make one new entity which forces the upper half of the player to be drawn on top of the layer the grass is on when the player is walking on the entity.
In my previous years of development, transparency was virtually impossible with the graphics engine I used. So what I did was took all of the sprites, cut them all in half and erased the bottom portions upwards so it would look like grass was over me, when in reality half of your body was missing lol.
Any idea on how or where to implement this? I'm not so familiar with SFML API or building NetGore entities.
Nope, no idea. Haven't looked into it myself.
You can probably do it by editing an entity, but editing entities is all done through the source. How exactly you would do it, I am not sure.
I'll prepare to tackle the source then. If anyone can think of a clever way to achieve this without changing the core, post it here please.
Entities aren't "the core" though. I don't see how one can make a game with only a teleport entity
so everyone is bound to add new entities.
Still new to the NetGore jargon, confusing core and source in a previous post.
Sounds like a new kind of entity to me, one that only draws over the bottom half of anything that collides with it.
Click here for my Netgore Content Editor Tutorial video