Changing "status" lights


(psychosanity) #1

OK…Ive been mapping about a month now, and have made quite a lot of progress thru my first map, and the learning involved, without having to post any stupid questions…until now.

I am trying to create a set of lights (red, amber and green) to relate the status of a mover. Red means its moving, amber its charging for next move, and green it can move again. The mover itself works fine, and doesnt move again until my script says it can…the only problem is the status lights:

From my research, it seemed I should make three script movers, each with one light on and the other two off, and use my scripting to make two of them “invisible” and one “default” as needed…

It does not seem to work, however.

The lights I am using are texture lights…Is my problem because the light from all three lights are being mapped to the surfaces around them during compilation, regardless of their future scripted state, causing the appearance that all three lights are on no matter what happens?

If so, how can I remedy this?

I know the post is lacking in specific info…if you guys need to see my .map or .script lemme know. And thanks in advance for any help.

P.S. (I searched for info on this here, but no luck. The search functions on every forum Ive ever been on are somewhat difficult to get good returns with…)


(G0-Gerbil) #2

I think you mean that your surfaces emit light, and during the compilation they all light the room so you end up with a mixture?
First off then, don’t use light emitting textures for your ‘lights’, just a bright texture.
If you want to colour the room accordingly then you are in for a little more work, you also need to have some dynamic lights (dlight entities) which you alertentity on and off as appropriate, to give the players (not the room, which will have baked in lighting, IE non-dynamic) the correct hue.

If you really want a room that changes colour, you could try an idea I never tried out in practice - have 3 versions of your room, lit accordingly, and all script_movers - then make the whole room appear / disappear as appropriate.
Possibly a lot of work for what you are after. You could always take the easy option out and not have your lights actually appear to emit light, merely be a warning colour on the wall.


(psychosanity) #3

Wow, quick reply, ty!

Well, I suppose I’m not very concerned with the way the lights make the ROOM look (yet)…Its just that you can’t tell which light is on…they ALL look like they’re on no matter what.

However, dlights are something I havent tackled yet, maybe thats what I need. I will research those, Thanks!

(I am correct in that the brushes I want to be default/invisible should be script_movers though, yes?)


(psychosanity) #4

Ok, I did a little experimenting and I must be doing something wrong. I tried setstating everything to invisible, and nothing disappeared :angry:

So, here are my relevant .map and .script portions:

.MAP

// these are my three light banks, which share the same space…each with ONE of the lights “on”

