ID:179702
 
I have been trying to get deadrons' player handling to work and i get no errors but when i log in it goes to a black screen after all the questions so can some one please help me
here is the code i am using
#include



// How many characters is a player allowed to have?
client/base_num_characters_allowed = 8


/***
Turning off automatic features
------------------------------
By default, the CharacterHandling library automatically loads and saves characters
for you. There are client 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.

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


/***
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("Human","Namek","Changling","Majin","Ginyu","Android"," Saiyan")
help_text = "What race would you like?"
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("Human")
switch(input("Which human would you like?","HUMANS")in list("Krillen","Tien","Yamcha"))
if("Krillen")
src.icon='Krillen.dmi'
src.loc=locate(2,89,1)
new_mob = new /mob/Krillen()
if ("Tien")
src.icon='Tien.dmi'
new_mob = new /mob/Tien()
src.loc=locate("Start")
if("Yamcha")
src.icon='Yamtcha.dmi'
new_mob = new /mob/Yamtcha()
src.loc=locate("Start")
if("Namek")
switch(input("Wich namek would you like","NAMEKS")in list("Piccolo","Nail"))
if("Piccolo")
src.icon='Piccolo.dmi'
new_mob = new /mob/Piccolo()
src.loc=locate("Start")
if("Nail")
src.icon='Nail.dmi'
new_mob = new /mob/Nail()
src.loc=locate("Start")
if("Changling")
alert("For right now all i have is frieza ok.")
src.icon='Frieza.dmi'
new_mob = new /mob/Frieza()
src.loc=locate("Start")
if("Majin")
switch(input("Which majin would you like","MAJINS")in list("Buu","Dabura","Majin Vegeta"))
if("Buu")
src.icon='Buu.dmi'
new_mob = new /mob/Buu()
src.loc=locate("Start")
if("Dabura")
src.icon='Dabura.dmi'
new_mob = new /mob/Dabura()
src.loc=locate("Start")
if("Majin Vegeta")
src.icon='MajinVegeta.dmi'
new_mob = new /mob/Majinvegeta()
src.loc=locate("Start")
if("Ginyu")
switch(input("Wich ginyu would you like","GINYUS")in list("Guldo","Recoom","Burter","Jeice","Ginyu"))
if("Guldo")
src.icon='Guldo.dmi'
new_mob = new /mob/Guldo()
src.loc=locate("Start")
if("Recoom")
src.icon='Recoom.dmi'
new_mob = new /mob/Recoom()
src.loc=locate("Start")
if("Burter")
src.icon='Burter.dmi'
new_mob = new /mob/Burter()
src.loc=locate("Start")
if("Jeice")
src.icon='Jeice.dmi'
new_mob = new /mob/Jeice()
src.loc=locate("Start")
if("Ginyu")
src.icon='Ginyu.dmi'
new_mob = new /mob/Ginyu()
src.loc=locate("Start")
if("Android")
switch(input("Wich android would you like","ANDROIDS")in list("16","17","18"))
if("16")
src.icon='Android16.dmi'
new_mob = new /mob/Android16()
src.loc=locate("Start")
if("17")
src.icon='Android17.dmi'
new_mob = new /mob/Android17()
src.loc=locate("Start")
if("18")
src.icon='Andriod18.dmi'
new_mob = new /mob/Andriod18()
src.loc=locate("Start")
if("Saiyan")
switch(input("Wich saiyan would you like","SAIYANS")in list("Goku","Vegeta","Trunks","Gohan"))
if("Goku")
src.icon='Goku.dmi'
new_mob = new /mob/Goku()
src.loc=locate("Start")
if("Vegeta")
src.icon='Vegeta.dmi'
new_mob = new /mob/Vegeta()
src.loc=locate("Start")
if("Trunks")
src.icon='Trunks.dmi'
new_mob = new /mob/Trunks()
src.loc=locate("Start")
if("Gohan")
src.icon='Gohan.dmi'
new_mob = new /mob/Gohan()
src.loc=locate("Start")

// 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("Start")
new_mob.Move(first_location)
del(src)

mob
Login()
..()

// This is just here for this sample, to make it clear which mob you've logged into.
sample_report()

Write(savefile/F)
// This is sample code that keeps track of the player's last position on the map.
// Their last position is stored when the mob is saved, then reinstated when the mob
// is read in.

// First, call the default Write() behavior for mobs.
..()

// Now, if we have a map, remember their last location.
if (world.maxx)
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
// Call the default Read() behavior for mobs.
..()

// Now, if we have a map, put them back on the map in their last location.
if (world.maxx)
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)


proc
sample_report()
src << "

"
src << "\blue You are [name]."
src << "\blue Your class is [type]."
mob
verb
save()
// 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 << "\blue You have been saved."


mob/Krillen
icon = 'Krillen.dmi'
mob/Tien
icon = 'Tien.dmi'
mob/Yamtcha
icon = 'Yamtcha.dmi'
mob/Goku
icon = 'Goku.dmi'
mob/Vegeta
icon = 'Vegeta.dmi'
mob/Trunks
icon = 'Trunks.dmi'
mob/Gohan
icon = 'Gohan.dmi'
mob/Recoom
icon = 'Recoom.dmi'
mob/Guldo
icon = 'Guldo.dmi'
mob/Burter
icon = 'Burter.dmi'
mob/Jeice
icon = 'Jeice.dmi'
mob/Ginyu
icon = 'Ginyu.dmi'
mob/Piccolo
icon = 'Piccolo.dmi'
mob/Nail
icon = 'Nail.dmi'
mob/Frieza
icon = 'Frieza.dmi'
mob/Dabura
icon = 'Dabura.dmi'
mob/Majinvegeta
icon = 'Majinvegeta.dmi'
mob/Buu
icon = 'Buu.dmi'
mob/Android16
icon = 'Android16.dmi'
mob/Android17
icon = 'Android17.dmi'
mob/Andriod18
icon = 'Andriod18.dmi'
i know its long but i want to show the whole code so you can see if anything is wrong with it so thanx if you help


~Gouku~</<></<></<>
i see every one elses post gettin answered but nope not mine and when people say show come code i show it and it makes people go away beucase they are to lazay to read the damn thing and thats it

[Edit] Do not swear here. The next time you do it, you are gone.


In response to Gouku
It is because you feel you need to post your entire code on the board and ask people to fix it for you. That's not the way it works.
In response to Ebonshadow
Ok jst to let you know thats not my entire code only the loging in portion of my code and i am not asking them to fix it just asking them why it doesnt wrk so they can tell me whats wrong and so i can fix it
In response to Gouku
Gouku wrote:
Ok jst to let you know thats not my entire code only the loging in portion of my code and i am not asking them to fix it just asking them why it doesnt wrk so they can tell me whats wrong and so i can fix it

read the debug message.
In response to Ebonshadow
How was FAQ supposed to help out
In response to Gouku
Have you tried reading it?

You can read, right?

-- Tarmas
In response to Tarmas
[Edit] Do not swear here. The next time you do it, you are gone.
In response to Gouku
I should remind you that using profanity like that on the forums can get you banned from them.
In response to Gouku
By teaching you how to code without using a library so you won't get problems that you don't know how to fix because you don't understand how the code works.
In response to Gouku
Oh yeah people are more reluctent to help on a dbz game too you might want to keep that in mind also.
In response to Nadrew
Nadrew wrote:
I should remind you that using profanity like that on the forums can get you banned from them.

Heed that warning, Gouku. I am getting really sick of seeing this kind of stuff on these boards.
seems like you need to put some ..() in there. It should go in after each bit of code that completes a login for each type of character. That returns the operation back to the origional Login() proc, and will prevent you from getting that black screen. You would know this if you did the ZBT tutorial, which should be a requirement for all newbies.

~X

Please don't be so vulgar on this forum. People won't help you if you attack them verbally, or put them down in any way. And also, most people are familiar with the libraries that are located on this website, so posting them here is useless. Just post the problem and any error messages you might get, and most people can figure out what went wrong. If not, they will ask you for code. Then try to post only what you think is relevant to the problem. If there is something that simply repeats the same lines over and over again, you can probably leave it out. It's not an exact science, but it helps to keep the server space free for those who need the help. Space costs money you know.
In response to Xooxer
I'm not familer with well any of the librarys (besides my own) because I haven't used one in months.
In response to Nadrew
Well, someone would be. And it is a better option than posting the entire thing as he did....
In response to Xooxer
Yes, it annoys me to see a really long code posted in which most of it doesn't matter to the problem, he probably didn't even try to solve the problem before he posted here.

Note to everyone who posts questions
  • Basic tips on posting
    Spend a good hour or two looking in the tutorials, demos, FAQ, and reference before posting a question, and if that doesn't work post the code that is causing the problem (not all of it if is's really long only the code where the problem is occuring) and what the problem is. And after you post don't spend all your time waiting for the answer KEEP LOOKING!! You can save hours by looking and finding opposed to waiting, and don't get mad if your question isn't answered most of us have lifes and don't spend all day on the forums waiting for a question to answer. Some responces can take up to or over a day.
In response to Gouku
Gouku wrote:
i see every one elses post gettin answered but nope not mine and when people say show come code i show it and it makes people go away beucase they are to lazay to read the damn thing and thats it

[Edit] Do not swear here. The next time you do it, you are gone.


I read every post on this message board, and look at it maybe four times a day. Many questions are answered by the time I see them for the first time... THAT'S how fast things USUALLY get answered.

But you know what, by the time I see your posts YOU have already responded to yourself with a ugly bump. I don't help people who bump their messages just because they are too damn impatient for an answer.

So here's my bit of wisdom for you... should help you in almost every area of your life:
When you are asking for a handout, you are in no position to bargain

Learn it well.
In response to Nadrew
Nadrew wrote:
By teaching you how to code without using a library so you won't get problems that you don't know how to fix because you don't understand how the code works.

I know what you're trying to say, Nadrew, but I should add to this so that newbies don't get the wrong idea about libraries. Libraries are a good thing to use. They allow everyone to reuse working, well-tested code in their own projects without having to reinvent the wheel. This reduces the possibility for bugs (because a widely used library will be tested more than one programmer's private code) and frees the programmer's time to work on more important things (like the guts of his/her game).

That said, it is also important to achieve a certain level of understanding before haphazardly dropping libraries into one's code and expecting them to work. The programmer must not only understand the language, but (s)he must also understand what the library does and how to use it. A good library will take care of the latter part by providing good documentation. The former takes time and patience, slowly building up to the level of proficiency where using libraries is appropriate.

I know Deadron's libraries are well documented with easy to follow examples. Yet there are questions nearly every day about why his character handling library "doesn't work." It does work, the programmer was just too lazy to understand how to use it, and often on a more fundamental level, how to use libraries in general or DM itself.

These people have basically jumped in too quickly, too far, trying to walk before they can crawl in DM (how's that for mixed metaphors). It becomes tiresome trying to help them because they want a quick fix ("make it work") rather than the understanding that allows them to do it themselves. And thus the bad newbie syndrome rears its ugly head once again, but perhaps on the most frustrating level for those of us who want to help. So we're less than enthusiastic about responding at all to posts like Gouku's. And his response to our lack of response didn't help any, as others already pointed out.