Animation get's behind object

Started by Olleh19, Wed 13/05/2020 02:33:35

Previous topic - Next topic

Olleh19

What i'm trying to do is make a character go behind a desk, but that desk have an animation on it's top part aswell, the character is doing things on that desk, so when the character is not at the desk it should just stand there (as an object). So what i did is i separated the Desk so it's a single object. Then what i get is either one of the following.

1. I can make him walk into the desk (the basic walkcycle animation) and then transition into the animation that is the desk correctly(i have his legs "hidden" in the actual desk animation, not when he walks up too it ofc). So what is happening is ofc he walks thru the desk and then his legs disapear. Yes, i am aware of walkbehinds and baseline, THANK YOU! Unless there is some hidden option which i'm hoping for. :)

The problem seems to arise from this:

2. He walks up and with the baseline set at a fiting height he walks behind the desk, HOWEVER to make this happen i have to move the desk object in the PNG in pixels, but then that changes the scaling a little bit.

So i thought, maybe i can use the desk exactly like i've done with "normal" walkbehinds for bakgrounds?. In otherwords i draw only the parts of the desk that is "hiding" the animation from showing up? Well to my surprise AGS bugs out completely. I'm sorry if it's not considered a bug, but if a object get's almost invisible in the actual game you see random parts of it, even tho you have drawn the walkbehind for it. I consider that a bug or it should say something "you can't do a walkbehind draw for an object", or something like that.

So i get a semi invisible desk. It simply won't let me do the drawing!

Since it's an object, i believe that is why that is not working for me. You may ask, can't i just draw the object in to the actual bakground and problem solved?
Well i guess that could be a solution. If it wasn't for that the object should disapear later in the game!

Any ideas for a solution are VERY welcomed. Hopefully i solve it myself tommorrow, but if not any guidance might put me in the right direction. Thanks!



Khris

Why a walkbehind if the desk is already on object? Why isn't there a hole in the walkable area where the desk is so the character can't walk through it?

As far as I can tell, all you need is a desk object with its baseline set, that will take care of the character being obscured by it. Next, when the character has sat down, position them below the baseline so their visible upper body is drawn on top of the desk. That way the character can do stuff on the desktop.

Ali

Quote from: Olleh19 on Wed 13/05/2020 02:33:35
So i thought, maybe i can use the desk exactly like i've done with "normal" walkbehinds for bakgrounds?. In otherwords i draw only the parts of the desk that is "hiding" the animation from showing up? Well to my surprise AGS bugs out completely. I'm sorry if it's not considered a bug, but if a object get's almost invisible in the actual game you see random parts of it, even tho you have drawn the walkbehind for it. I consider that a bug or it should say something "you can't do a walkbehind draw for an object", or something like that.

I might be misreading this, but AGS makes objects disappear when you draw walkbehinds, so I think it's pretty clear that walkbehinds only apply to the background.

Snarky

Yeah, walkbehinds apply to all characters, objects, etc. If you place an object on the background, and then draw a walkbehind (with a lower baseline), the walkbehind will "hide" the object. You should only draw a walkbehind when you want some part of the background to "go in front" of the interactive elements in the room.

Olleh19

Quote from: Khris on Wed 13/05/2020 08:47:42
Why a walkbehind if the desk is already on object? Why isn't there a hole in the walkable area where the desk is so the character can't walk through it?

As far as I can tell, all you need is a desk object with its baseline set, that will take care of the character being obscured by it. Next, when the character has sat down, position them below the baseline so their visible upper body is drawn on top of the desk. That way the character can do stuff on the desktop.

Because his hands and the objects disapears on the top of the desk! The baseline can't be set any different from what i can understand. I've tried various baselines the outcome is still the same! Which is why i came up with the "normal" walkbehind idea that if i draw so that it's only walkbehinding the lowerparts of the desk (i hope this makes more sense now).


Olleh19

Quote from: Ali on Wed 13/05/2020 10:01:35
Quote from: Olleh19 on Wed 13/05/2020 02:33:35
So i thought, maybe i can use the desk exactly like i've done with "normal" walkbehinds for bakgrounds?. In otherwords i draw only the parts of the desk that is "hiding" the animation from showing up? Well to my surprise AGS bugs out completely. I'm sorry if it's not considered a bug, but if a object get's almost invisible in the actual game you see random parts of it, even tho you have drawn the walkbehind for it. I consider that a bug or it should say something "you can't do a walkbehind draw for an object", or something like that.

I might be misreading this, but AGS makes objects disappear when you draw walkbehinds, so I think it's pretty clear that walkbehinds only apply to the background.

No, you are not misreading. Okay, so it is not a bug? I wished it could work as a with normal bakgrounds. :(

Olleh19

Quote from: Snarky on Wed 13/05/2020 10:09:10
Yeah, walkbehinds apply to all characters, objects, etc. If you place an object on the background, and then draw a walkbehind (with a lower baseline), the walkbehind will "hide" the object. You should only draw a walkbehind when you want some part of the background to "go in front" of the interactive elements in the room.

So what is the walkbehind for the object therefor? I feel like i'm getting slightly confused sometimes with this programs features.  (laugh)
There clearly is a set baseline for object walkbehind (i guess?!) option in AGS (or it's something else?!) "BaselineOverridden".

Ali

The walkbehind allows you to draw over an area of the background and set a baseline. Sprites will appear either in front of or behind that area depending on their Y position in relation to the baseline. That area can be whatever shape you draw.

Objects, like characters are sprites with their own baseline (the bottom of the sprite, by default). You can't draw walkbehinds on sprites. So as long as the baseline of the desk object or desk walkbehind is below the character sprite, we shouldn't see their legs.when they're behind it.

If you want a sprite that is partly in front of and partly behind the same object, or walkbehind - that's more of a challenge. There are a few solutions, discussed recently in this thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=57953.0

Olleh19

Quote from: Ali on Wed 13/05/2020 13:15:47
The walkbehind allows you to draw over an area of the background and set a baseline. Sprites will appear either in front of or behind that area depending on their Y position in relation to the baseline. That area can be whatever shape you draw.

Objects, like characters are sprites with their own baseline (the bottom of the sprite, by default). You can't draw walkbehinds on sprites. So as long as the baseline of the desk object or desk walkbehind is below the character sprite, we shouldn't see their legs.when they're behind it.

If you want a sprite that is partly in front of and partly behind the same object, or walkbehind - that's more of a challenge. There are a few solutions, discussed recently in this thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=57953.0

Thanks Ali! What Matti wrote in that thread is exactly what i have thought about myself. Just separate the desk to two objects however it complicates things when it's scaling involved. But i just have to work harder i guess. Need to solve this. Cause it's a funny little animation and part of the future game! :-D

Ali

I think we've been a bit confused about what you were asking - it's hard to tell what you're trying to achieve from the description. If it's something like Matt's thread, then you have a few options:

Lining up a second character / object in front of your character to act as their arms on the table, as Matt described. I would favour drawing your character with holes cut out and placing them in front of the table, but either could work. Of course, scaling does make it more complicated.


SMF spam blocked by CleanTalk