ID:262610
 
Code:
mob
proc
Create()
var/char_name=input(src,"What do you wish for your name to be","Create") as text
if (!text)
alert("You most enter a name")
return

var/char_race=input("What Starting icon do you want","create") in list ("WhiteHair","Some Girl")
if ("White Hair")
src.icon = '1.dmi'
src.icon_state = "2"
src.loc=locate(2,2,2)
src.SaveChar()
if ("Some Girl")
src.icon = '1.dmi'
src.icon_state = "2"
src.loc=locate(2,2,2)
src.SaveChar()


Problem description:i get the warnings
loading IconTopia.dme
login.dm:30:char_name :warning: variable defined but not used
login.dm:36:char_race :warning: variable defined but not used
loading map.dmp
saving IconTopia.dmb

IconTopia.dmb - 0 errors, 2 warnings (double-click on an error to jump to it)
why am i geting these and why does it not call the mobs name var when i put
Stat()
statpanel("You")
stat("Name",[src.name]")

it sets the mobs name as his/hers key plese help

SummonerHater And Dest Games wrote:
Code:
> mob
> proc
> Create()
> var/char_name=input(src,"What do you wish for your name to be","Create") as text
> if (!text)/// Ungh, change this to char_name
> alert("You most enter a name")
> return
>
> var/char_race=input("What Starting icon do you want","create") in list ("WhiteHair","Some Girl")
> if ("White Hair")// do if(char_race=="White Hair")
> src.icon = '1.dmi'
> src.icon_state = "2"
> src.loc=locate(2,2,2)
> src.SaveChar()
> if ("Some Girl")// do if(char_race=="Some Girl")

> src.icon = '1.dmi'
> src.icon_state = "2"
> src.loc=locate(2,2,2)
> src.SaveChar()
>

In response to Xeal
k ive did evry thing u said to do but now itt dont move my character off the title screen
Add loc=locate(1,1,1) or somewhere along the lines of that.
In response to Xeal
i did but it wont take me any were
world
view ="13x13"
mob
Login()
src.loc=locate(7,8,1)

obj
Tittle
icon = 'Image2.png'

New
icon = 'new.png'
Click()
usr.Create()

Load
icon = 'load.png'
Click()
usr.LoadCharacter()

Del
icon = 'del.png'
Click()
del usr


mob
proc
Create()
var/char_name=input(src,"What do you wish for your name to be","Create") as text
if (!char_name)
alert("You most enter a name")
return
src.icon = '1.dmi'
src.icon_state = "1"
src.loc=locate(2,2,2)
src.SaveChar()
turf
grass
icon = 'icons.dmi'
icon_state = "4"

mob
proc
SaveChar()
var/savefile/F = new("players/[src.ckey].sav")
F["name"] << name
F["X"] << src.x
F["Y"] << src.y
F["Z"] << src.z
F["Mob"] << usr.client.mob

proc
LoadCharacter()
var/savefile/F = new("players/[src.ckey].sav")
var/X
var/Y
var/Z
var/mob/newmob = new()
F["name"] >> name
F["X"] >> X
F["Y"] >> Y
F["Z"] >> Z
F["Mob"] >> newmob
newmob.loc = locate(X,Y,Z)
newmob.client = src.client

verb
Save()
src.SaveChar()
src << "Saved"

heres my whole login code i took out the icon select it was just useing up space this is the first time loc=locate has worked for me its done the same evry time sence i upgraded to (Version 342.880) idk if its a bug or what
SummonerHater And Dest Games wrote:
i did but it wont take me any were
>   view ="13x13"
> mob
> Login()
..()
> src.loc=locate(7,8,1)

In response to Xeal
still doesnt work an this is the only code i have so far for this game so i know it cant be another code messing it up idk whats going wrong
SummonerHater And Dest Games wrote:
still doesnt work an this is the only code i have so far for this game so i know it cant be another code messing it up idk whats going wrong

That's exactly what happening.
mob
proc
Create()
var/char_name=input(src,"What do you wish for your name to be","Create") as text
if (!char_name)
alert("You most enter a name")
// return Take this out...
src.icon = '1.dmi'
src.icon_state = "1"
src.loc=locate(2,2,2)
src.SaveChar()


You're using return before the proc even ends.
In response to Mega fart cannon
That's wrong. Don't remove that return! That will only make matters worse.

The problem is that all of the lines that create a character are indented under "if (!char_name)", when they shouldn't be. Unindent them:

mob
proc
Create()
var/char_name=input(src,"What do you wish for your name to be","Create") as text
if (!char_name)
alert("You most enter a name")
return
src.icon = '1.dmi' // Unindent these four
src.icon_state = "1" // lines once,
src.loc=locate(2,2,2) // so they look
src.SaveChar() // like this
In response to Crispy
thank you so much it works now