ID:170876
 
I am new here, and just have a couple of questions on how to do a couple of things for a text RPG I want to make. I have managed to successfully make the basic room structure, items base, and NPCs thanks to Zilal's tutorials, but there are still a couple of things I am stuck on. Ok, foremost, I have made it a point to check these resources first, so I am not just being lazy by looking for the answers here:

:DM Help Files [not newbie friendly at all]
:Blue Book [had no idea what to look for]
:Tutorials [90% geared towards graphical games]
:Message Board [The subjects that do cover what I need to know are written for people with some common knowledge of DM, of which I have barely any.]
:Tutorials on Byondscape [Nothing really new outside of the tutorials I found on Byond page]

So what am I trying to do? Nothing too impressive, I just need to figure out how to make a player spawn into a certain mob type when they log in based on their Key. Something to this degree:
world
if(key == "Name") mob = /mob/NameClass
else mob == /mob/DefaultClass

This doesn't work. And throws about six errors. I'll just assume this isn't the way to do things, I tried putting this under the client/new instead of world sections, but it just disconnects me when I start the game. Obviously I still had the wrong idea. I've been fighting with this command for a couple of weeks now, and finally had to post here asking for help. My apologies if it is a stupid question.

The second thing I want to do is disable the info tab that lists all available verbs, the reason being that in a text RPG, part of the fun of solving certain puzzles is ruined by seeing the new verbs that popped up in the panel. I'm pretty sure this can be done. But I don't even know what to start looking for.

I'm willing to learn all of this on my own, but resources on tutorials for text RPGs is limited since so many people want their games to be graphical. And I've noticed the graphical commands somehow don't transfer well, even when the graphical stuff is stripped away. If anyone can point me to any tutorials aside from Zilal's I will gladly go there instead of asking here. Any help is greatly appreciated.
From what i understand, you want something like this
mob
Login()
if(src.key == "name"
mob = /mob/NameClass
else
mob = /mob/DefaultClass
In response to Zero's Baby
Actually that is the same exact thing he wrote, except you forgot a ) in the first if(). You can try client.mob = // thing here. I'm not to sure though.
In response to N1ghtW1ng
woops, always forget my parenthesis <_<
In response to Zero's Baby
Thank you for the replies, I tried them out, but to no avail, it now throws this error when I compile it.

222:error:mob:undefined var
In response to Aurum
Try src.mob or src.client.mob or something, that may work.
In response to Lenox
Thank you for the reply, but with that a new problem has come up.

So far this is the code I am using:
mob
Newbie
Login()
if(src.key == "Aurum")
src.client.mob = /mob/DM
else
Move(locate("LoginRoom"))
..()
world << "[usr] has logged in."
//Coding for movement, etc.
DM
Login()
Move(locate("LoginRoom"))
..()
world << "DM [usr] has logged in."
//Cut and pasted coding from above for movement, etc.

Now if I log in under a name other than Aurum, it works fine, movement and everything. But when I log in under Aurum, nothing. It says I am connected, but that's it, only the basic commands are available that I stated under client. Other than that it doesn't respond. As if I logged in under some new mob with no commands available whatsoever. Which doesn't make sense because I would think it would throw an error if I was trying to code in a nonexistant mob. I apologize for all the questions, but it seems like I am just not understanding what I am supposed to do.
In response to Aurum
i would just do it like so
mob
Newbie
Login()
Move(locate("LoginRoom"))
..()
world << "[usr] has logged in."
//Coding for movement, etc.
DM
Login()
if(src.key == "Aurum")
Move(locate("LoginRoom"))
..()
world << "DM [usr] has logged in."


but of course i'm still jsut the newb, so... right..

In response to Zero's Baby
I tried that with the same results, there is obviously a problem elsewhere in my code, and I don't want to trouble everyone any more since I obviously have messed up my coding. Thank you for trying to help at least.

[EDIT] And here I go trying to make my message look less "whiny newbie"ish, and someone goes and posts what I said in their message.. blah.
In response to Aurum
Aurum wrote:
I tried that with the same results, I guess I have to code the whole thing from scratch again being as it must be a problem somewhere else in my code. Thank you for trying to help at least.

I am not looking forward to starting all over again.. ugh.

Think about it this way:

You now have a chance to make it BETTER than it was before.
In response to Zero's Baby
Zero's Baby wrote:
From what i understand, you want something like this
mob
Login()
if(src.key == "name"
mob = /mob/NameClass
else
mob = /mob/DefaultClass


That's not going to do any better. Aside from the missing closing parenthesis in your if() line, there is no mob.mob var, nor would setting client.mob (what you apparently intended) to a type path work.

Lummox JR