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...
1
2
ID:148288
Apr 21 2003, 1:08 am
|
|
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.. 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 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() 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()
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() 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:
|
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 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() Click() 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' |
1
2
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.
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.
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.
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