ID:273579
Sep 4 2010, 9:39 pm
|
|
I've looked everywhere and tried almost everything for a good Who() verb that actually displays EVERYONE online (name & key) every other Who() verb I tried using ended up only displaying the usr.name and usr.key not everyone who was logged on at the time. :|
|
mob/verb/Who(var/mob/M in world) Obviously I am sure there are a few different ways to do this, but this method has always worked solid for me. On a side note you don't strictly have to pass "M" to a browser window I did this for simplicities sake. EDIT : I too had a moment of fail in time, but it could also be the fact that it is 5 in the am. Anyway I have posted below a quick edit so that you will have another way of seeing the players key if you would like. mob/verb/Who(var/mob/M in world) |
In response to Smokymcpot
|
|
This is what the Who() verb looks like as of now. Usually when my host has a server up and I test the Who() verb out, it only displays the 'person who initiated the verb's name and key not EVERYONE's name and key, then the number of people online.
mob/verb |
In response to Midgetbuster
|
|
Any time you have:
for(mob/m in world) you NEED to change it to: for(var/client/C) |
In response to Garthor
|
|
Arr i see i see. Didn't know about that.
What would be the difference may i ask? |
In response to Midgetbuster
|
|
Imagine you want to look up a number in your local telephone book. How are you searching?
Do you browse through all numbers and then check if the name attached to the number is what you're looking for, or so you go directly for the name and then check it's number? Or, in the scenario Gathor mentions, it is highly likely that there are (far) less objects of type client, than there are of type mob. So, instead of searching through every mob and check if it has a client, you go and check for clients directly and get less work for your poor computer. |
In response to Paul De La Torre
|
|
Paul De La Torre wrote:
I had a good Who() verb one time but (...) [I messed] up the code and forgot how the original looked Had you actually read the guide and put forth effort to work on comprehending the basics of the language instead of browsing through it like a comic, you could recreate this with ease yourself. So, it might be worth the effort in the end, if you really intend to create a game worth playing. As for your problem, you haven't been searching at all, or you'd have found Lummox JR's response: [link]. Funny enough, he even explains a problem similar to what you encounter. You're rebuilding the HTML document for each mob (with a client variable set) to contain only one single name, instead of building up the document once, but adding all the found objects of type mob and then sending it once. |
In response to Schnitzelnagler
|
|
As Schnitzelnagler said, you're rebuilding the page each and every time that loop is run.
var/players = 0 Hope you understand where you went wrong. (I kept your formatting.) |
In response to Schnitzelnagler
|
|
arr that makes a lot of sense now.
Thanks once again for opening my eyes +1 To Garthor and Snager |
In response to Midgetbuster
|
|
Hmm, I do see where I went wrong, thanks to everyone to posted to my topic (whether it was a positive feedback or not).
|
further more dont lie that you could not find one it would be a common thing for newbies to be asking and im sure if i decided to run a search myself id find tons of topics.
EDIT: I may (or may not have) misread the topic if you were after an actual detailed what things a specified mob has then refer to the post by Smokymcpot, otherwise enjoy.