Hey. I'm trying to make a Marauder's Map. There's one in Hogwarts: A History. I can't seem to figure out how to get it to work right. Could anyone point me in the right direction? Or show me a segment of a code that would help me? I need it to give the person's name and their location. Please, any help would be nice.
ID:158225
Oct 5 2009, 3:39 pm
|
|
In response to Calus CoRPS
|
|
http://www.youtube.com/watch?v=9G_SdCcYFJw
I also thought about applying this concept as a game. It was a pretty cool idea coming from what's her face. ts |
In response to Calus CoRPS
|
|
Calus CoRPS wrote:
Gregs wrote: |
In response to Gregs
|
|
for(var/client/C) Display however you wish, and assuming you have named areas (which is what C.mob.loc.loc is grabbing). |
In response to Garthor
|
|
Garthor wrote:
for(var/client/C) I'd advice on making sure not to generate a runtime error here, if I may, since you might get flooded rather fast if you have a hundred players on-line, of which some might be 'in the void (null)'. |
In response to Schnitzelnagler
|
|
Schnitzelnagler wrote:
Garthor wrote: for(var/client/C) I'd advice on making sure not to generate a runtime error here, if I may, since you might get flooded rather fast if you have a hundred players on-line, of which some might be 'in the void (null)'. I left that as a learning experience. |
In response to Garthor
|
|
Thanks :).
|
In response to Schnitzelnagler
|
|
Schnitzelnagler wrote:
Garthor wrote: for(var/client/C) I'd advice on making sure not to generate a runtime error here, if I may, since you might get flooded rather fast if you have a hundred players on-line, of which some might be 'in the void (null)'. runtime error: Cannot read null.mob |
In response to Gregs
|
|
So. I'm trying to implement a item in the game kind of like the Marauder's Map from Harry Potter. And what the map does is, tells people location. Now, I kind of have any idea for the code and its:
obj |
In response to Gregs
|
|
Not entirely sure that this is what you are looking for but it seems like you are trying to display the area that people are in.
The following should do it: proc/get_area(var/area/a) |
In response to Lyndonarmitage1
|
|
Why would you take my entirely reasonable format of looping through clients and replace it with the utterly boneheaded format of looping through mobs looking for ones with clients?
|
In response to Gregs
|
|
What you are doing wrong is indentation, and then declaring a client/C variable for the obj instead of fixing THAT error.
|
In response to Garthor
|
|
Garthor wrote:
Why would you take my entirely reasonable format of looping through clients and replace it with the utterly boneheaded format of looping through mobs looking for ones with clients? Well yours gave me a proc error when i read it in game. So if you tell me how to fix it. I would be more then glad to use yours. |
In response to Gregs
|
|
It's not just about "Fixing it" it's about doing it correctly.
|
In response to Gregs
|
|
He already told you the problem: [link]
Compare your code to the for() loop in Garthor's initial example in this thread. |
In response to Kaioken
|
|
Kaioken wrote:
Compare your code to the for() loop in Garthor's initial example in this thread. And better yet, try to understand instead of simply copy and pasting. |
Do you mind explaining what a "Marauder's Map" is?