ID:2174648
 
(See the best response by Flame Guardian.)
Code:
mob
Login()
world << "[usr.ckey] has joined Dunglas."
spawn
src.DunglasStart()


proc/DunglasStart()
var
prompt_title = "Load slot"
help_text = "What character do you want to load?"


Problem description:

No matter how I try to put in Login() ingame after mob, it gives me a completely dark screen with no map loading and the rest of the other things aren't executed. I am fairly new to coding with dm and would appreciate some help.
Working from a phone... Can't really provide much code from my end.

Login()
..()
DunglasStart()


..() will make Login carry out its default programming, that spawn also was unnecessary and not properly used. Spawn() should only be used when necessary as it can be rather cpu intensive. Sleep() in almost every case is a better choice then Spawn().

Also, nothing is happening because both your login and dunglastart() aren't really trying to do anything. What would you like to accomplish when a player logs in?
I got the black screen solved, thanks. Well, I'm trying to script together so that people have a choice between a select number of slots that they can load a character from.

My game is supposed to have random char role generation and people just roll with it, so I want to limit the slots that they can use and maybe also the amount of times they can delete and craft a new char once their slots are all filled up, per day. You know, to stop possible exploits.
Best response
Glad I could be of service. Cheers & feel free to pm if you have any further issues.
Don't put usr in Login(). It really only works correctly when Login() is called directly for a new connection. If you have something like character loading and saving, usr will be very wrong.

In Login(), use src instead. It always refers to the actual mob being logged into by a client. usr refers to the mob whose client started off the chain of events that led to this proc, which may not be the same thing at all.
In response to Lummox JR
Lummox JR wrote:
Don't put usr in Login(). It really only works correctly when Login() is called directly for a new connection. If you have something like character loading and saving, usr will be very wrong.

In Login(), use src instead. It always refers to the actual mob being logged into by a client. usr refers to the mob whose client started off the chain of events that led to this proc, which may not be the same thing at all.

This. I totally missed that usr.