Ok, now that I figured out how to make rooms and exits, could someone please tell me how to make it so when you enter a room it tells you who's in the room?
What I mean is say this is what is shown when you enter a room:
{"Fountain of life
You have come upon the great fountain of life."}
What I'm asking is how after it says "You have come upon the great fountain of life" to have the game say who's in the room(not of the entire world)?
ID:149646
![]() Mar 19 2002, 10:56 am
|
|
DoOmBringer wrote:
Something like this you mean why not for(var/mob/M in room) src << "[M] is here." |
DoOmBringer wrote:
I thought of that but then you need to add the other mobs to src.room altough im not 100% sure Exut? Not sure what you mean, but it doesn't sound like something you need to do. |
Here is an example of why I personally think you have to use the for(mob in world) thing
mob var room mob/npc/M mob/npc1/N Login() M = new N = new verb/switchroom1() var/room = input(src,"What Room Do You Want To Move To","Room Move") in list("Bathroom","Bedroom","Kitchen") src.room = room for(var/mob/M in src.room) src << "[M] is in here" verb/switchroom() var/room = input(src,"What Room Do You Want To Move To","Room Move") in list("Bathroom","Bedroom","Kitchen") src.room = room for(var/mob/M in world) if(M.room == src.room) if(M != src) src << "[M] is in here" npc New() var/room = pick("Bathroom","Bedroom","Kitchen") src.room = room npc1 New() src.room = "Bathroom" results where switchroom1 would not report any mob in src.room switchroom() reported all other mobs in the room but the usr |
DoOmBringer wrote:
results where switchroom1 would not report any mob in src.room switchroom() reported all other mobs in the room but the usr Doesn't look like you indented in under the for loop in switchroom1. That would explain it. |
for(var/mob/M in world)
if(M.room == src.room)
src << "[M] Is In This Room"
there are probaly better ways to do this im just doing this quickly