EDIT: No idea why it didn't before, but the third code block seems to be working now. My question still stands though: is there a list of properties somewhere that I can access?
Quoting my original post:
Spoiler
Quote:
So, I'm trying locate all existing sappers belonging to a given player, so I can then run code on them.
I have managed to do the same thing with Engineer buildings:
Code:
while ((sentrygun = FindEntityByClassname(sentrygun, "obj_sentrygun"))!=INVALID_ENT_REFERENCE) {
if ((IsValidEntity(sentrygun)) && (GetEntPropEnt(sentrygun, Prop_Send, "m_hBuilder") == client)) {
//stuff
}
}
However, I can't seem to figure out how to do the same thing with sappers. I've been able to locate sappers attached to a specific engineer's building with this:
But apparently, "m_hBuilder" isn't a valid property of obj_attachment_sapper.
How can I find the owner of a sapper? Is there a public list of valid properties for different objects somewhere that I can access? Or is m_hBuilder correct, and there's just something else wrong?
m_hBuilder is there on built sappers. Perhaps try validating the entity and then checking the netprop, but on seperate lines, instead of trying to short-circuit it (which usually doesn't work and errors out, from my experience)
You can get a list of netprops of every netclass in the game (including TempEnts) by using sm_dump_netprops in server console. (e.g. sm_dump_netprops netprops.txt drops a list into orangebox/tf/netprops.txt) Same story with sm_dump_datamaps, which may have even more properties for the entity you're looking at, since it's per-entity instead of per-netclass.
Although, I don't think you need to be checking IsValidEntity if it pops up in FindEntityByClassname...hm.