this is the farly straforid qeustion.
If there are NPC's or any object placed in the same area as the players start location, do thet trigger the OnEnter event first, before the pc
NPC Area OnEnter
Débuté par
Q.dot
, janv. 17 2011 09:17
#1
Posté 17 janvier 2011 - 09:17
#2
Posté 17 janvier 2011 - 11:28
I think they do.
NPC's placed via toolset, fire their onSpawn script as soon as the server starts up/the area is loaded, in which case the area will register them as being 'in' the area.
Quick way to test it would be to add this to the onArea enter script
void main()
{
object oEnterer = GetEnteringObject();
WriteTimeStampedLogEntry(GetName(oEnterer)+" entered the area");
}
Fire up your module, and see if the log contains the name of the npc's in the area.
Note - when we say onEnter script, it is the 'area' on enter, I dont think NPC's could fire a Module onClientEnter, because they are not Clients.
NPC's placed via toolset, fire their onSpawn script as soon as the server starts up/the area is loaded, in which case the area will register them as being 'in' the area.
Quick way to test it would be to add this to the onArea enter script
void main()
{
object oEnterer = GetEnteringObject();
WriteTimeStampedLogEntry(GetName(oEnterer)+" entered the area");
}
Fire up your module, and see if the log contains the name of the npc's in the area.
Note - when we say onEnter script, it is the 'area' on enter, I dont think NPC's could fire a Module onClientEnter, because they are not Clients.
#3
Posté 17 janvier 2011 - 04:39
Usually you just want to put in a If !(GetIsPC (oEnterer)) return;
#4
Posté 18 janvier 2011 - 02:09
thanks, I had a problem where the npcs would fire the onenter script, and thus screwed up the pcencer variable i had set up, but then I just did what ffbj siad and it worked propally. I just posted here to clarify what I had learned with the community, but thanks anyway.





Retour en haut







