ID:148288
 
In this coding there are no errors...but there is a problem...when u click it it doesn't do anything..so here's the coding...
turf/Create/creating_character/Click()

if (istype(usr,/mob/creating_character))
return 1
// else
//Whoops, not a creating character mob
world.log << "[usr] clicked on [src] but is not a create_character mob"
return 0
turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
mob/creating_character

Login()
..()
src.loc=locate(37,27,1)
world << "[usr] has just entered '[world.name]'!"
usr.sight = 1
/proc/NewChar()
var/char_name
while(!char_name)

var/mob/new_mob
char_name = input("Please put your character name in here.","Name") as null|text

var/char = input(src,"Pick your character!") in list("Half-Demon","Human","Demon")
switch(char)
if("Half-Demon")
new_mob = new /mob/player/HalfDemon/InuYasha
new_mob.energylevel = 10
new_mob.maxenergylevel = 10
new_mob.maxstamina = 100
new_mob.purity = 2
new_mob.will = 5
new_mob.honor = 3
I got more coding too but this is all you will probably need now...
YamiGotenks wrote:
In this coding there are no errors...but there is a problem...when u click it it doesn't do anything..so here's the coding...
turf/Create/creating_character/Click()

if (istype(usr,/mob/creating_character))
return 1
// else
//Whoops, not a creating character mob
world.log << "[usr] clicked on [src] but is not a create_character mob"
return 0

It doesn't do anything because instead of calling usr.NewChar(), you called "return 1". The istype() check is true, so the next line that gets run is the return line, and thus nothing else ever happens.

turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1

Notice this turf is a different type than the one above. This type is /turf/Create/creating_character/NewCharacter. The other one is /turf/Create/creating_character. I'm not sure which one you have on your map. If you make the necessary corrections to the earlier proc, then this Click() you can just eliminate altogether.

mob/creating_character

Login()
..()
src.loc=locate(37,27,1)
world << "[usr] has just entered '[world.name]'!"
usr.sight = 1

It's a good idea to be consistent with usr and src here, even though in this case they should be the same. I'd just use src.

/proc/NewChar()
var/char_name
while(!char_name)

var/mob/new_mob
char_name = input("Please put your character name in here.","Name") as null|text

You have two problems here. First, the /proc/NewChar() line is not tabbed correctly. If you take a closer look you'll see it's preceded by spaces, not tables.

Second, you haven't indented anything under while(), like I told you about six zillion times this weekend. Every time you asked what was wrong, I told you you needed to indent certain lines. Why haven't you? The char_name=input(...) line has to be indented to be part of the while() loop.

The var/mob/new_mob line should go before or after the while() loop, and shouldn't be inside it, so that will have to be moved.

Lastly, I implore you again not to just keep creating new threads left and right. The next time you have a problem, find one of your existing threads, and post on that.

Lummox JR
In response to Lummox JR
Well i did all your options and it still doesn't do anything...what do i do now?
In response to YamiGotenks
YamiGotenks wrote:
Well i did all your options and it still doesn't do anything...what do i do now?

For starters you have to stop trying stuff, then saying it doesn't work without showing what you tried. With some people that would work out, but time and again--I mean no offense--you just haven't done what someone told you to do, or you've done it wrong. So I can't really be certain you've done what I told you to try until I see the updated code.

Lummox JR
In response to Lummox JR
i indended like u told me to but i don't no if i did anythin wrong..
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()
var/mob/new_mob
var/char_name
while(!char_name)

//We are declaring a new variable called "new_mob" which will be used in alittle minute
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
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
In response to YamiGotenks
YamiGotenks wrote:
i indended like u told me to but i don't no if i did anythin wrong..
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()
var/mob/new_mob
var/char_name
while(!char_name)

//We are declaring a new variable called "new_mob" which will be used in alittle minute
char_name = input("Please put your character name in here.","Name") as null|text //The player makes their name here

Okay, that section looks good now. But what about the turfs that were in your first post on this thread? What's the situation with those?

Lummox JR
In response to Lummox JR
turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
This is the coding for the turfs...
In response to YamiGotenks
YamiGotenks wrote:
turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
This is the coding for the turfs...

What about the code for turf/Create/creating_character that was in the beginning of that first post? The Click() proc you had there needed to go.

Lummox JR
In response to Lummox JR
Here's more of the code:
turf/Title
layer = MOB_LAYER+149
icon = 'inuyashatitle.bmp'
density = 1

//client/Click()
turf/Create/creating_character/Click()

if (istype(usr,/mob/creating_character))
return 1
// else
//Whoops, not a creating character mob
world.log << "[usr] clicked on [src] but is not a create_character mob"
return 0


/*turf/Create/creating_character/NewChar
layer = MOB_LAYER+150
// NewChar
icon = 'create.bmp'
Click()
var/result= ..()
if (result)
usr:NewChar()
density = 1*/
turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
In response to YamiGotenks
YamiGotenks wrote:
turf/Create/creating_character/Click()

if (istype(usr,/mob/creating_character))
return 1
// else
//Whoops, not a creating character mob
world.log << "[usr] clicked on [src] but is not a create_character mob"
return 0

This entire segment needs to be deleted.

Lummox JR
In response to Lummox JR
I deleted it now what do i do?
In response to YamiGotenks
Here is my most recent coding, the problem is that when you click Create, it doesn't do anything!
mob
usr.Login()
world << "Welcome to InuYasha! This is Version 3.Created by YamiGotenks. Icons by:me,Dante1,Calm Storm, Donation System by Sariat"



turf/Title
layer = MOB_LAYER+149
icon = 'inuyashatitle.bmp'
density = 1
world
mob = /mob/creating_character
view = 6
name = "InuYasha Version 3"
hub = "YamiGotenks.InuYasha"

// turf = /turf/turfs

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()
var/mob/new_mob
var/char_name
while(!char_name)

//We are declaring a new variable called "new_mob" which will be used in alittle minute
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
new_mob.name = char_name (my tab isn't working right...)
new_mob.loc = locate(27,6,1)
mob/proc/NewChar()
mob/proc/Load()
In response to YamiGotenks
That doesn't include your Click() proc. Remember what I said about posting all the relevant sections? You have to post more than just one part of your code; you need to post the other parts that are related. Click() is pretty darn important when you're having a Click() problem.

I did notice for the first time (because you haven't posted it before) that after your NewChar() proc you have another line:
mob/proc/NewChar()
Get rid of that line.

And the line that does belong there, the /proc/NewChar() line, should not have a slash in front of it.

At last I'm starting to see what probably went wrong. There were enough other issues with other pieces of code that they looked like they could be complicating factors, but until now I didn't see one obvious cause. I think what happened is that when you put in the extra slash on proc/NewChar(), DM thought you meant NewChar() as a global proc, not a mob/creating_character proc. When you got an undefined proc error, it didn't occur to you to double-check the line that said /proc/NewChar(), so you put in a line all by itself that said mob/proc/NewChar(). (And you later did the same thing with mob/proc/Load(). That line has to go too.)

The main problem all along is that you haven't really been trying to understand the code as you go along. Someone tells you to do something, you say you did, but you don't; and this has to happen about a dozen times in some cases. You get an error and you just randomly try things instead of focusing on what it might mean. And when you post code, it's incomplete; you post a piece of code, not all of the pieces that are related. Case in point: Tonight is the first time I've seen the mob/proc/NewChar() line, and it looks now like it was central to your problem all along.

I've been looking at your code through a kaleidoscope this whole time. If you'd posted a more complete picture in the first place, a lot of hassle could have been avoided.

Lummox JR
In response to Lummox JR
now it has undefined proc, i'm a newb at this ( u can tell) and this the the coding i got for click() i have no clue if it has the part u want but i thopught i might as well try..

client/Click()

pretty small huh...lol
don't no if that's the click() proc
In response to YamiGotenks
YamiGotenks wrote:
now it has undefined proc, i'm a newb at this ( u can tell) and this the the coding i got for click() i have no clue if it has the part u want but i thopught i might as well try..

Stop. This is the problem. You don't listen to all of what people tell you, and instead of going back to check, you ignore it. Then you get an error because you only followed half of their advice, and you try some random thing.

client/Click()

pretty small huh...lol
don't no if that's the click() proc

This has nothing to do with your problem. Do not try random solutions. Read what people say.

I told you two things to change in that last post, not just one. The two things I told you to fix:

  • Delete the line that said mob/proc/NewChar() (and the one after it for Load()).
  • Remove the slash in front of proc/NewChar() on the line that begins the proc itself.

    You didn't do the second thing. If you had, you wouldn't have had an undefined proc error.

    You also did another thing I've talked to you about several times. Whenever you make a change, you almost never post the code you changed to show what you did differently. If you do that, people can make comparisons. And that's important because you only ever make about half the changes anyone tells you to. And when you encounter a problem with that, you don't go back to reread what they said to make sure you did exactly what they said; instead you just go off and try things totally at random, like this client/Click() nonsense.

    Please don't take this the wrong way; I don't mean to be harsh here. But nobody can help you if you only pay attention 20% of the time, and then only poorly. You have to listen to what I say, not just skim it and nod and go off and make a half-baked attempt. When you have a problem, do the following things that I've told you each several (or many) times before:
  • Post the relevant code, always. In this case that meant not only the NewChar() proc, and the Click() procs for your buttons, but also the other line that you deleted (the mob/proc/NewChar() line). It's better to err on the side of posting too much code than too little; obviously no one needs to see your whole game, but you only showed small pieces at a time. It was like trying to see your code through a keyhole--I only saw the real problem tonight because you never showed a very important line until now. Nobody can help you this way. Post all the relevant code, and do it consistently; don't post one section today, another tomorrow, and a new one the day after that.
  • Whenever you make a change, post the same sections of code to show what you changed. This is vital. It's about ten times as vital in your case because you never make all the changes you need to; you make one or two at most and then stop. Then you tell us you did everything, even though you didn't, but you don't post the code so we can see you didn't.
  • If something isn't working out for you, go back and reread to make sure you got it right. Do NOT just try random stuff. All that does is make the problem worse: You introduce brand new bugs, which require more changes that you never get around to making, and half the time you don't show those sections so we can't tell you did anything else. Trying random stuff is what caused this whole problem in the first place: You made a syntax error (the / in front of proc/NewChar()) that gave you a message you didn't understand, and you tried a random solution for it; lo and behold it compiled, but it didn't work right, all because you tried something without really looking. Instead you should have asked the question: "Why does it say 'undefined proc' if it's right there?" If you'd asked that on the forums first we'd have had a good answer for you; if you'd just taken a close look at the line where NewChar() is defined you probably would have realized (given time of course) that the / didn't belong there.

    Finally, and this is very key:
  • Actually try to understand what you're doing. It doesn't look to me like you're doing that at all. I've seen people put in an effort on code they have trouble understanding, and this isn't it. You're not making that effort. You're just doing one or two things at a time, wrongly, and then doing one or two things on top of that that are even worse, and then you come back for help but you don't even take the time to ask for help in a constructive way by giving people the details they need. So far you haven't been trying to understand what you're doing; you're just putting in code blindly.

    There's a scene in UHF that goes like that: A blind man turns a Rubik's Cube and says to the guy next to him, "Is this it?" And the other guy says, "Nope!" Over and over. That's what you're doing here. If you want to solve the problem, take the time to look at it.

    I hope this doesn't discourage you; my point is to encourage you, to code with both eyes open. Doing it blindly as you have been, you're only wasting your time and ours. But if you actually apply yourself to figure out what's going on, you'll spot problems quicker and be a lot less frustrated.

    Lummox JR
In response to Lummox JR
I deleted both NewChar and Load Proc things
Yea i no u are encouraging me but here is the new code...
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()
var/mob/new_mob
var/char_name
while(!char_name)
then the other stuff...(choosing which guy u wanna be)
In response to YamiGotenks
Well, you at least posted the changed line, so I guess that's something. I didn't think you had changed it, because the error didn't seem to make sense if the Click() proc was right.

Which means the error is probably now in your Click() proc, which you didn't post. Post Click(), and all of NewChar(). They're both important to this.

Lummox JR
In response to Lummox JR
mob/creating_character
proc/NewChar()
var/mob/new_mob
var/char_name
while(!char_name)

//We are declaring a new variable called "new_mob" which will be used in alittle minute
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
client/click
turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
i no the proc/NewChar spacing isn't right... my tab is screwed up I think that's the click() thing...
In response to YamiGotenks
YamiGotenks wrote:
client/click

This line can be deleted.

turf/Create/creating_character
layer = MOB_LAYER+150
NewCharacter
icon = 'create.bmp'
Click() usr.NewChar()
density = 1
LoadCharacter
icon = 'load.bmp'
// icon_state = "create"
Click() usr.Load()
density = 1
i no the proc/NewChar spacing isn't right... my tab is screwed up I think that's the click() thing...

The spacing of that proc/NewChar() line should be changed then; it might be part of the problem. Use Ctrl+T to see the tabs, and then you can remove any spaces that don't belong there. (Or just unindent the entire line, then indent it to where it should be.)

I think the reason you're seeing an undefined proc error though is this:
Click() usr.NewChar()
I understand where this would be confusing because the way you're using it, NewChar() is a valid proc for usr because usr should only be a /mob/creating_character type when that button is clicked. The reason is, usr is considered an ordinary /mob type by DM. I'd recommend changing the Click() proc for that button to this:
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()
Do something similar for the load button.

If you fix both of those I believe this should work out for you. The undefined proc error will go away. The Click() not working should have already been resolved by deleting that line you got rid of earlier.

Lummox JR
In response to Lummox JR
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):
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
THE MAIN PROBLEM IS THAT THE NEWCHAR CODING AND THE CREATE BUTTON DON'T "COMMUNICATE" SO TO SAY.

icon = 'create.bmp'
Page: 1 2