Forum

How to make an entity strobe?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

How to make an entity strobe?

Postby silverjoel » Thu Oct 07, 2010 7:21 am

How do I make an entity strobe like the lights?
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am

Postby Error » Thu Oct 07, 2010 7:43 am

please be more specific.

like, make the model disappear then reappear? or make the entity emit a strobing light?
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby silverjoel » Thu Oct 07, 2010 7:53 am

No no, I mean strobe with light. Like flash as if it were being electricuted.

I see the lightstyle that causes the level lights to flicker in different ways, but how would I apply that to an entity?
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am

Postby Error » Thu Oct 07, 2010 8:13 am

I'm not entirely sure what you mean, but I'd go with using an engine that supports .colormod

that's the easiest way. plus you could get a cool blue-ish tint on the color.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Spike » Thu Oct 07, 2010 12:13 pm

world lights use lightstyles, which are compiled in to the map.
The style then uses a lightstyle string which says the light level at a particular (repeating) point in time.
If you want your ent to move (and thus move the area lit too), this isn't an option.
In which case you need to use dynamic lights.

There's some DP extension which provides extra fields to specify specific light radius/colours, or you directly spawn a dlight in csqc, either way setting the light levels per frame. But without extensions, you're limited to 'self.effects |= EF_DIMLIGHT'... which obviously can't strobe.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby silverjoel » Thu Oct 07, 2010 3:50 pm

So I'm stuck using a bunch of nextthinks? That's too bad.
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am

Postby leileilol » Thu Oct 07, 2010 8:45 pm

quake is entirely a series of nextthinks
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby metlslime » Thu Oct 07, 2010 10:43 pm

strobing moving light: add EF_MUZZLEFLASH every 3-4 frames

strobing light, no movement: give the light a targetname in the editor, this will give it a unique style. Then, at the appropriate time your code should set the light style to e.g. "azazaz" or similar. Then when finished, set it back to "a" or "m" depending on whether it should still emit light when not strobing.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest