ID:170989
 
Can you guys help me make a good char_handeling with the click() sow when you press contiue on the titlescreen you can choose one of the chars you have made for exmpel

Things needed in char_handeling

no html in char name
max char name is 20 capitals
A Create,load and delete proc
a saveing system
Quxatrox wrote:
Can you guys help me make a good char_handeling with the click() sow when you press contiue on the titlescreen you can choose one of the chars you have made for exmpel

Things needed in char_handeling

no html in char name
max char name is 20 capitals
A Create,load and delete proc
a saveing system

1.) Please use proper spelling, so that we can understand you better.

2.) Have you tried, http://developer.byond.com/hub/Griswald/CharacterHandling?

3.) Try that, and if you have and can't get it to work, THEN ask on the forums about that specific demo asking for help and someone can try to help you if they even understand you("Sow","Exmpel","Handeling","Saveing" are supposed to be "So","Example","Handling","Saving")

(It's starting to get unbearable)

http://www.dictionary.com

It sounds like your misspelling on purpose just to sound cool, well, spelling right on programming forums shows intelligence, which is a good thing. So at least, just spell right on here, if anything. :P
(No offense is meant in any of this)
In response to Lenox
Thnx i am not typing in that way to sound "cool" <.< lol
but i am frome the netherlands and my spelling in dutch is not my best side eather lol but i am typing in a fast way i think that my problem i will typ slowlyer and read my post again for posting srry guy`s and thnx i will have a look at it.
In response to Quxatrox
Well, that explains a lot, and Griswald's tutorial should really help you understand how to do it. I myself looked at it after several failed attempts at using deadron's, but then I didn't like Griswald's style, so I attempted to fix a small problem I had with Deadron's character creation, and boom, it worked(using Wizkidd's fix of course ^_^) :P
In response to Quxatrox
it`s almost what i am looking for only it can make 1 char and i cant figure it out how to set it sow you can make more chars and load more chars
In response to Quxatrox
I'll edit and post it here to allow more characters.

// Saving / Loading system by Griswald
// (c) 2002+ Griswald Greenleaf


// Please Note: There are NO CODE CHANGES FROM V1.1 to V1.2! There were only
// Comment additions. Also redid the images to the login screen. People
// said they were too hard too read, so I turned them to basic text. Hope
// they are readable now =)


// At the Request of some people, I have taken and added more comments
// to better explain what is going on. The comments I will add will be for 100%
// n00b's. If you aren't a n00b, and know byond coding, etc, just delete my comments :)
// -- Griswald --
world
hub = "Griswald.CharacterHandling"
name = "Griz' Character Handler"




mob
Login()
usr.loc = locate(5,5,2) // change to your title screen
..()

mob
var/characters = 0 // Leave this at 0, this is for the default amount of characters.
proc
//----------------------------------//
CreateChar(mob/M) // The char creation function -- Change with whatever you want for
// creating a character.
//----------------------------------//

src.icon = 'Mob.dmi' // define the characters icon

//----------------------//
src << "Char gen done!" // this is just a debug message to show that this proc
// is being called.
//----------------------//

usr.characters += 1
usr.loc = locate(1,1,1) // spawn the character to 1,1 on map #1
usr.sight = 0 // make it so the character can see
usr.SaveChar() // Auto-Save the new char for just in case game crashes.
..()

SaveChar() // The proc that saves your character.
var/savefile/F = new("players/[src.ckey].sav") // define the save file and create it
F["name"] << name // Outputs the characters name into the savefile list
F["X"] << src.x // Outputs the char's X coordinate into the list
F["Y"] << src.y // Outputs the char's Y coordinate into the list
F["Z"] << src.z // Outputs the char's Z coordinate into the list
F["Mob"] << usr.client.mob // Outputs ALL of the character (var's, etc) into the list

verb
Save()
usr.SaveChar() // Make a call to the character's saving proc
usr << "Your character has been saved." // Inform the player that he's been saved.

turf/CharHand
icon = 'charhand.bmp'
density = 1

turf/nomove
density = 1

turf/NewChar
icon = 'new.bmp' // change this to the bmp of your "New Character" button
Click()
usr.sight = 1 // Blackscreen them so they can't choose another choice
if(usr.characters == 10) //This is the only thing that will work for some odd reason. Anyways, set the number to the max amount of characters allowed.
src << "You already have the maximum number of characters available." //Say this to the user if they have the max amount of characters
else
if (fexists("players/[usr.ckey].sav")) // Check if they have a save file
switch(alert("If you continue with a new character, your previous character will be erased. Do you wish to continue?","[world.name]","Yes","No"))
if ("Yes")
usr << "... Ok... Beginning character process now."
usr.CreateChar()
return ..()
if ("No")
usr << "Ok, Please reconnect for you are being disconnected now and then choose \"LOAD GAME\""
del(usr)
return ..()
else
usr.CreateChar() // No savefile found, create a new character
return ..()
..()

mob
proc
LoadCharacter() // The load character proc
var/savefile/F = new("players/[src.ckey].sav") // define the location of the save file
var/X // Defines a temporary X variable
var/Y // Defines a temporary Y variable
var/Z // Defines a temporary Z variable
var/mob/newmob = new() // Initialize a new mob
F["name"] >> name // Load the name from the list into the character's name
F["X"] >> X // Load the X variable from the savefile to the temporary X variable
F["Y"] >> Y // Load the Y variable from the savefile to the temporary Y variable
F["Z"] >> Z // Load the Z variable from the savefile to the temporary Z variable
F["Mob"] >> newmob // Load all the mob data into the initialized mob
newmob.loc = locate(X,Y,Z) // Move the initialized mob to the last saved location
newmob.client = src.client // Set the mob's client to players client

turf/LoadChar
icon = 'load.bmp' // change the bmp to the bmp to your "Load Character" image
Click()
if(fexists("players/[usr.ckey].sav")) // check to see if the character has a savefile
usr.LoadCharacter() // Make a call to load the character

//----------------------------------//
world << "\[[world.name]]--> [usr.name] has logged in!" // Announce to the world
// that the user logged in
//----------------------------------//

usr << "Welcome back to the game!" // Welcome the player
return ..()
else
alert("You don't HAVE an old character here, or it isn't found in our databases!")
// Uh oh! No player file found when they clicked Load!
return ..()
..()

turf/Grass
icon = 'Grass.dmi'

Try that. The problem with this demo though, is that it doesn't seem to allow you to delete characters. So it may not be what you need. This SHOULD work. (The original work is griswalds, of course)
In response to Lenox
Yes i need the delete characters thnx anyway for helping ;)

