ID:139992
 
Code:
turf/charcreation
cNew/Click()if(istype(usr,/mob/charactermenu))usr.NewCharacter()
cDelete/Click()if(istype(usr,/mob/charactermenu))usr.delchar()
cLoad/Click()if(istype(usr,/mob/charactermenu))usr.loadchar()


Problem description:

The problem is the turfs wont call the proc? I already looked up mouse_opacity var but I dont really understand. Help please.
I dont quite get the point of the charactermenu thing in there.

but simply indenting the newcharacter proc should technically just run the proc as needed.

But i could be wrong
In response to Midgetbuster
I tryed indenting it doesnt work, it's just the turf cNew ontop of the title screen wont click to call the proc. I'm used to programming on the older versions of BYOND alot has changed.. (edit)
I dont know he used it here:
world
mob=/mob/charactermenu


and he called it before login() I dont know why its pointless.
Instead of telling you the solution, I'll help you to help yourself and find the problem by yourself (which should enable you to do that for any further such issue in the future).

Add debugging output (When an event/procedure/important point in your program is reached, send a little descriptive message to 'world', including the current status of important variables (such as 'usr', and it's type in this case).
Then compare the results with what you had expected.
In response to Schnitzelnagler
edit: i know what you mean but not when to use it i've never tryed this or dont know when to use it help please
world << "debugging output")


In response to Godz
try using objects as what you're clicking, make sure mouse opacity is set to 2, and then make sure it has a layer higher than any other object, as it could be blocked by another one of your icons.

In response to Godz
turf
charcreation
cNew
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.NewCharacter()
cDelete
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.delchar()
cLoad
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.loadchar()


Now, you can see right where something fails and act accordingly.
In response to Schnitzelnagler
More helpful would be putting something in client/Click():

client/Click(atom/A)
world << "[usr] ([usr.type]) clicked [A] ([A.type])"
..()
In response to Garthor
I wanted to advise that in the next step, to increase the learning effect, but, gah :/
In response to Schnitzelnagler
I can pick up quick if we can actually get down to my problem, i'm just getting use to this newer BYOND.

 turf/charcreation
cNew
client/Click(atom/A)
if(istype(usr,/mob/charactermenu))
world << "[usr] ([usr.type]) clicked [A] ([A.type])"
usr.NewCharacter()
..()
cDelete
client/Click(atom/A)
if(istype(usr,/mob/charactermenu))
world << "[usr] ([usr.type]) clicked [A] ([A.type])"
usr.delchar()
..()
cLoad
client/Click(atom/A)
if(istype(usr,/mob/charactermenu))
world << "[usr] ([usr.type]) clicked [A] ([A.type])"
usr.loadchar()
..()


The turf still can't be clicked, it's like its not even there.
In response to Bravo1
I've tryed it as an object it still doesnt work like before, and not only that i've been getting some weird on screeen stuff like the title gets overlayered multiple times and all you can see is 20 title screens.
In response to Godz
if that's the case, then you need to delete the old title screen, and replace it with the same type of object.(In the map editor)

I'm going to assume that your game was previously built with an older version of BYOND, and if that is the case, an alternative method to the one I posted above would be to add this into your source.
world/map_format = TILED_ICON_MAP


This will set it back to the "older" style of how maps are handled, you will however lose the support for big icons.
In response to Godz
Godz wrote:
I can pick up quick if we can actually get down to my problem, i'm just getting use to this newer BYOND.

There is nothing different 'BYOND version wise', that would cause your issue. You have a problem understanding the basics of the language, as your code snippet shows rather clearly.

What Garthor suggested was the following:

client/Click(atom/A)
world << "[usr] ([usr.type]) clicked [A] ([A.type])"
..()

turf
charcreation
cNew
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.NewCharacter()
cDelete
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.delchar()
cLoad
Click()
world << "[usr.name], of type [usr.type] clicked [name]"
if(istype(usr,/mob/charactermenu))
world << "[usr.name] was decided to derive from /mob/charactermenu"
usr.loadchar()


You'll have to understand how many turfs can be on a tile at any given time and how icon opacity handles determining which object is being clicked.
In response to Axerob
I'm gonna assume the turf that you want to click has no icon and that the layer is the default and it is a from a demo. The title screen is probably on top of the clickable turf, so you might want to make the clickable turf layer 5 and give it a transparent icon or anything you want. And also change your client view,to match the title screen,etc.
In response to RichardKW
Hmm, i tried that and the icon does show over top of title but when I click it I get the debugging information for the title screen and not for the button. =/
In response to Godz
Use the code Axerob provided, and when you apply those turfs, you need to hold the CTRL button while you are putting those turfs on the map.
It should work like that now.
In response to Sokkiejjj
Thank you, thats all I need to know!! -_-;;;;;