It's me the newb again :P anyway here's my problem I put in coding and I get the error 'Undefined Proc' and I dunno how to fix it! Here's the code:
mob/PC/Login() //Let's get started:
var/I = input("What you wanna do?","Logging in") in list("Continue","Create New Character") //The input command is made so you can get information from whoever is defined and make the variable defined before the input() that value.
if(I == "Continue") //If the player selected continue...
var/savefile/F = new(client.Import()) //Ok, this is an advanced concept so if you get confused by this, skip it because all you really need to know is the format: savefile is a type like mob, obj, turf, area, atom, and so on are. When you create a new savefile, it is saved in the area specified (in this I do not specify a file path because client.Import does it for me.). client.Import will save it in your \BYOND\users\[Your name here]\Keyinfo\ folder... When I get to client.Export (the second part of this, the actual saving of it in other words) I will explain this some more...
if(F) //If there was a file there...
Read(F) //Read the mob specified in the file. The Read() proc reads all vars in the mob in the savefile (tmp vars are not saved, which I will show you a little later in the grouping procedures section.).
else
usr << "You ain't got a character saved!"
I = "Create New Character" //Turn I back to "Create New Character" so when it gets to that part of the proc below, it will make the person create a new one.
if(I == "Create New Character") //If they selected to create a new character or if it couldn't find a savefile which is defined above...
Name_Character()
var/G = input("What is your gender?","Gender:") in list("Male","Female") //Use input to get the src's selection of Gender.
var/C = input("What would you like your class to be?","Class:") in list("Warrior","Wizard") //Ditto but with class.
switch(G) //The switch statement is important. It is basically more memory efficient and is easier on you... It basically takes the G out of if(G == "Blah") or if(G == 98), so after the statement, you only need to put if("Blah") and such.
if("Male") //Like described above, I only need to put "Male" and no G == in it.
gender = MALE //Define their gender so when text macros such as \himself or \herself \his or \hers are called, it will put the correct gender specific word instead of say "itself."
else
gender = FEMALE
icon_state = "[lowertext(G)] [lowertext(C)]" //In the PC.dmi file, there are a few icon_states defined. This saves me trouble by defining whatever I put in the inputs into the textstring automaticly, but since they are lowercase in the .dmi file, I will use the lowertext() proc. This also gives you an example of how to put a proc into a text string.
if(C == "Wizard") //Now, to set stats... Because I defined icon_state in a special way above, I wont need to do anymore defining of it.
icon = 'Wizard.dmi'
if(C == "Warrior") //Now, to set stats... Because I defined icon_state in a special way above, I wont need to do anymore defining of it.
icon = 'Warrior.dmi'
health = 30
maxhealth = 30
Strength = 2
Defense = 2
Please help me! And when you log in you don't see the 'What's your class?' thing or even your icon!! Help please!
ID:267490
May 23 2003, 6:43 pm
|
|
May 23 2003, 9:13 pm
|
|
Copy and paste the error so we can see it. Also, put <code>#define DEBUG</code> in your code first, so that it tells the line number.
|
In response to Garthor
|
|
Well hell,I just deleted the little bastard,and now I have no errors but it still won't work right and you can't see yourself why??? I have the right coding it's just something's wrong...
|
In response to Lil'T
|
|
Someone please help!
|
In response to Lil'T
|
|
Which line is the error on? (And point it out, please... line numbers aren't helpful with snippets! =) )
|