// entity 76
{
“spawnflags” “2”
“scriptname” “greenlight_one”
“classname” “script_mover”
// brush 0
{
( 1620 96 561 ) ( 1608 96 561 ) ( 1608 36 561 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 34 594 ) ( 1608 94 594 ) ( 1620 94 594 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 18 569 ) ( 1620 18 569 ) ( 1620 18 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 28 602 ) ( 1664 88 602 ) ( 1664 88 558 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1620 51 591 ) ( 1608 51 591 ) ( 1608 51 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 94 596 ) ( 1608 34 596 ) ( 1608 34 552 ) lights/light_tp_m06 34 0 0 -0.515625 0.515625 0 0 0
}
// brush 1
{
( 1608 127 596 ) ( 1608 67 596 ) ( 1608 67 552 ) lights/light_tp_m05off 34 0 0 -0.515625 0.515625 0 0 0
( 1620 84 591 ) ( 1608 84 591 ) ( 1608 84 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 61 602 ) ( 1664 121 602 ) ( 1664 121 558 ) common/caulk -2 0 0 0.500000 0.500000 0 4 0
( 1608 51 569 ) ( 1620 51 569 ) ( 1620 51 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 67 594 ) ( 1608 127 594 ) ( 1620 127 594 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
( 1620 129 561 ) ( 1608 129 561 ) ( 1608 69 561 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
}
// brush 2
{
( 1620 162 561 ) ( 1608 162 561 ) ( 1608 102 561 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
( 1608 100 594 ) ( 1608 160 594 ) ( 1620 160 594 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
( 1608 84 569 ) ( 1620 84 569 ) ( 1620 84 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 94 602 ) ( 1664 154 602 ) ( 1664 154 558 ) common/caulk -4 0 0 0.500000 0.500000 0 4 0
( 1620 117 591 ) ( 1608 117 591 ) ( 1608 117 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 160 596 ) ( 1608 100 596 ) ( 1608 100 552 ) lights/light_tp_m07off 34 0 0 -0.515625 0.515625 0 0 0
}

}// entity 77
{
“spawnflags” “2”
“scriptname” “amberlight_one”
“classname” “script_mover”
// brush 0
{
( 1608 94 596 ) ( 1608 34 596 ) ( 1608 34 552 ) lights/light_tp_m06off 34 0 0 -0.515625 0.515625 0 0 0
( 1620 51 591 ) ( 1608 51 591 ) ( 1608 51 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 28 602 ) ( 1664 88 602 ) ( 1664 88 558 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 18 569 ) ( 1620 18 569 ) ( 1620 18 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 34 594 ) ( 1608 94 594 ) ( 1620 94 594 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1620 96 561 ) ( 1608 96 561 ) ( 1608 36 561 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 1
{
( 1620 129 561 ) ( 1608 129 561 ) ( 1608 69 561 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
( 1608 67 594 ) ( 1608 127 594 ) ( 1620 127 594 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
( 1608 51 569 ) ( 1620 51 569 ) ( 1620 51 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 61 602 ) ( 1664 121 602 ) ( 1664 121 558 ) common/caulk -2 0 0 0.500000 0.500000 0 4 0
( 1620 84 591 ) ( 1608 84 591 ) ( 1608 84 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 127 596 ) ( 1608 67 596 ) ( 1608 67 552 ) lights/light_tp_m05 34 0 0 -0.515625 0.515625 0 0 0
}
// brush 2
{
( 1608 160 596 ) ( 1608 100 596 ) ( 1608 100 552 ) lights/light_tp_m07off 34 0 0 -0.515625 0.515625 0 0 0
( 1620 117 591 ) ( 1608 117 591 ) ( 1608 117 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 94 602 ) ( 1664 154 602 ) ( 1664 154 558 ) common/caulk -4 0 0 0.500000 0.500000 0 4 0
( 1608 84 569 ) ( 1620 84 569 ) ( 1620 84 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 100 594 ) ( 1608 160 594 ) ( 1620 160 594 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
( 1620 162 561 ) ( 1608 162 561 ) ( 1608 102 561 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
}
}

// entity 78
{
“spawnflags” “2”
“scriptname” “redlight_one”
“classname” “script_mover”
// brush 0
{
( 1608 94 596 ) ( 1608 34 596 ) ( 1608 34 552 ) lights/light_tp_m06off 34 0 0 -0.515625 0.515625 0 0 0
( 1620 51 591 ) ( 1608 51 591 ) ( 1608 51 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 28 602 ) ( 1664 88 602 ) ( 1664 88 558 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 18 569 ) ( 1620 18 569 ) ( 1620 18 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 34 594 ) ( 1608 94 594 ) ( 1620 94 594 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1620 96 561 ) ( 1608 96 561 ) ( 1608 36 561 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 1
{
( 1620 129 561 ) ( 1608 129 561 ) ( 1608 69 561 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
( 1608 67 594 ) ( 1608 127 594 ) ( 1620 127 594 ) common/caulk 0 2 0 0.500000 0.500000 0 4 0
( 1608 51 569 ) ( 1620 51 569 ) ( 1620 51 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 61 602 ) ( 1664 121 602 ) ( 1664 121 558 ) common/caulk -2 0 0 0.500000 0.500000 0 4 0
( 1620 84 591 ) ( 1608 84 591 ) ( 1608 84 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 127 596 ) ( 1608 67 596 ) ( 1608 67 552 ) lights/light_tp_m05off 34 0 0 -0.515625 0.515625 0 0 0
}
// brush 2
{
( 1608 160 596 ) ( 1608 100 596 ) ( 1608 100 552 ) lights/light_tp_m07 34 0 0 -0.515625 0.515625 0 0 0
( 1620 117 591 ) ( 1608 117 591 ) ( 1608 117 547 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1664 94 602 ) ( 1664 154 602 ) ( 1664 154 558 ) common/caulk -4 0 0 0.500000 0.500000 0 4 0
( 1608 84 569 ) ( 1620 84 569 ) ( 1620 84 525 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1608 100 594 ) ( 1608 160 594 ) ( 1620 160 594 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
( 1620 162 561 ) ( 1608 162 561 ) ( 1608 102 561 ) common/caulk 0 4 0 0.500000 0.500000 0 4 0
}
}

And HERE is the relevant .script:
(ignore the faceangles and waits, as they relate to the bridge, not the lights.)

bridge_one
{

trigger move_up
{
	setstate greenlight_one invisible
	setstate redlight_one default
	setstate amberlight_one invisible
	setstate greenlight_two invisible
	setstate redlight_two default
	setstate amberlight_two invisible
	faceangles 62 0 0 20000
	setstate greenlight_one invisible
	setstate redlight_one invisible
	setstate amberlight_one default
	setstate greenlight_two invisible
	setstate redlight_two invisible
	setstate amberlight_two default
	wait 20000
	setstate greenlight_one default
	setstate redlight_one invisible
	setstate amberlight_one invisible
	setstate greenlight_two default
	setstate redlight_two invisible
	setstate amberlight_two invisible
	globalaccum 1 set 1
}

trigger move_down
{
	setstate greenlight_one invisible
	setstate redlight_one default
	setstate amberlight_one invisible
	setstate greenlight_two invisible
	setstate redlight_two default
	setstate amberlight_two invisible
	faceangles 0 0 0 20000
	setstate greenlight_one invisible
	setstate redlight_one invisible
	setstate amberlight_one default
	setstate greenlight_two invisible
	setstate redlight_two invisible
	setstate amberlight_two default
	wait 20000
	setstate greenlight_one default
	setstate redlight_one invisible
	setstate amberlight_one invisible
	setstate greenlight_two default
	setstate redlight_two invisible
	setstate amberlight_two invisible
	globalaccum 1 set 0
}

}


(G0-Gerbil) #5

With overlapping brushes like this, it’s often best to move them slightly apart during debugging stages so you can see what’s going on a bit better.

One quick thing, I can never remember if it’s needed but I do it anyway, is give a script mover a targetname the same as the scriptname, just in case.

Without a WAIT statement in the faceangles, it’ll process the setstates above it then immediately go to the ones below, so you might be missing something there.
There is another WAIT later on though, so that should be fine, although it’s possible that another script is ‘interrupting’ your lights script during this WAIT 20000, which would mean it never gets processed.

I’d say first things first, back to basics - just build a test map with 1 light, and make sure you can toggle that with scripting, then work your way up from there :smiley:


(Ifurita) #6
  1. dynamic lights will eat up tons of FPS. Search for a light_experiment thread by me, and then take a run thru the test map to see what effect dynamic lights have on a pretty simple map

  2. Download the mp_dercerto map and look at the script I used to change ready panels from red to green using remapshader. I got this idea from et_headshot


(psychosanity) #7

Well, I’ll be damned…

I though you were nuts, but I tried it anyway…and giving the light-bank movers a matching "targetname’ did the trick.

Now…wtf is THAT about? The mover itself works just fine, with no targetname at all…
After all, nothing actually “targets” these things…

Irritating, because “scriptname” really means “routinename” (the scriptname after all is mapname.script) and now I guess “targetname” can mean “movername.” :banghead:

lol, anyway it works now, setstating at least. Now on to dlights…

Thanks again


(G0-Gerbil) #8

No prob, I’ve run foul of this a few times in the past myself - it’s a bit tempramental which needs targetname and which needs scriptname, hence why I now automatically include both the same.


(psychosanity) #9

Yeah, I guess I’ll get myself in the same habit. I remember the LDR saying something to the same effect, but it never caused me a problem before, so I disregarded it.

That’ll teach me.


(The Wanderer) #10

take a look the sample map I posted toward the end of this thread(read my post on how to properly save it).
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=12558

It might give you some ideas on how to go about “faking” dynamic lights.