ID:170978
 
I need help, I am trying to make a game which I know how to do, but what I don't know how to do and I'm not to sure if I'm doing it right is this...

mob
CC
proc
Choose()
if(fexists("Save Files/[client.ckey]"))
switch(alert("What do you wish to do?","Loading...","New Character","Load Character","Quit"))
if("Quit")
del src
if("Load Character")
client.Load()
else
Create()
else
switch(alert("What do you wish to do?","Loading...","New Character","Quit"))
if("Quit")
del src
else
Create()
Create()
var/mob/NC
var/CCName
CCName = input("What is your name?","Creation") as null|text
if(!CCName)
alert("Everyone has a name!","Error")
Create()
if(lentext(CCName) < 2)
alert("Your name is too short!","Error")
Create()
if(lentext(CCName) > 20)
alert("Your name is too long!","Error")
Create()
if(Check_For_Tags(CCName,HTML_TAGS) == TRUE)
alert("HTML is not allowed!","Error")
Create()
else
CCName = html_encode(CCName)
Race = input("What are you?","Creation") in list("Argonian","Drow Elf","Dwarf","Elf","Gnome","Half-Elf","Half-Orc","Half-Ogre","High Elf","Human","Khajit","Ogre","Orc","Cancel")
switch(Race)
if("Human")
Class = input("What is your class?","Creation") in list("Archer","Assasin","Barbarian","Bard","Cleric","Dark Knight","Dragoon","Druid","Fighter","Monk","Necromancer","Ninja","Paladin","Ranger","Rogue","Samurai","Shadow Dancer","Sorcerer","Summoner","Thief","Time Mage","Wizard","Cancel")
if("Cancel")
alert("Changed your mind?","Abortion")
Choose()


Okay.. my question is, am I doing the Race and Class thing right? Also, how would I make a list, or whatever, that makes the mob learn certain spells/skills/etc. at certain levels? Thanks alot if you guys could help me.. I would really appreciate it.

P.S. - And by the way if anybody has a better way for Creating character please do let me know, this is the only way I could kind of understand and get to work.. thanks again.

~ChibiGoku04
Hey, I'd ditch that character handling stuff you have there, and go to Deadron's Character Handling lib. You might have to edit some stuff. (Like I had to edit newmob so that it'd load into my newmob instead of going to some nonexistant(Somewhat) mob.) It works nicely once you get it how you want it.
In response to Lenox
Well that's the thing though, I don't mind looking, and taking little itty-bitty things from other peoples codes, but I don't, and I repeat, don't want to take somebody elses codes, or libraries, I will look them over, and take parts of it and change it or something like that, but I'm the kind of person that wants to do it on my own, even when it comes to websites, or Java, or anything, I wanna be the one to do it, not somebody else. Thanks, but no thanks, that's just the way I am..


~ChibiGoku04
In response to ChibiGoku04
Aiight, I think you should still look into it though. I believe most people who use it always edit it to fit there needs. (some might edit it and fix that bug with the delete character code)
In response to Lenox
And another thing.. I want to make it to when you click on Load from the Choose() that a list pops up with your saved characters on that list... Do you know how I would do that.. And the Delete thing to.. i don't get that either.Thanks, again.

~ChibiGoku04
In response to ChibiGoku04
Well, first things first, create SaveChar() procs and LoadChar() procs. THEN you can continue on how your going to do your Choose a character and such procs
In response to Lenox
I do have Save() and Load() I just didn't post them in the .. well.. post.. But they are in my files.

~ChibiGoku04
In response to ChibiGoku04
Next, make a Findchars() proc that searches for the savefiles.
In response to Lenox
And I would do that how?? LOL

~ChibiGoku04
In response to ChibiGoku04
Look up the following in the reference:
----------------------------------------
cd
----------------------------------------
fexists
----------------------------------------
also, think about looking up flist see if
you can find a use for that in this proc
----------------------------------------

OR

try to find a way to search a savefile for a specific
entry that holds the character name, add those to a names list, and return names
In response to Lenox
I use fexists() for my Choose() but cd and dir and all that stuff I don't get.. I just spent like 30 minutes trying to get a list to work, by doing this...
client/proc/FindChars()
var/list/CharList = newlist()
var/Char
var/savefile/F = new("Save Files/[src.mob.ckey]")
for(Char in F)
if(issaved(Char))
CharList.Add(Char)
return CharList
else


None of that worked. I'm not sure how to get it to work right, but if somebody can please help me either A) understand cd,eof,and dir or B)Help me find another way of doing it.. I would be in debt to this wonderous person.

~ChibiGoku04
In response to ChibiGoku04
I'm saying this, so that you might just give up and take the easy, and less stressful way out, USE DEADRONS!! just edit it to your liking and BAM. http://developer.byond.com/hub/Deadron/CharacterHandling

It's not bad, and i'm sure it'll give you exactly what you need.
In response to Lenox
Here.. I'll do this.. I'll look it over and see what I can find from it that will help me.. but that's it, okay? LOL
In response to ChibiGoku04
Can somebody please help me? If you read the message thread you will see that I have posted the code that I need help on.. Another thing that I don't get.. everytime that I transfer my [character_handling] to my src.client.mob it shows the mob.type in the bottom left corner, next to the chat thingy down there.. it shows that instead of mob.name.. Why is that? I don't get it.. is it supposed to do that?
In response to ChibiGoku04
You need to set mob.name
In response to Lenox
As you can see I use NC to define my new_mob, and later on in the code file I define NC.Name = CCName. Is that what you mean? And if your wondering I have var/Name as a atom/movable/var..
In response to ChibiGoku04
#include <deadron/characterhandling>

O.o
In response to Mega fart cannon
Use NC.name(lowercase N) instead of .Name, that might work.
In response to Lenox
But the thing is that I defined Name in my atom/movable/var... so that wouldn't affect it.. I wouldn't think... Well thanks anyway.. if anybody else can help me in making a new save format that works in anyway, besides Deadron's, I'm not saying that i have a problem with Deadron's work or anything associated with him.. I just am very independent in my work, and I like to make my own things work my own way.. Thanks anyway..
In response to ChibiGoku04
ChibiGoku04 wrote:
I'm not saying that i have a problem with Deadron's work or anything associated with him.. I just am very independent in my work, and I like to make my own things work my own way.. Thanks anyway..



We get the picture, but I seriously DO suggest you look into libraries. That's *why* they were made.