But you know the coding or how to code this verb:

exempel you have a gm tab then you klick on the verb remove tab and it will disepear but when you press it again in wil apear and you still have the same gm verbs?
In response to Quxatrox
Quxatrox wrote:
Yes i need the delete characters thnx anyway for helping ;)

It's not hard to code in a Delete Char code, I'm sure you can do it easily :P
In response to Lenox
you have msn sow i can add you if i may? or page you
In response to Quxatrox
If you want two verbs under one command it would probally be something like this.


Give_Gm(mob/M in world)
if(M.GM == 1)
world << "[usr] has striped [M] of his...."
M.GM = 0
M.verbs-=typesof(/mob/GM/verb)
else
if(M.GM == 0)
world << "[usr] has given [M] Gm commands"
M.GM = 1
M.verbs+=typesof(/mob/GM/verb)


If that's not what you want be mmore specific.
In response to Chwgt
Sorry Typo I meant "Be more specific."
In response to Chwgt
There is an edit button for a reason.

~>Jiskuha
In response to Quxatrox
If you're using Deadrons character handling this is all you need for the delete option to be useable...

mob/BaseCamp/ChoosingCharacter
ChooseCharacterMenu(list/menu)
var/Option=input(src,"Welcome to [world.name]!") in menu
ChooseCharacterResult(Option)
DeleteCharacterMenu(list/menu)
var/Option=input(src,"What will you do?") in menu
DeleteCharacterResult(Option)
In response to Wanabe
He said on the Titlescreen, which is different, one like griswalds (check it out, see what he means)