NPC Inputs, KeyValues and ect.

I am trying to do something to an NPC.

So first of all the npc is a scanner so like here is an example:

So thats the scanner NPC I am using to do something but there is another one which hase also same stuff like the City scanner just I think it has two more inputs.

So first of all it spawns a scanner it creates one that I can control with WASD cause its a flying NPC that uses a different AI system.

I am trying to enable the Spotlight via a command.

I am using this function:


My code is fine but the function has problems so the code can run but it doesn’t do what I want I guess. Normaly it should turn on the spotlight well but I was wrong. After testing with the tool I found out some stuff.

First of all:

SpotlightLength <integer> DEFAULT = 500
Length of the scanner’s spotlight.
SpotlightWidth <integer> DEFAULT = 50
Width of the scanner’s spotlight.

Those are easy to understand.

Now there is another one called SpotlightDisabled.

SpotlightDisabled <boolean>
Start with the scanner’s spotlight turned off.

Now lets ignore the description of SpotlightDisabled cause at my testing with the NPC toolgun (which is from an addon) did something else.

First of all 1 means that it is disabled and 0 means that it is enabled.

Having this enabled doesn’t make the scanner spawn with the spotlight it does give it the possibility to enable it.
Having this disabled then it can’t use the spotlight.

The original NPC scanner turned his spotlight it self on, means that there is a cind of other thing to enable the spotlight, but I don’t know. And I think this could only be an input.

There is an input called:

To do: add description

Yes sadly there is no description for it and I wanted to test this input at Hammer Editor but I am not sure if it will work.

What I want to reach is that the scanner enables or disables it by my command.

m_bNoLight to false or use the key value
m_nFlyMode to 1

Wait what where???


m_bNoLight is the same as SpotlightDisabled?

and what does m_nFlyMode 1?

I am confused really and where did you even found m_bNoLight because I don’t find that at the wiki

You can’t find them because thats just the help text for the key value, open the Hammer Editor and disable Smart Edit that will show the real keyvalue name.

Means that those keyvalues on the site made nothing when I tried to run this?

ENT:SetKeyValue(SpotlightDisabled, arguments)

Pretty much

So whats the differences btw SetSaveValue and SetKeyValue if those things are keyvalues.

and which one should I use now.

What about if you try besides asking and waiting for being spoon feed

I’ve tried the Input too, and if I made it right it didn’t worked. But I got this site from someone

I should be able to find out when it turns or what it uses to turn on its spotlight.