Can you turn lights off on NPC's that have them by default?

Hey there,

I’m working on a machinima project at the moment which has a cameo appearance by a Combine Scanner, one of the NPC’s in Half-Life 2. The way I’ve been incorporating it into the scene is by dropping the Combine Scanner NPC into a green screen map in GMOD, and then screen capturing and keying the shots into the edit.

However, the Combine Scanner NPC has a light on the top of it which both shines and also flashes when it takes a photo, and these lighting effects are making it really difficult to pull a clean key form the green screen.

Does anyone know how I might turn the lighting effects off on the Combine Scanner?

Your help is much appreciated, also this is my first post so please be gentle.

Ta, Chip

have you linked into some npc control tools? like this?

Thanks for the suggestion, however I can’t seem to find any controls in there that would turn the lights on or off, it seems mostly for assigning movement paths and creating NPC relationships.

I was thinking maybe there’s some sort of console command that removes lighting effects, but coding is not my strong suit…

Is the combine scanner npc_cscanner? If so it seems to have keyvalues (SpotlightDisabled, SpotlightWidth, SpotlightLength) you can set for the light size and options.

Try this:
Spawn the scanner, aim at it, then in your console do:

lua_run local Ent = player.GetByID[1]:GetEyeTrace().Entity print("Turning off light for entity",Ent) Ent:SetKeyValues("spotlightdisabled", true)

That will get the entity you are aiming at and try to set the keyvalue spotlightdisabled to false, should turn off the light on the scanner.
You need to be the only player (or just the first player to join) + you need to be aiming at the scanner when you run the command.

[editline]3rd January 2014[/editline]

If SetKeyValues doesn’t do it it may be possible with firing the input, like this:

[lua]lua_run local Ent = player.GetByID[1]:GetEyeTrace().Entity print(“Turning off light for entity”,Ent) Ent:Fire(“DisableSpotlight”, “1”, 0)[/lua]

My mod has such option for CScanners as a Context menu property:

Nice, much easier for non coders. Does it use SetKeyValues or Fire or different way?

Both, differs on what property you are talking about, in this particular case it’s Ent:Fire()

You sir, are a king among men, this has resolved an issue that’s been causing me a lot of grief. Thanks muchly, have rated the mod on workshop :slight_smile:

wh1t3rabbit thanks for the code, though I think context clicking suits me a little better :wink: