In response to YamiGotenks
YamiGotenks wrote:
turf/Create/creating_character
layer = MOB_LAYER+150
Click()
// this is called "type-casting"
var/mob/creating_character/M = usr
// this will check to see if M is the type it's supposed to be
if(!istype(M)) return
// it's the right type, so call NewChar().
M.NewChar()
I edited this one because we needed to tell what icon it was( i don't know if i did it right, but the 2nd one looks better):

You did put the code in the right place here. There's a tab problem, though; the lines beneath Click() should be indented beneath it, yet they appear to its left. You have to be careful about mixing spaces and tabs.

BYOND might be interpreting this correctly anyway, if you have as many spaces as you would tabs, but to be safe I'd unindent those lines and re-indent them (with tabs) to put them just past Click().

turf/Create/creating_character/NewChar
layer = MOB_LAYER+150
icon = 'create.bmp'

Click()
// this is called "type-casting"
var/mob/creating_character/M = usr
// this will check to see if M is the type it's supposed to be
if(!istype(M)) return
// it's the right type, so call NewChar().
M.NewChar()
turf/Create/creating_character/NewChar
layer = MOB_LAYER+150

I notice those last two lines are repeated. I wonder if you accidentally have two of the same entry by mistake.

THE MAIN PROBLEM IS THAT THE NEWCHAR CODING AND THE CREATE BUTTON DON'T "COMMUNICATE" SO TO SAY.

There's a way to find this out. In the Click() proc, before you even do the var/mob/creating_character/M=usr line, put in this temporarily:
usr << "Debug: Click() called for [type] successfully."
Then put this line in the very beginning of the mob/NewChar() code (just after the proc/NewChar() line itself, and indented like the lines after it):
usr << "Debug: NewChar() called by Click()."
Having those messages in there will allow you to track the flow of the program.

  • If you see no messages when you click, then something else is interfering with your Click() proc. The button may not be defined as the right type on your map, or you might accidentally have put in a second Click() proc that overrides the one you really want to use.
  • If you see only the first message, then for some reason Click() is not calling NewChar(). Given the code you're using now, that means usr is not a /mob/creating_character, but some other type of mob.
  • If you see both messages, then the problem is somewhere within NewChar(). I think this is unlikely because the very first thing NewChar() does is ask for a name, so you would have seen evidence by now that it was being called.

    Lummox JR
In response to Lummox JR
k i think we're gettig somewhere...the indentation was an error of mine whe i copied/pasted it...The last 2 lines WERE a mistake on the post, don't know why i did that... nad this is debug message i got...

Debug: Click() called for /turf/Create/creating_character/NewChar successfully.

And if you were wondering, this is my fixed code that needed indentation:

turf/Create/creating_character/NewChar
layer = MOB_LAYER+150
icon = 'create.bmp'

Click()
// this is called "type-casting"
usr << "Debug: Click() called for [type] successfully."
var/mob/creating_character/M = usr
// this will check to see if M is the type it's supposed to be
if(!istype(M)) return
// it's the right type, so call NewChar().
M.NewChar()
In response to YamiGotenks
YamiGotenks wrote:
k i think we're gettig somewhere...the indentation was an error of mine whe i copied/pasted it...The last 2 lines WERE a mistake on the post, don't know why i did that... nad this is debug message i got...

Debug: Click() called for /turf/Create/creating_character/NewChar successfully.

And if you were wondering, this is my fixed code that needed indentation:

Excellent. We definitely are making progress.

Assuming the other debug message is in the beginning of mob/NewChar() (before var/char_name and all that), then the problem must be somewhere in here:
        Click()
usr << "Debug: Click() called for [type] successfully."
var/mob/creating_character/M = usr
// for some reason, this line is where it's failing
if(!istype(M)) return
M.NewChar()
So usr is apparently not a /mob/creating_character type. (Again, I'm assuming the other debug message is in place.) But that puzzles me, because of this in your code:
world
mob = /mob/creating_character
So after the first debug message, which says Click() was called, I'd add this:
usr << "Debug: usr is type [usr.type]"
Let's see what that yields.

Also if you could post the mob/NewChar() proc and both your Login() procs as they stand now, that would help.

Lummox JR
In response to Lummox JR
This is the new debug message:
Debug: Click() called for /turf/Create/creating_character/NewChar successfully.
Debug: usr is type /mob/DM

Here is the Login and NewChar codes:

mob/Login()
src.loc=locate(7,7,10)
src.energylevel = src.maxenergylevel

mob/creating_character

Login()
..()
src.loc=locate(37,27,1)
world << "[usr] has just entered '[world.name]'!"
usr.sight = 1
//src.Create() //This tells the src to lookup "CreateCharacter"

proc/NewChar()
usr << "Debug: NewChar() called by Click()."
var/mob/new_mob
var/char_name
while(!char_name)


char_name = input("Please put your character name in here.","Name") as null|text //The player makes their name here

var/char = input(src,"Pick your character!") in list("Half-Demon","Human","Demon") //The player chooses his/her character here
switch(char)
if("Half-Demon")
new_mob = new /mob/player/HalfDemon/InuYasha //Looking up the path "/mob/player/human"
new_mob.energylevel = 10
new_mob.maxenergylevel = 10
new_mob.maxstamina = 100
new_mob.purity = 2
new_mob.will = 5
new_mob.honor = 3
if("Human")
new_mob = new /mob/player/Human/Kagome //Looking up the path "/mob/player/monkey"
new_mob.energylevel = 5
new_mob.maxenergylevel = 5
new_mob.maxstamina = 100
new_mob.will = 5
new_mob.honor = 5
new_mob.purity = 5
if("Demon")
new_mob = new /mob/player/Demon/Naraku
new_mob.energylevel = 50
new_mob.maxenergylevel = 50
new_mob.maxstamina = 100
new_mob.will = 5
new_mob.honor = 5
new_mob.purity = 1
Also the
world
mob = /mob/creating_character
thing is included with the view and the games name see:
world
mob = /mob/creating_character
view = 6
name = "InuYasha Version 3"
hub = "YamiGotenks.InuYasha"
In response to YamiGotenks
YamiGotenks wrote:
This is the new debug message:
Debug: Click() called for /turf/Create/creating_character/NewChar successfully.
Debug: usr is type /mob/DM

Bingo!
This is real progress. You've just established that usr is not the type it's supposed to be.

I have a guess: There's a mob somewhere on your map, of type /mob/DM. If there is you're going ot have to find it and delete it. (The best way to see where it is is to open up your map file in a text editor, and search for /mob/DM. Remove that item from the list of things you see there.)

If there is no such mob on your map, or you've deleted it, then you need to search all your files for DM. Wherever you find mob/DM defined, or created manually, show me those pieces of code.

Lummox JR
In response to Lummox JR
This is the only mob/DM i found

#define MASTER_KEY "YamiGotenks"
mob/DM
key = MASTER_KEY
In response to YamiGotenks
YamiGotenks wrote:
This is the only mob/DM i found

#define MASTER_KEY "YamiGotenks"
mob/DM
key = MASTER_KEY

That's the problem right there. When you log on, a type of mob with your key is found, so the game assigns that mob type to you instead of the standard world.mob value. If you delete this that problem should vanish.

If you were hoping to use this to do admin stuff, that would be easier to handle in mob/Login() anyway.
mob/Login()
... // your existing code would go here, the src=loate(...) stuff
if(client.ckey == "yamigotenks")
verbs += typesof(/mob/admin/verb)

mob/admin
// define admin verbs here

Lummox JR
In response to Lummox JR
I deleted that coding...and now the scren is COMPLETELY BLACK...i try to use a GM Teleport verb but the screen is still black...Plz respond to tell me what coding you need to see...
In response to YamiGotenks
..()
In response to FeLeS_CeLeR
where would i put that? On the bottom of the login code?
In response to YamiGotenks
When i create a new character, the character doesn't go anywhere... this is the message i got....Debug: new_mob is /mob/player/HalfDemon/InuYasha, at 0,0,0...sorry i didn't give much info but i gtg bye
Page: 1 2