Shadows for characters

Started by JLM, Tue 25/05/2004 13:47:09

Previous topic - Next topic

JLM

I'd like to know if it's possible to make some kind of shadows for characters? I don't mean "dynamic shadows", but just darker areas under characters that "follow" them everywhere (like in Quest for glory 4).

Is there some way to do this?

Scorpiorus

Yeah, you could have a shadow as a separate character and use a FollowCharacterEx() function to keep the shadow just under the normal character:

FollowCharacterEx (SHADOW, Character, FOLLOW_EXACTLY, 1);

Also use SetCharacterTransparency (SHADOW, 50) to add transparency for the SHADOW "character".

Hope that helps :)

stuh505

or you could make the shadow part of the character and use a 32-bit sprite wher the alpha channel is gray under the shadow so its transparent

Darth Mandarb

[yoda] yes ... to Stuh505 you listen ... has it right he does. [/yoda]

That's exactly how I'm doing it in a project I'm working on.

There are some areas where it looks a little off, but on the whole, it's perfect!

Janik

How does that look if, say, the character walks to the edge of a cliff (or pier or wall) and the shadow is superposed on a vertical edge, but not following it? (I hope you see what I mean).

Ideally, there would be a way to define a "shadowable"-area, the shadow would only be displayed on this flat surface. Anything vertical, like the cliff or wall, would have no shadow at all (for simplicity, we're not about to start calculating volume shadows in 3D).

I'm only beginning in AGS, but is that something possible? Or is that a feature request?

Thanks,

Janik
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Pumaman

Something like that would be possible, but it's adding a fairly complex bit of new functionality, for not much gain. Bear in mind also that people would want the sun to be in different locations so the shadows would act differently, and so forth ... really, shadows aren't something that can be done properly in a 2D game.

Janik

Yeah, that's what I thought. As a (part-time) programmer myself, I know how easy it is to ask for something, and how much harder it is to actually do it!

By restricting the shadow to a small circlish area under the character, you would avoid most of the trouble. And by setting the walkable area with just a little border around walls/cliffs, big enough so that the shadow doesn't reach the wall, you avoid the rest of the problem.

More fancy scripting would turn the shadow on/off when you step in specific areas (like in the shadow of a building for example). That would be cool.
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Gilbert

Hmmmm Shadow areas... bring good old memory...

[Ignore this if you didn't understand it, I think not many people would understand it now := ]

Pumaman

Hehe yes blimey, even I'd forgotten about those  :=

SMF spam blocked by CleanTalk