Author Topic: Player Area Counter  (Read 425 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Player Area Counter
« on: October 02, 2011, 09:45:07 am »


               I'm soliciting comments and suggestions on an idea I have. Bear with the explanantion:

Vehicle traffic engineers will set up strips along a roadway to count vehicle traffic. With some basic counts they can extrapolate and make decisions on how to route traffic, or speed or slow it.

I thought that for my latest PW it would be interesting to have a trigger that somehow would count the number of times a player crossed it. I think I'd have a better idea with a count if a player(s) were spamming a given area and then I could make adjustments as needed. Right now I'm kind of in the dark and I have no idea if a given area is being heavily favored over another.

How feasible is something like this? As far as the counting, it seems to me that would be somewhat straight forward to script (although I'm often quite mistaken the moment I make such declarations). A potential problem in my mind is how to store and record such a count. I don't think it would be necessary to permanently spit out a number...perhaps a DM could display the info?

In any case, that's the basic thrust of what I'm considering and why. Comments? Is this more trouble than it's worth?

Thanks in advance for your replies.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Player Area Counter
« Reply #1 on: October 02, 2011, 11:02:49 am »


               It should be a very simple script but you'll need some sort of database work which I have no knowledge in.

As for the counting and listing it, you can just add a OnEnter script to your areas like this

string sName = GetName(OBJECT_SELF);
int iCount = GetDBInt(sName);
SetDBInt(sName, iCount++);


And for reading these you could loop through all areas, get the int from each of them and print them to the DM. Damnit, I really should learn the basics of databases...
               
               

               


                     Modifié par Xardex, 02 octobre 2011 - 10:04 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Player Area Counter
« Reply #2 on: October 02, 2011, 05:30:48 pm »


                <Nodding toward the...>

You might look into the monitoring solutions discussed Here.

<...balcony boxes>
               
               

               
            

Legacy_KMdS

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
Player Area Counter
« Reply #3 on: October 02, 2011, 06:41:44 pm »


               I recommend setting up nwnx2 on your server first.  I use a windows based system and have used MySQL for my database.  I like their query browser and administrator tool and find them to be very helpfull.  Scripts for the system would be simple enough, but I recommend creating a seperate table within the database for the storage of this info.  If you wish, I can create a system from parts of work I have in my catalogs.