Lighting problem
Okay, I really suck at lighting. So on this map I'm working on I try like 20 times and finally come up with a lighting that I like. Now when I compile I get the error
Error: Exceeded MAX_SWITCHED_LIGHTS
Description: The maximum number of switchable light entities has been reached
How many light entities are you allowed?
most ppl play with dynamic light off, so on/off lights will always be on, you shouldn't use them. As for the max number I have no idea.
what would you use to light up a room that isn't being lit by the light_environment? I'm using the light entity but maybe I should use something else?
TheNomad
06-23-2003, 11:40 AM
i think the error is refering to how many lights can be switched off or on. nomal lights are fine. the switchable lights are the same as normal lights (same entity) but with the "starts off" box ticked
Hmm, I don't have any on/off switches though hehe. Ah well, I'll just scrub the lights again and start over.
yeah fenrir read up on light emmiting textures. there a freaking entity saver and a 1/2. In a single player map I dropped over 300 entitys by switching to light emmiting textures. and the map was only 20% done!
geez Diana lol
Yeah, I'm trying a compile with the light.rad file now to see how it works out.
CptMuppet
06-23-2003, 03:12 PM
I beleive dynamic lights in HL increase r_speeds...
I just use static ones!
by and large lights.rad can save time, just make sure u type in the names of custom textures that illuminate in there.
Gorbachev
06-23-2003, 03:45 PM
dynamic lights won't raise r_speeds...they -may- lower fps, but I've never had an occurance of that.
I read up on lights.rad, made the file and everything. Added the textures and values that i wanted, but it still doesnt emit the lighting. I'm thinking i put it in the wrong place (i have one in the valve folder(recommended by tutorial) and one in DoD(i put there to try and solve)). Where do you put it?
CptMuppet
06-24-2003, 05:12 AM
Use Zoner's Half Life compile tools, you can specify which lights.rad file to use for the map.
lights.rad is in my "C:\games\hammer\tools" folder.
Make sure you NEVER stick a light emitting texture outside of your map (causes leaks).
tommy14
06-24-2003, 02:09 PM
Originally posted by FenrirWolf
Okay, I really suck at lighting. So on this map I'm working on I try like 20 times and finally come up with a lighting that I like. Now when I compile I get the error
Error: Exceeded MAX_SWITCHED_LIGHTS
Description: The maximum number of switchable light entities has been reached
How many light entities are you allowed?
the old QCSG allowed:
#define MAX_SWITCHED_LIGHTS 32
and that is not the number of lights allowed, that is the number of light STYLES allowed.....if i read the old code right, which i probably dont.
seems like your problem is a named light without a lightstyle:
// any light that is controlled (has a targetname)
// must have a unique style number generated for it
the relevant part of the code, if you care:
============
SetLightStyles
============
*/
#define MAX_SWITCHED_LIGHTS 32
void SetLightStyles (void)
{
int stylenum;
char *t;
entity_t *e;
int i, j;
char value[10];
char lighttargets[MAX_SWITCHED_LIGHTS][64];
// any light that is controlled (has a targetname)
// must have a unique style number generated for it
stylenum = 0;
for (i=1 ; i<num_entities ; i++)
{
e = &entities[i];
t = ValueForKey (e, "classname");
if (Q_strncasecmp (t, "light", 5))
continue;
t = ValueForKey (e, "targetname");
if (!t[0])
continue;
// find this targetname
for (j=0 ; j<stylenum ; j++)
if (!strcmp (lighttargets[j], t))
break;
if (j == stylenum)
{
if (stylenum == MAX_SWITCHED_LIGHTS)
Error ("stylenum == MAX_SWITCHED_LIGHTS");
strcpy (lighttargets[j], t);
stylenum++;
}
sprintf (value, "%i", 32 + j);
SetKeyValue (e, "style", value);
}
}
/*
Day of Defeat Forum Archive created by
Neil Jedrzejewski.
This in an partial archive of the old Day of Defeat forums orignally hosted by
Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.