Author Topic: Can't count while wearing shoes ....  (Read 524 times)

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Can't count while wearing shoes ....
« on: August 06, 2010, 05:51:45 pm »


               I'm looking for help counting PC in an area ... from thatt area's OnEnter event. My feeble attempts seem to count all in the module instead.

In a nutshell ... if on enter, one or more PCs are there already ... abort the script. If the triggering Pc is the first one into the area ... do something else.

Thanks in advance. I had this figured out once, but lost it when my old computer died.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Can't count while wearing shoes ....
« Reply #1 on: August 06, 2010, 06:13:26 pm »


               THIS?
               
               

               
            

Legacy_Redunct

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
Can't count while wearing shoes ....
« Reply #2 on: August 06, 2010, 07:14:37 pm »


               

In a nutshell ... if on enter, one or more PCs are there already ... abort the script. If the triggering Pc is the first one into the area ... do something else.




Couldn't you just save a local int to an object in the room, default to 0. Add one to the onEnter for each entering PC, subtract one for each leaving PC, if int is 0, fire the script, onEnter?





               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Can't count while wearing shoes ....
« Reply #3 on: August 06, 2010, 07:28:28 pm »


               

Redunct wrote...

In a nutshell ... if on enter, one or more PCs are there already ... abort the script. If the triggering Pc is the first one into the area ... do something else.


Couldn't you just save a local int to an object in the room, default to 0. Add one to the onEnter for each entering PC, subtract one for each leaving PC, if int is 0, fire the script, onEnter?


Nope when dead pc exits game, area OnExit is not fired
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Can't count while wearing shoes ....
« Reply #4 on: August 06, 2010, 08:15:47 pm »


               

ShaDoOoW wrote...

Redunct wrote...


In a nutshell ... if on enter, one or more PCs are there already ... abort the script. If the triggering Pc is the first one into the area ... do something else.


Couldn't you just save a local int to an object in the room, default to 0. Add one to the onEnter for each entering PC, subtract one for each leaving PC, if int is 0, fire the script, onEnter?


Nope when dead pc exits game, area OnExit is not fired

Thanks ShaDoOoW ... that was what I was looking for, I set my template to return if the count equals more than one PC in the area and it's working fine now.