Getting the properties of a entity in a map

Is it possible to reliably get the Property Names and Values from a custom entity in the map?

I saw http://wiki.garrysmod.com/?title=Entity.GetKeyValues but it doesn’t seem to have the custom properties and values I put in it.

For example. I have an entity called custom_spawnpoint and it has a property called team, with a value of 4. But it doesn’t even show up in the table returned by :GetKeyValues().

What do you mean by “property”? Generally what we consider an entity property is either a KeyValue or in the entity’s table.

You need to make a entity in the entites folder in order to make it spawn on the map correctly. Then with that you can use the hook Entity.GetKeyValues to get the key values.

I am just going by the Hammer terminology:

http://x3non.com/image/alec/160/test-spawnpoint.png

Also, do I need a entity in the entities folder even if I am using AddBasicPointEntity(‘test_spawnpoint’); ?

It’s easier to use a entity in order to hook it to key values.

Ok. But this entity never is seen. I will take a look at ZS’s info_player_human’s init.lua

[lua]
ENT.Type = “point”

function ENT:KeyValue( key, value )
if ( key == “team” ) then
print(key…" - "…value)
end
end
[/lua]

I use similar…

[lua]ENT.Type = “point”
function ENT:KeyValue( key, value )
self[key] = value
end[/lua]

Then access the values from the entities table using value = ent.key

Thanks. Both of those solutions work, I will report back on how I got everything to work in the end for my case.