ID:146105
 
Code:
mob/proc/Create()
start1:
var/charname=input("Plese Give Us Your Name","Name",key) as text
if(!name)
usr<<"You need to give your self a NAME,DUH!!"
usr.client.Save_Char()
goto start1

start2:
description=input("Please set a description for your character.","Description") as text
if(!description)
usr<<"You need to give a description"
usr.client.Save_Char()
goto start2
else
usr.loc=locate(12,2,1)

switch(input("What Race Do You Want") in list ("Human","Demon","Half Demon","Liveing Dead"))
if ("Human")
usr.race = "Human"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Demon")
usr.race = "Demon"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Half Demon")
usr.race = "Half Demon"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Liveing Dead")
usr.race = "Liveing Dead"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"

switch(input("What Class Do You Want") in list ("Slayer","Priest","Munk","Wander"))
if ("Slayer")
usr.class = "Slayer"
usr.client.Save_Char()
if ("Priest")
usr.class = "Priest"
usr.client.Save_Char()
if ("Munk")
usr.class = "Munk"
usr.client.Save_Char()
if ("Wander")
usr.class = "Wander"
usr.client.Save_Char()

switch(input("What Is Your Gender") in list ("Male","Female"))
if ("Male")
usr.genders = "Male"
usr.client.Save_Char()
if ("Female")
usr.genders = "Female"
usr.client.Save_Char()

switch(input("Were do u want to start") in list ("Forest","Well"))
if ("Well")
usr.Move(7,9,2)
usr.client.Save_Char()
if ("Forest")
usr.Move(7,9,2)
usr.client.Save_Char()

src.client.mob = new_mob
new_mob.name = charname
del(src)


Problem description:for some reason its not takeing me to the new location after i make my char can some one tell me why

usr.loc=locate(7,9,2)
You want usr.Move(locate(7,9,2))

And you spelled monk wrong.
Many problems.

Firstly, No Put Usr In Proc, Ungh. Refer to The Usr Lecture.

Secondly, Goto is bad. You don't need to use goto here. Instead you can use while() loops, or just call the proc again, and use if checks like if(!name), if(!descrition).

Thirdly, that is not how Move() works. You have to do somethign like this:

mob/verb/Move_Loc()
src.loc = locate(7,9,2)
In response to Popisfizzy
Nope. I am pretty sure he does not want to do that. If there is anyone standing on 7,9,2 it will fail. Move() checks to see if the location you plan on moving to is empty by calling Bump and Enter. If it is empty and it is possible to move there, it will. Setting the loc directly will work.
In response to XzDoG
k ive did all yall ssaid but it doesnt want to move the player off the tittle screen
In response to XzDoG
XzDoG wrote:
usr.loc=locate(7,9,2)

tsk,tsk,tsk.
<s>usr.loc=locate(7,9,2)</s> = WRONG!
src.loc=locate(7,9,2) = RIGHT!


you might find The Usrlecture interesting to read, and maybe Usrisevil to.
In response to Juex
Can you show us the updated code.
The main problem is that Move() doesn't take coordinates. Use locate() with it, or just set loc directly like you did earlier in the snippet. I wouldn't be using usr here, you never know when you may need to initiate the creation of someone's character (character deletion). You really shouldn't be using goto for the name or description, a while would fit a lot better, and since I don't see new_mob declared I'm going to add it.

var/mob/new_mob = new

new_mob.name=input(src,"Please give us your name.","Name",key)
while(!new_mob.name)
src<<"You need to give your self a NAME,DUH!!"
new_mob.name=input(src,"Please give us your name.","Name",key)


There's no need for all of those switches (except for the last one), just set the variable to the value that input() returns.

new_mob.race = input(src,"What Race Do You Want") in list ("Human","Demon","Half Demon","Liveing Dead"))
new_mob.icon = 'mob.dmi'
new_mob.icon_state = "1"


Also, why are you saving during character creation? Are the half made characters even going to work? I'd wait until thy're finished to save it, they could bail and decide to go a different way with their character. =)
Also:
    switch(input("Were do u want to start") in list ("Forest","Well"))
if ("Well")
usr.Move(7,9,2)
usr.client.Save_Char()
if ("Forest")
usr.Move(7,9,2)
usr.client.Save_Char()

You're asking the player where he wants to start, but it doesn't matter wich place he chooses he'll end up at location "7,9,2" that'd be either the forest or the well.

And of course you will have to use "src.loc=locate(7,9,2)" like a few others mentioned.

O-matic
In response to O-matic
He could be doing that for debug reasons. I usually do that also when my map isn't finished.
In response to N1ghtW1ng
N1ghtW1ng wrote:
He could be doing that for debug reasons. I usually do that also when my map isn't finished.

ouch! didn't think of that. :P

O-matic
In response to O-matic
Yea, I have mine set up like that, but it checks to see if its me and sends me to the location regardless.
In response to N1ghtW1ng
atom/movable
var
move
description

var/mob/new_mob

/*
mob
Move()
if (Moving())
return 0
return ..()

proc
Moving()
if (move == 0)
return 1
return 0
*/

turf
e
icon = 'tesr.dmi'
icon_state = "1"

obj
tittle
icon = 'Inulogin.bmp'
obj
conu
icon = 'load1.png'
Click()
usr.client.Load_Char()

obj
New
icon = 'new1.png'
Click()
spawn()
usr.Login()
usr.Create()

