I want to save a local int on an NPC if it sees the PC. I am doing this by modifying the main function of the standard on perception script. I am just putting in some lines to save the local int if oPercep (defined by GetLastPerceived()) == PC. Is this going to break the AI? I am asking because I have not changed the AI coding much. Any input is really appreciated.
Modifying OnPerception script to save a local int if the NPC sees the PC
Débuté par
M. Rieder
, févr. 25 2011 12:25
#1
Posté 25 février 2011 - 12:25
#2
Posté 25 février 2011 - 12:37
No it should not be an issue, make sure you use GetObjectSeen too though, perception does not always mean the creature seeing, it's more something done within a certain range to allow that function to fire, or when states change, it can fire a lot.
int GetObjectSeen(object oTarget, object oSource=OBJECT_SELF);
int GetObjectHeard(object oTarget, object oSource=OBJECT_SELF);
( and i always do range as well )
Might be a better solution than modding the AI which i would avoid, to just use the above in whatever real code is doing the work.
int GetObjectSeen(object oTarget, object oSource=OBJECT_SELF);
int GetObjectHeard(object oTarget, object oSource=OBJECT_SELF);
( and i always do range as well )
Might be a better solution than modding the AI which i would avoid, to just use the above in whatever real code is doing the work.
#3
Posté 25 février 2011 - 01:09
Thanks pain. That's what I ended up doing. I found the function that handles the object that is seen and just modified that one. It worked really well.





Retour en haut






