with this code:
/********
Character saving example.
This demo uses Deadron's CharacterHandling library,
which automatically handles saving and loading player mobs.
Player mobs are saved when the player logs out.
This demo saves the player and their last location on the map.
The library is a part of BaseCamp, Deadron's game infrastructure system.
Full documentation for the library can be found by double-clicking
on Lib/Deadron.CharacterHandling, then viewing the characterhandling.dm file.
If you have questions or suggestions, please email ron@deadron.com.
BaseCamp: From here you can reach Everest!
***********/
#include <deadron/characterhandling>
// How many characters is a player allowed to have?
client/base_num_characters_allowed = 3
/***
Turning off automatic features
------------------------------
By default, the CharacterHandling library automatically loads and saves characters
for you. There are settings that will turn off the automatic behavior if you wish.
client/base_autoload_character = 0
----------------------------------
This turns off auto-loading when a player logs in.
Whenever you do want the player to load a character, call that player's
client.base_ChooseCharacter() function.
client/base_autosave_character = 0
----------------------------------
This turns off auto-saving when a player logs out.
If you turn off auto-saving or also want to save at other times, use
the player's client.base_SaveMob() function, as shown in the save_me()
verb below.
client/base_autodelete_mob = 0
------------------------------
This stops the library from deleting the player's mob after they log out.
Without this, the mob will stay in the game until you delete it yourself.
mob/base_save_location = 0
------------------------------
This turns off the location saving, which means you will need to manually
place the mob after it is read in from the savefile.
Uncomment one or more of the following lines to turn off a feature.
***/
// client/base_autoload_character = 0
// client/base_autosave_character = 0
// client/base_autodelete_mob = 0
// mob/base_save_location = 0
/***
Specifying the mob type
-----------------------
When a new character needs to be created, the CharacterHandling library
creates a mob of type world.mob and logs the player into it.
You can choose any mob type and anything you want with this mob.
This example sets the default mob to /mob/creating_character.
When the player is logged into the creating_character class, they are asked
questions about their character's attributes. When they are done, a new
mob is created with those attributes and the player is logged into it.
This is just one possible way you could do things. It's provided as an example.
None of it is required for the library to work.
***/
world/mob = /mob/creating_character
/***********
Example character creation
--------------------------
The code below gives an example of setting up a character.
This is just to give you ideas for how you can do it yourself.
************/
mob/creating_character
base_save_allowed = 0 // If player quits before choosing, don't want to save this mob.
Login()
// Spawn here to avoid problems with calling prompts during login.
spawn()
src.CreateCharacter()
proc/CreateCharacter()
// In this case, the code creates a /mob/human or /mob/ogre with the specified attributes.
// Get the character information from them. (You would probably want to do with this a browser page.)
var/prompt_title = "New Character"
var/help_text = "What do you want to name the character?"
var/default_value = key
var/char_name = input(src, help_text, prompt_title, default_value) as null|text
if (!char_name)
// Guess they don't want to create a new character after all, so send them to choose a character.
client.base_ChooseCharacter()
return
// Make sure there isn't already a character named that.
// Character names are stored as ckey, so get the ckey version of the name.
var/ckey_name = ckey(char_name)
var/list/characters = client.base_CharacterNames()
if (characters.Find(ckey_name))
alert("You already have a character named that! Please choose another name.")
src.CreateCharacter()
return
var/list/classes = list("Boy", "Girl")
help_text = "Which class would you like to be?"
default_value = "Boy"
var/char_class = input(src, help_text, prompt_title, default_value) in classes
// Okay we have enough information, so it's time to create the character and switch the player to it.
var/mob/new_mob
switch(char_class)
if ("Boy") new_mob = new /mob/Boy()
if ("Girl") new_mob = new /mob/Girl()
// Set the attributes.
new_mob.name = char_name
// Now switch the player client over to the new mob and delete myself since I'm no longer needed.
src.client.mob = new_mob
var/turf/first_location = locate(6, 5, 1)
new_mob.Move(first_location)
del(src)
mob
Login()
..()
world<<"[src] has joined"
// This is just here for this sample, to make it clear which mob you've logged into.
sample_report()
verb
Add_Save_Verb()
// Adds save_me verb to the mob, to show that verb saving works.
src.verbs += /mob/proc/save_me
proc
sample_report()
src << "<BR><BR>"
src << "\blue Your Name is [name]."
src << "\blue You are a [type]."
save_me()
// This demonstrates verb saving and how to manually save the mob whenever you want..
// This proc gets added and saved as a verb only if add_verb is called by the player.
src.client.base_SaveMob()
src << "\red You have been saved."
mob/Boy
icon = 'Boy.dmi'
mob/Girl
icon = 'Girl.dmi'
how do i put a bmp "New"
then if you click "New" you'll creat a new char ( proc/CreateCharacter())
like the that one above?
and put a bmp "Load"
then if you click "Load" you'll load ur character
and put a bmp "Delete"
then when u click "Delete" it'll delete your saved character
well theres you create but your code doesnt have anything concerning loading and deleting, and i dont wanna waste my time making you one sry.