ID:150474
 
what is the value for a pc already being in a world already? i can;t find this any where
BurningIce wrote:
what is the value for a pc already being in a world already? i can;t find this any where

I'm thinking either of two, Client and Key. Here's an example.
mob/verb/CheckforClient(mob/M as mob in oview())
if(M.client) //if they've got a client
usr << "[M] is a person."
else
usr << "[M] has no client, and is an NPC."


Another way, to tell what key someone is logged into is:
mob/verb/ClientKey(mob/M as mob in oview())
if(M.client && M.key) //both a key and client
usr << "[M] has a client. \His key is [M.key]."
else
usr << "[M] is an NPC."


Make sense? For more information, look up "key" and "client" client vars in the Ref!
In response to Vortezz
well what im trying to do is make a solo game so how would i make it so if there is a pc in the world somthing happens
In response to BurningIce
BurningIce wrote:
well what im trying to do is make a solo game so how would i make it so if there is a pc in the world somthing happens

This post ([link]) will tell you EXACTLY what you need!

Remember, keep your mind wide. You, most likely, won't get the exact answer to your question!
In response to Vortezz
Vortezz wrote:
BurningIce wrote:
what is the value for a pc already being in a world already? i can;t find this any where
....blah blah......
usr << "[M] is an NPC."
</DM>


shouldn't it be usr <<"[M] is a NPC



proper grammer ;)
In response to XxxSnakexxX
shouldn't it be usr <<"[M] is a NPC
proper grammer ;)

Its a bit ambigous. You pronounce NPC like "en-pee-cee," so it make sense in that way to say "an NPC" rather than "a NPC".

-AbyssDragon
In response to AbyssDragon
AbyssDragon wrote:
shouldn't it be usr <<"[M] is a NPC
proper grammer ;)

Its a bit ambigous. You pronounce NPC like "en-pee-cee," so it make sense in that way to say "an NPC" rather than "a NPC".

-AbyssDragon

Actually the best way to go is just use

"usr <<"[M] is \a NPC"

And let the computer figure it out.
In response to BurningIce
BurningIce wrote:
well what im trying to do is make a solo game so how would i make it so if there is a pc in the world somthing happens

Since BYOND games don't run unless there's somebody in them, there will always be a PC in the world.

If you'd like to make it so something happens when someone logs in, you can place code in mob/Login().

mob
Login()
world << "A PC has entered the world!"
..()

Z
In response to Zilal
I know that im not a newbie but the thing is I want it s that if a PC is already in the world how do u make a PC with a different key automaticly get kicked out when he trys to log on that persons server. Making it a single player game.
In response to BurningIce
mob/Login()
var/Players=0
if(Players>=1)
usr<<"This Game is only one player"
del(src)
else
src.loc=locate(1,1,1)
Players=1
..()
In response to Nadrew
Nadrew wrote:
mob/Login()
var/Players=0
if(Players>=1)
usr<<"This Game is only one player"
del(src)
else
src.loc=locate(1,1,1)
Players=1
..()

No, that wouldn't work. That's setting a local var. You'd want a global var for that.

Anyway, an easier way to do it is with a for() loop.
mob/Login()
var/mob/P
var/count
for(P)
count++
if(count > 1)
src << "Somebody is already playing this!"
count--
del(src)
else
..()


This is untested, I haven't compiled it. My mind's compiler compiles it fine... Tell me if it's faulty.
In response to BurningIce
Um... if it's a single-player game, people shouldn't be hosting it as a server to begin with. :P But, of course, you can't count on players to behave as you want them to.
In response to XxxSnakexxX
XxxSnakexxX wrote:
Vortezz wrote:
BurningIce wrote:
what is the value for a pc already being in a world already? i can;t find this any where
....blah blah......
usr << "[M] is an NPC."
</DM>


shouldn't it be usr <<"[M] is a NPC



proper grammer ;)

N has always been pronounced "en." Proper grammer calls for the word "an" to procede "NPC," unless you think this is pronounced "nippik," and someone accidentally capitalized the word.
In response to XxxSnakexxX
XxxSnakexxX wrote:
shouldn't it be usr <<"[M] is a NPC

proper grammer ;)

"A" would be correct only if you read NPC out as "Non-Player Character". In its abbreviated form, it's pronounced by spelling out each letter, N-P-C, so "an" is correct.

I've often seen writers use the a/an to go with an acronym's spelled-out form, but to my mind this is clearly wrong. (I don't know what official grammar rules are on this, but this seems to be a common sense issue.) If you want the acronym to read in its expanded form, then you should be using the expanded form and not the acronym.

There is also one more caveat to the acronym rule: If the acronym is of a sort that has an easier pronunciation, like SCUD, the a/an is applied to that pronunciation rather than the letter-at-a-time form:

Wrong (sort of):
Iraq launched an SCUD missile.
Right:
Iraq launched a SCUD missile.

Of course, the latter is only right grammatically. Iraq really shouldn't be allowed to own any missiles, let alone shoot them off.

Now, if we could only get people to stop insisting "an historic" is a correct pronunciation for people who don't drop the H, we'll be all set.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
There is also one more caveat to the acronym rule: If the acronym is of a sort that has an easier pronunciation...

Unless I'm mistaken, I think that's actually the definition of an acronym: a collection of the first letters of words that's spoken as a word and not as a collection of letters. If you pronounce the letters, it's not an acronym anymore.

Z
In response to BurningIce
BurningIce wrote:
I know that im not a newbie but the thing is I want it s that if a PC is already in the world how do u make a PC with a different key automaticly get kicked out when he trys to log on that persons server. Making it a single player game.

If you'd been that specific to begin with, we could have helped you a lot sooner. ;)

Z
In response to Zilal
Zilal wrote:
Lummox JR wrote:
There is also one more caveat to the acronym rule: If the acronym is of a sort that has an easier pronunciation...

Unless I'm mistaken, I think that's actually the definition of an acronym: a collection of the first letters of words that's spoken as a word and not as a collection of letters. If you pronounce the letters, it's not an acronym anymore.

Z

Nope, there are lots of acronyms that are usually pronounced by letter. FBI, CIA, GAO, DMV, and of course NPC. The definition of an acronym only requires that it be spelled with the initial letters of the words involved, not that it be pronounced one way or another.

Lummox JR
In response to Foomer
Actually the best way to go is just use

"usr <<"[M] is \a NPC"

And let the computer figure it out.
Yeah, but then you'll get "a herb" instead an herb. (It doesn't recognize the silent H)

-James
In response to Jmurph
Jmurph wrote:
Actually the best way to go is just use

"usr <<"[M] is \a NPC"

And let the computer figure it out.
Yeah, but then you'll get "a herb" instead an herb. (It doesn't recognize the silent H)

What really throws me is that some people actually do say it with the H. In Britain that's common, which is strange because they're the ones who developed that pesky quirk of dropping H's in the first place, which in turn is probably why people say silly things like "an historian".

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Zilal wrote:
Lummox JR wrote:
Nope, there are lots of acronyms that are usually pronounced by letter. FBI, CIA, GAO, DMV, and of course NPC. The definition of an acronym only requires that it be spelled with the initial letters of the words involved, not that it be pronounced one way or another.

Well, now you've done it. I took the effort of looking it up. Most sources I found did follow my definition, but I did find some adhering to your less stringent offering. When I was a kid, NASA was an acronym, but FBI was just initials. Kids these days... no respect for stringency... and I know why. It's all those astringents the youth use.

I always kept away from that stuff. Not being able to get a date is a small price to pay for the maintenance of the English language.

Z
Page: 1 2