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:
[lua]
function ENT:GetRelationship( entity )
if entity:IsPlayer()
then
return D_LI
elseif entity:IsNPC()
then
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
end
[/lua]
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?