A Question About NPC's And Game Backgrounds

Started by Dor Hajaj, Mon 17/11/2014 22:47:04

Previous topic - Next topic

Dor Hajaj

Hi,

I hope i can make my question clear enough.
Lets say i have an npc that is supposed to be a cashier and i have the room background that includes the desk where he sits -  how do i place him behind the desk?
And another one which is basically the same - how to make a character appear through a glass door or a window?
thank you!

KodiakBehr

#1
Two ways. 

Have the desk as an object and set it's "baseline" to a value higher than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/4/)

OR

Have the desk as part of the background, and draw a "walk-behind" with a baseline higher than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/2/)


Mandle

Quote from: KodiakBehr on Mon 17/11/2014 22:51:32
Two ways. 

Have the desk as an object and set it's "baseline" to a value lower than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/4/)

OR

Have the desk as part of the background, and draw a "walk-behind" with a baseline lower than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/2/)

Doesn't the desk baseline need to be lower physically than the character's y-location, but higher numerically as the y-location starts at zero at the top of the screen and increases downwards?

Also: The window object will need to be done the same way, but with its Transparency setting changed: Maybe to something like 80% or higher, depending on how much you want to be seen through it.

A lot of this stuff, and a lot of other useful stuff as well, is covered in the AGS Tutorial, and there is also an excellent (and extensive) "How To Use AGS" tutorial series on YouTube. These will really get you on the fast-track to becoming confident with the AGS engine.:)

Dor Hajaj


KodiakBehr

Quote from: Mandle on Mon 17/11/2014 23:11:35
Quote from: KodiakBehr on Mon 17/11/2014 22:51:32
Two ways. 

Have the desk as an object and set it's "baseline" to a value lower than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/4/)

OR

Have the desk as part of the background, and draw a "walk-behind" with a baseline lower than the baseline of the character.  (http://www.adventuregamestudio.co.uk/site/ags/tutorial/ags/2/)

Doesn't the desk baseline need to be lower physically than the character's y-location, but higher numerically as the y-location starts at zero at the top of the screen and increases downwards?

Also: The window object will need to be done the same way, but with its Transparency setting changed: Maybe to something like 80% or higher, depending on how much you want to be seen through it.

A lot of this stuff, and a lot of other useful stuff as well, is covered in the AGS Tutorial, and there is also an excellent (and extensive) "How To Use AGS" tutorial series on YouTube. These will really get you on the fast-track to becoming confident with the AGS engine.:)

Good pickup.  Thanks.

Dor Hajaj


OK, i tried to follow what you said and couldn't quite do it..
the door is transparent but it doesn't show the player when he walks behind it. it seems like to transparency was created on room enter but afterwards there is not change to it. Also about the baseline, i didn't understand how to set it as dynamic (or i misunderstood what you said..:shocked:)

Dor Hajaj

Hi again,
Just to make myself more clear, as i still can't solve this issue:

I have this room and the windows that leads outside is supposed to be transparent so it shows what happens behind it.
The problem is that it seems like the transparency is created before or at room load and when the player move behind the windows nothing happens:

Can you help me?
Thx!

Snarky

Step 1:
In the room menu, draw a walkbehind for the wall around the balcony door, but leave a hole for the door itself. Put the baseline at the bottom of the screen. (This is described in the manual. Alternatively you can draw the walkbehind in your drawing program and import it.)

If you test it now, the guy should be hidden by the wall but visible through the door. Good start! But he'll also be "in front" of the door handles and crack, and won't be faded out like the rest of the room, so it will look a little strange.

Step 2:
The reason for this is that when using a walkbehind, your character is either in front of the background or behind it (invisible). There's no way with walkbehinds to be "in front" of the floor and back wall but behind the glass door.

To do that, you should make the door an object. If you have a painting app with layers, this should be easy: keep the door on a separate layer, export the background without it (just a hole where it will be), and export the door itself as an object, with semi-transparency for the glass. Update the background, and place the door object on top. Your game needs to be 32-bit (which means it supports transparency) for this to work.

Step 3:
Finally, if you have characters walking on the walkway outside, you may find they disappear behind the wall. This is a limitation with baselines. The easiest way to fix it is to adjust the baselines of the wall and glass door in code depending on whether characters are inside the room or outside on the walkway, but if you have characters in both places at the same time you'll have to get more creative.

Mandle


Dor Hajaj

Snarky, thank you for a very informative answer!
and thank you also mandle! It's nice to hear this because i was unsure if my graphics look acceptable in anyway. :smiley:

SMF spam blocked by CleanTalk