I need an SNPC to know what player spawned it. ENT:SpawnFunction doesn’t seem to get called, so that’s not working for me.
The actual reason I need the SNPC to know its player is for setting up dispositions. Right now I have this:
function ENT:GetRelationship( entity )
local entClass = entity:GetClass()
if entClass == self:GetClass() then return D_LI elseif self.KnownDispositions[entClass] then return self.KnownDispositions[entClass] else return D_HT -- ?? end else return D_NU end
The thing with the line where I return D_HT is that it will make the SNPC hate any NPC it doesn’t know about, including other SNPCs that are friendly with player (specifically, SNPCs that use the same code as this one). I was wanting to replace the line with return entity:Disposition(self.MyPlayer).
Also, I couldn’t find ENT:GetRelationship in the wiki. Should I take that as a sign that I shouldn’t be using it?