Going inbetween characters and objects...

Started by DoorKnobHandle, Wed 15/09/2010 21:44:33

Previous topic - Next topic

DoorKnobHandle

Hey guys, is there any easy way that I'm not seeing currently to draw something on a layer underneath characters but above the room background including all its objects?

In my case, I have a room that I want to be dark. Now, for a special reason, I want that dark layer (which is an overlay) to not affect any characters in the room, just objects and the room background.

Is that possible somehow?

GarageGothic

#1
Just use a Character or Object for the layer itself with a Baseline value of 1 to appear behind everything else, and if needed IgnoreWalkbehinds set to true.

Edit: Just noticed the bit about it being in front of Objects but behind Characters. Are the Characters able to walk behind the Objects? If not, you can just set the Object.Baselines to 1 and the dark layer baseline to 2. If characters can walk behind objects, you'd probably be better off using DynamicSprites overlaid with the dark layer for all Objects (copy the original alpha channel from the Object back to the DynamicSprite after drawing the dark layer on top of it) and draw the dark layer on top of the background (initialize all this on room entry).

DoorKnobHandle

Okay that works. It was a little complicated because I have all kinds of objects in the room already (some with baselines 0-5 and some with 195-200) for various other effects. Now I set all object baselines manually and I made that glow object baseline 6 and that works out.

Thanks!


DoorKnobHandle

Okay, actually it's drawing my characters (with baselines in between 100-150) underneath the darkness object (with baseline 6). What the heck? :p

Man, it's been a long time since I've done standard adventure stuff with AGS. Must be something stupid on my part.

GarageGothic

That's odd. Are you moving the darkness object in any way? I believe that resets the baseline (at least it does for characters).

DoorKnobHandle

The problem is I have the object set to IgnoreWalkbehinds true. When I set that to false it all works but it also highlights the walkbehind area of the room obviously. :(

GarageGothic

#6
Ah, I see. This is getting complicated :). Any chance you could show a screenshot or just a schematic of how you want it to look. I'm having a bit of trouble wrapping my head around it. There's always the DynamicSprite option if simpler solutions fail. (And that's mainly of interest if you're using the effect in multiple rooms - if it's a single one it'll be easier to simply have two backgrounds and two sets of sprites for the objects).

DoorKnobHandle

I need this effect for several rooms so I'll give that manual method a try! :p

Ryan Timothy B

If it's just a single flat color overlay of darkness, you could always just Tint the Objects and background darker.

DoorKnobHandle

That was actually the first thing that came to my mind as well. :D Doesn't work unfortunately, need a dedicated dark sprite for detail, glowing screens etc.

Ryan Timothy B

Oh. In that case, what I would honestly do is make a second background and different sprites and views for the objects.  That's if you actually wanted full control over how lighting from a screen and such visually affects the other objects and background.

But it all depends really on what this background looks like and what you planned on doing. As GG said, we'd probably have to see a screenshot/schematic of how it should look. :P

SMF spam blocked by CleanTalk