im starting a new game and im now working on the start up screen.
i found this cool password system thing in the demo section of byond so i copyed it. now when you log into my game you log in with the password and then you get lead into the start up screen.
in the start up screen there are the following options:
World one
world two
world three
i am making it that when you click on would 1 you get lead to a nother map and if you click on would 2 you go to a nother map and if you click world three you go to a nother map.
this is the code i'm using:
turf // turf
World1 // the name of the turf
icon = 'world1.bmp' // the icon of the turf
density = 1 // if 1, you can't walk through it
Click() // if you click it...
usr.loc = locate("World1")
before i used the password system thing this code use to work now it doesn't.
this is the password login code:
world
name = "Volte's Password Login Demo"
turf = /turf/grass
view = 5
mob
icon = 'player.dmi'
icon_state = "player"
var
old_x
old_y
old_z
password
Logout() // Upon logging out..
src.old_x = src.x //Set your current position, to your old_ variables.
src.old_y = src.y
src.old_z = src.z
pl_savecharacter(src) // Call the save character proc
Login() // Upon logging in..
pl_log_in(src) // Call the log in proc.
verb
Say(t as text)
world << "[usr.name] chats: [t]" // Send the message to the world.
proc
pl_savecharacter(mob/M as mob)
var/savefile/F = new("characters/"+lowertext(M.name)+".sav") //create a savefile in the directory of "characters', witht he name of the characters name.
F["old_x"] << M.old_x // Save their last coordinates.
F["old_y"] << M.old_y
F["old_z"] << M.old_z
F["password"] << M.password // Save the password.
M.Write(F) // Write all values of each variable stored within M.
del(M) // Deletes the physical mob.
//pl_loadcharacter(S as text,mob/M as mob)
pl_log_in(mob/M as mob)
start:
var/namex = input("Please enter your characters name") as text // Ask for a character name
if(fexists("characters/"+lowertext(namex)+".sav")) // If there is a save file named that..
var/savefile/F = new("characters/"+namex+".sav")
var/right_pass
F["password"] >> right_pass // Retrieve that characters password.
var/pass = input("Please enter the password for this character.") as password // Ask for the password.
if(pass == right_pass) // If the password is right..
F["old_x"] >> M.old_x //Load the character
F["old_y"] >> M.old_y
F["old_z"] >> M.old_z
F["password"] >> M.password
usr.loc = locate("start")
M.Read(F) // Read the variables stored in F, and load them.
else // If the password is wrong..
M << "Wrong password, please try again." // Inform them
M.password = null //clear the password var, for security reasons.
goto start // Restart the process.
else // If there isn't a savefile of that name..
start_create:
switch(input("New character. Are you sure you want the name [namex]?") in list ("Yes","No")) // Confirm that they want that name
if("Yes") // If they want it, continue on with the process..
M.name = namex
start_password:
var/password_1 = input("Please enter a desiared password for [namex]") as password // Ask for a password
if(!password_1) goto start_password // If they entered nothing as a password, ask again.
var/password_2 = input("Please retype the password") as password // Confirm it
if(password_1 != password_2) goto start_password // If they don't match, ask them again.
M.password = password_1
M.icon_state = input("Please pick a gender.") in list("Boy","Girl") // Ask for a gender
usr.loc = locate("start") // Move you to the bottom left corner.
world << "[M.name] has joined Ebay!" // inform the world of your creation
else // if they don't...
goto start_create // restart.
can anyone tell me what is wrong when I click on world one, now i get lead to a black map insted of a map that is filled with grass. and yes i put the tag world1.
Please Help!
</<></<></<></<>
ID:147544
Apr 6 2004, 10:57 am
|
|
In response to Siientx
|
|
To expand more helpfully on Siientx's brief example - you're not actually placing the player's mob anywhere. So the player's mob is at the location "null", which is nowhere - hence the black screen.
To fix this, you have to set the player's location. The easiest way of doing this is to put the following line in whenever you override a Login() proc: ..() This line goes after the "Login()" line, and is indented one tab further than that "Login()" line. |
Lummox JR