ID:1847049
 
(See the best response by Pokemonred200.)

Problem description: I was looking through the F1 Help feature and the DM guide but neither of those could tell me how to reconnect players without using the link method and the client.Topic() proc.

What I'm trying to do is reconnect a player if they attempt load a character without having one saved. Since the server link can change I just want to use ".reconnect" via command line. Would it be:

src << "command = \".reconnect\""


or something? I'm not too sure.

Best response
it would be:
winset(src,null,"command=.reconnect")


I believe.
As an alternative, why not do nothing in that event, and just allow the player the option to try and load a character again or start anew from the same point.
That worked Pokemonred.

Turbo that's uh.. you just made me feel dumb haha. I guess I'm used to games closing your connection when trying to load a character when there's no savefile, so I wanted to reconnect the player out of convenience. I would do that but my game has multiple login screen images and multiple sound files that are selected randomly and play upon login, so by reconnecting them I can force them to listen to another song and see another background image. >=)
In response to Oleic
Oleic wrote:
That worked Pokemonred.

Turbo that's uh.. you just made me feel dumb haha. I guess I'm used to games closing your connection when trying to load a character when there's no savefile, so I wanted to reconnect the player out of convenience. I would do that but my game has multiple login screen images and multiple sound files that are selected randomly and play upon login, so by reconnecting them I can force them to listen to another song and see another background image. >=)

That's actually something you can do without reconnecting as well, but you'd need a loop do do such. for example (this would be if you're using a label for the image, however, but I guess you can get the gist of it)

mob/Login()
var canExitLoop = FALSE
do
setImageAndMusic()
if(alert(src,"Do you want to start a new game or load a previous one?","New","Load")=="Load")
if(Load())canExitLoop = TRUE
else
New()
canExitLoop = TRUE
while(!canExitLoop)
mob/proc/Load()
if(!fexists("[src.ckey].sav"))return FALSE
else
// Loading Code Here
return TRUE

mob/proc/New()
// New Game Code Here

proc/setImageAndMusic()
src << sound(null)
var soundfile = pick('sound1.mid','sound2.mid','soundn.mid')
src << sound(soundfile)
var imagefile = pick('image1.png','image2.png','imagen.png')
winset(src,"window1.label1","image=\ref[imagefile]")

Oh hey you're right about that too. Hmm I'll put in and adjust that code to see how it works. Thanks for you guys' help!