Aller au contenu

Photo

NPC Area OnEnter


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Q.dot

Q.dot
  • Members
  • 22 messages
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

#2
Baaleos

Baaleos
  • Members
  • 1 330 messages
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.

#3
ffbj

ffbj
  • Members
  • 593 messages
Usually you just want to put in a If !(GetIsPC (oEnterer)) return;

#4
Q.dot

Q.dot
  • Members
  • 22 messages
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.