Exit
icon = 'quit1.png'
Click()
del (usr)
/*
proc/CreateName(r=255, g=r, b=r)
var/outline = "#fff"
if(30*r+59*g+11*b > 7650) outline = "#000"
namefont.QuickName(src, rgb(r,g,b), outline)
*/

mob/proc/Create()
start1:
var/charname=input("Plese Give Us Your Name","Name",key) as text
if(!name)
usr<<"You need to give your self a NAME,DUH!!"
usr.client.Save_Char()
goto start1

start2:
description=input("Please set a description for your character.","Description") as text
if(!description)
usr<<"You need to give a description"
usr.client.Save_Char()
goto start2
else
usr.loc=locate(12,2,1)

switch(input("What Race Do You Want") in list ("Human","Demon","Half Demon","Liveing Dead"))
if ("Human")
usr.race = "Human"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Demon")
usr.race = "Demon"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Half Demon")
usr.race = "Half Demon"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"
if ("Liveing Dead")
usr.race = "Liveing Dead"
usr.client.Save_Char()
icon = 'mob.dmi'
icon_state = "1"

switch(input("What Class Do You Want") in list ("Slayer","Priest","Munk","Wander"))
if ("Slayer")
usr.class = "Slayer"
usr.client.Save_Char()
if ("Priest")
usr.class = "Priest"
usr.client.Save_Char()
if ("Monk")
usr.class = "Munk"
usr.client.Save_Char()
if ("Wander")
usr.class = "Wander"
usr.client.Save_Char()

switch(input("What Is Your Gender") in list ("Male","Female"))
if ("Male")
usr.genders = "Male"
usr.client.Save_Char()
if ("Female")
usr.genders = "Female"
usr.client.Save_Char()

switch(input("Were do u want to start") in list ("Forest","Well"))
if ("Well")
usr.loc=locate(7,9,2)
usr.client.Save_Char()
if ("Forest")
usr.loc=locate(7,9,2)
usr.client.Save_Char()

src.client.mob = new_mob
new_mob.name = charname
del(src)

there
In response to Juex
Did you even read mine and YMI's posts? [link], [link]
In response to Juex
You don't want new_mob declared globally. As soon as someone logs in, they will become new_mob, then when someone else logs in they will take over that person's mob. Declare it inside the Create() proc.

Also, you don't need to call Login() in the New /obj's Click() procedure. It will be called when you set the client's mob to new_mob.
In response to YMIHere
dont i need to put as text on the end of the input to declare what to do
In response to N1ghtW1ng
is this better
turf
e
icon = 'tesr.dmi'
icon_state = "1"

obj
tittle
icon = 'Inulogin.bmp'
obj
conu
icon = 'load1.png'
Click()
src.client.Load_Char()

obj
New
icon = 'new1.png'
Click()
spawn()
src.Create()

Exit
icon = 'quit1.png'
Click()
del (usr)

atom/movable
var
move
description

mob/var/new_mob = new
proc
Create()
new_mob.name=input(src,"What do You Want your name to be","Name")as text
while(!new_mob.name)
src<<"You need to give your self a NAME,DUH!!"
new_mob.name=input(src,"Please give us your name.","Name") ; return

switch(input("What Race do you want") in list ("Human","Demon","Half Demon","Liveing Dead")
if ("Human")
new_mob.race = "Human"
new_mob.icon = 'mob.dmi'//left each one with the icon ocde like this so its easyer to change when i get my icons done
new_mob.icon_state = "1"
if ("Demon")
new_mob..race = "Demon"
new_mob.icon = 'mob.dmi'
new_mob.icon_state = "1"
if ("Half Demon")
new_mob.race = "Half Demon"
new_mob.icon = 'mob.dmi'
new_mob.icon_state = "1"
if ("Liveing Dead")
new_mob.race = "Liveing Dead"
new_mob.icon = 'mob.dmi'
new_mob.icon_state = "1"

switch(input("What Class Do You Want") in list ("Slayer","Priest","Munk","Wander"))
if ("Slayer")
new_mob.class = "Slayer"
if ("Priest")
new_mob.class = "Priest")
if ("Munk")
new_mob.class = "Munk"
if ("Wander")
new_mob.class = "Wander"

switch(input("What gender is [src]") in list ("Male" , "Female")
if ("Male")
new_mob.genders = "Male"
if ("Female")
new_mobs.gender = "Female"

switch(input("Were do you wish to start") in list ("Well","Forest")
if ("Well")
src.loc=locate(7,9,2)
if ("Forest")
src.loc=locate(7,9,2)

src.client.mob = new_mob
del (src)

In response to Juex
The default is as text, though. =)
In response to Juex
Not really, but you are using while and the new_mob variable (except where you set the location, change that to new_mob as well). You're not declaring new_mob in the proc though, and once you do Create() should once again become usable (right now it's defined under a variable =/).

mob
proc
Create()
var/mob/new_mob=new
...


Aside from that, input() defaults to usr, so make sure they all use src. There's a few typos that'll stop it from compiling, but those are easy enough to spot. The switches aside from the icon setting one can still be removed without any extra work, though. =)

Some other things I just noticed are that you're using a .bmp for the title screen (if you can convert it to a .png the game will be a quicker download) and you've got a description variable (there's a built-in desc variable for all atoms).

*Edit
The indentation in Create() is off, and don't forget O-matic's reply.
Page: 1 2