Forum

QuakeC awareness of lighting?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

QuakeC awareness of lighting?

Postby Baker » Sun Nov 30, 2008 10:41 pm

Can QuakeC ... even if it requires some DP or FTE extension .. be aware of the lighting level that, say, a player is in?

Theoretical uses:

1. solar-powered armor or something that doesn't recharge in lower light levels.

2. A true ring of shadows where the player is totally invisible to monsters/other players if the player is in a sufficiently "dark place".

I'm assuming the answer is no, but my QuakeC knowledge is still rather limited.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: QuakeC awareness of lighting?

Postby Downsider » Sun Nov 30, 2008 10:53 pm

Two ways, at least that I can think of.

Without any sort of engine code, you can search for any light entities within a certain radius. Not very good, I dunno.

Maybe you can refine that by checking if there are any walls in the way, thus detecting "shadows" to an extent.

Other way is a bit more obvious and just uses DarkPlace's getlight function.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Urre » Mon Dec 01, 2008 12:20 am

There's an extension for this in dpextensions.qc
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Baker » Mon Dec 01, 2008 1:07 am

Urre wrote:There's an extension for this in dpextensions.qc


Thanks!
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest