ID:150292
 
I need help on how to give my New players verbs when they create a player. not when they log in.
I AM USING THIS SAVING SYSTEM!!!!!


#include

#define BASE_MENU_CREATE_CHARACTER "Create New Character"
#define BASE_MENU_DELETE_CHARACTER "Delete Character"
#define BASE_MENU_CANCEL "Cancel"
#define BASE_MENU_QUIT "Quit"


// Implementation
client/var/tmp
base_num_characters_allowed = 1
base_autoload_character = 1
base_autosave_character = 1
base_autodelete_mob = 1
base_save_verbs = 1

mob
var/tmp/base_save_allowed = 1 // Is this mob allowed to be saved?
var/list/base_saved_verbs // If we're saving verbs they are stored here.

proc/base_InitFromSavefile()
return

mob/BaseCamp
base_save_allowed = 0 // BaseCamp mobs are for admin only.

Login()
RemoveVerbs()
return

Stat()
return

Logout()
return

proc/RemoveVerbs()
for (var/my_verb in verbs)
verbs -= my_verb

mob/BaseCamp/FirstTimePlayer
proc/FirstTimePlayer()
return 1


mob/BaseCamp/ChoosingCharacter
Login()
// spawn to make sure all administrative tasks are over.
spawn()
ChooseCharacter()
return ..()

proc/ChooseCharacter()
var/list/available_char_names = client.base_CharacterNames()
var/list/menu = new()
menu += available_char_names

if (length(available_char_names) < client.base_num_characters_allowed)
if (client.base_num_characters_allowed == 1)
// If only one character allowed, jump right to creating character.
client.base_NewMob()
del(src)
return
else
menu += BASE_MENU_CREATE_CHARACTER

if (length(available_char_names))
menu += BASE_MENU_DELETE_CHARACTER

menu += BASE_MENU_QUIT

var/default = null
var/result = input(src, "Who do you want to be today?", "Welcome to [world.name]!", default) in menu

switch(result)
if (0, BASE_MENU_QUIT)
// Kick them off.
del(src)
return

if (BASE_MENU_CREATE_CHARACTER)
client.base_NewMob()
del(src)
return

if (BASE_MENU_DELETE_CHARACTER)
// Give them a chance to delete something, but then they need to choose.
DeleteCharacter()
ChooseCharacter()
return

// They must have chosen a character, so load it.
var/mob/Mob = client.base_LoadMob(result)
if (Mob)
del(src)
else
ChooseCharacter()

proc/DeleteCharacter()
var/list/available_char_names = client.base_CharacterNames()
var/list/menu = new()
menu += available_char_names

menu += BASE_MENU_CANCEL
menu += BASE_MENU_QUIT

var/default = null
var/result = input(src, "Which character do you want to delete?", "Deleting character", default) in menu

switch(result)
if (0, BASE_MENU_QUIT)
// Kick them off.
del(src)
return

if (BASE_MENU_CANCEL)
return

// They chose a character to delete.
client.base_DeleteMob(result)
ChooseCharacter()
return



client
var/tmp/savefile/_base_player_savefile

New()
// Let them choose/create a character.
if (base_autoload_character)
base_ChooseCharacter()
base_Initialize()
return
return ..()

Del()
// Save character.
if (base_autosave_character)
base_SaveMob()

// Delete mob.
if (base_autodelete_mob)
del(mob)
return ..()


proc/base_PlayerSavefile()
if (!_base_player_savefile)
// Put in players/[first_initial]/[ckey].sav
var/start = 1
var/end = 2
var/first_initial = copytext(ckey, start, end)
var/filename = "players/[first_initial]/[ckey].sav"
_base_player_savefile = new(filename)
return _base_player_savefile


proc/base_FirstTimePlayer()
var/mob/BaseCamp/FirstTimePlayer/first_mob = new()
first_mob.name = key
first_mob.gender = gender
mob = first_mob
return first_mob.FirstTimePlayer()


proc/base_ChooseCharacter()
// Switches the player to a choosing character mob.
// In case switching in middle of game, save previous mob.
base_SaveMob()

var/mob/BaseCamp/ChoosingCharacter/chooser

// Do they have any characters to choose from?
var/list/names = base_CharacterNames()
if (!length(names))
// They must be a first time player.
var/result = base_FirstTimePlayer()
if (!result)
// They weren't approved, so boot 'em.
del(src)
return

// Okay let them create their first character.
chooser = new()
mob = chooser
return

// If only one character is allowed, try to just load it.
if (base_num_characters_allowed == 1)
base_LoadMob(names[1])
return

chooser = new()
mob = chooser
return


proc/base_CharacterNames()
// Get the full names of all this player's characters.
var/list/names = new()
var/savefile/F = base_PlayerSavefile()

F.cd = "/players/[ckey]/mobs/"
var/list/characters = F.dir
var/char_name
for (var/entry in characters)
F["[entry]/name"] >> char_name
names += char_name
return names


proc/base_NewMob()
// Give the player a standard mob.
// First save existing mob if necessary.
base_SaveMob()
var/mob/new_mob
new_mob = new world.mob()
new_mob.name = key
new_mob.gender = gender
mob = new_mob
// new_mob.base_Initialize()

// Clear out the savefile to keep it from staying open.
_base_player_savefile = null
return new_mob


proc/base_SaveMob()
// Saves the player's current mob based on the ckey of its name.
if (!mob || !mob.base_save_allowed)
return

// If we're saving verbs, move them over now.
if (base_save_verbs)
mob.base_saved_verbs = mob.verbs

var/savefile/F = base_PlayerSavefile()

var/mob_ckey = ckey(mob.name)

var/directory = "/players/[ckey]/mobs/[mob_ckey]"
F.cd = directory
F["name"] << mob.name
F["mob"] << mob
_base_player_savefile = null


proc/base_LoadMob(char_name)
// Look for a character with the ckey version of this name.
// If found, load it, set the client mob to it, and return it.
// Otherwise return null.
var/mob/new_mob
var/char_ckey = ckey(char_name)
var/savefile/F = base_PlayerSavefile()
_base_player_savefile = null

F.cd = "/players/[ckey]/mobs/"
var/list/characters = F.dir
if (!characters.Find(char_ckey))
world.log << "[key]'s client.LoadCharacter() could not locate character [char_name]."
mob << "Unable to load [char_name]."
return null

F["[char_ckey]/mob"] >> new_mob
if (new_mob)
mob = new_mob
new_mob.base_InitFromSavefile()

// If we're doing verbs, set them now.
if (base_save_verbs && new_mob.base_saved_verbs)
for (var/item in new_mob.base_saved_verbs)
new_mob.verbs += item
return new_mob
return null


proc/base_DeleteMob(char_name)
// Look for a character with the ckey version of this name.
// If found, delete it.
var/char_ckey = ckey(char_name)
var/savefile/F = base_PlayerSavefile()

F.cd = "/players/[ckey]/mobs/"
F.dir.Remove(char_ckey)



</<></<>
HELP ME !!!!
I was going to help you but you bumped your post twice so I refran from helping you.
In response to Nadrew
I have had this up for 2 days so i was trying to get it at the top so some1 would help...what do you mean anyway?I am just trying to get help.
In response to Freeker
Freeker wrote:
I have had this up for 2 days so i was trying to get it at the top so some1 would help...what do you mean anyway?I am just trying to get help.

Hmm how do you get 2 days between 11/10/01 9:28 pm and 11/11/01 9:02 pm? From what I can tell it wasn't even 1 day much less 2.
In response to Theodis
I just really need help.I am new at this forum thing so if i broke any of yall "rules" I didn't mean to any i don't know about any if the "rules" all I know is that i need help with this.
In response to Freeker
Freeker wrote:
I have had this up for 2 days so i was trying to get it at the top so some1 would help...what do you mean anyway?I am just trying to get help.


It means don't bump your posts it makes people no want to help you.
In response to Nadrew
Ok I didn't know sorry.Please help me.
In response to Freeker
Dude!
I just read how you could do this..
Its was in the "A Guide to DM"!!!!

Reading time!!!
LJR
That is not what I need.Not the Login are the new.I need the maker of this code to tell me how i make stuff happen when a player chooses create new char.
In response to Freeker
Freeker wrote:
That is not what I need.Not the Login are the new.I need the maker of this code to tell me how i make stuff happen when a player chooses create new char.



This is why you should have a basic understanding of how to code before you try to add to librarys.
In response to Nadrew
I know how to code..Have you played dbz forever?I did all of that.
[Spuzzum #1 walks up to the podium.]

Ahem. Is this thing on?

[audience laughs]

What are you people laughing at? Er, anyway... I would like to commemorate this occasion with a small speech.

It's great being here and all, at this Commemoration Ceremony.
[looks around] Oh, it'd be pretty stupid if I dropped my speech notes!

[audience laughs]

Uh, that wasn't a joke. Anyway, I'd like to thank my mom, and my dad, and my cat, and that little bit of goo you can find under your fingernails in the morning.

[audience laughs]

That wasn't a joke either... but anyway, without further adieu, let's get to the presentation of the award!

[Spuzzum #1 steps down from the podium and shakes Spuzzum #2's hand, smiling. Spuzzum #2 steps up.]

Well, it's a pleasure, folks. Pleasure, folks... last time I checked, my folks weren't very pleasant!

[audience is silent]

Uh, that was supposed to be a joke.

[audience laughs]

That's better. Anyway, I'm here at this ceremony for a particular reason, and that's to grant the Award. Oh, shoot, where's the envelope?

[audience is silent]

Actually, that was a joke too.

[audience laughs]

Ah, of course... THERE it is!

[Spuzzum #2 walks up to an audience member and, using a sleight-of-hand trick, pulls it out from behind a young male audience member's ear.]

Tada!

[audience is silent, before someone shouts "That guy stole the envelope!" and a mob descends viciously upon the young male audience member. Spuzzum #2 blinks as the young man is beaten up.]

Er... anyway, let's rip 'er open and see what she says!

[Spuzzum #2 fumbles with the envelope.]

And the Award for Outstanding Excellence in Annoying Topic Names goes to...

[Spuzzum #2 opens the envelope and reads it.]

FreekerChild, for his "HHHEEEEEEEEELLLLP!!!!!!!!!!!!!!!!!!!!!!!!" post!

[audience applauds and searchlight turns on FreekerChild.]

Come on up here, FreekerChild! They love you! We all love you!

[A helper walks to the front and presents the award: ]




(Okay, yes, I was bored, and yes, this is meant in good fun. =P)
In response to Freeker
Freeker wrote:
I know how to code..Have you played dbz forever?I did all of that.


No, I don't play DBZ games, congrats on the award too.
In response to Nadrew
This is one of those wanna be everythings people who PK u in games here.

I wouldn't bother even posting to anything he says.
In response to FreekerChild
No, you suck.. end of discussion.
In response to Necron
Necron wrote:
No, you suck.. end of discussion.

Now, jokey posts are one thing... downright flames are another.
In response to Freeker
Freeker wrote:
I know how to code..

Then why are you asking for help?
FreekerChild, read this:

Community Standards
Page: 1 2