ID:270086
 
Ok, can someone help me a login click proc.
The only part i really need help with a the caharcter lcick part, can someone show me a demo taht will help me with that or you can give me peice of the code to help me out either way is good, Thanks
Huh? You didn't even tell us what you're trying to do. You have to tell us what you want to do so we can help you.
In response to Pyro_dragons
Well, when i login in i want to be able to click on a character that appers on the screen and when you click the character you become that character in the game.
You think you understand.
In response to Sayian Hunter
You'll need to make world/mob a type of 'placeholder mob' they use while making a new character, override placeholdermob/New() (Remember to use ..()!) in such a way that you get the menu with character icon thingies in them, and use client/Click() to determine what character thing the player has clicked. You then just need to make a new mob, of a type dependent upon what was clicked, and set that mobs key to the client's key.

Simple. :P
In response to Jp
Turf, mob, atoms, and objects all have Click() for a reason.
mob
Choice1
icon=...
icon_state=...
Click()
var/mob/Choice1/New_Mob=new(usr.loc)
usr.client.mob=New_Mob
...
Choice2
icon=...
icon_state=...
Click()
var/mob/Choice1/New_Mob=new(usr.loc)
usr.client.mob=New_Mob
... //Now lets see that in client/Click()
mob
Choice1
icon=...
icon_state=...
Choice2
icon=...
icon_state=...
client/Click()
if(istype(src,/mob/Choice1/))
var/mob/Choice1/New_Mob=new(mob.loc)
mob.client.mob=New_Mob
else if(istype(src,/mob/Choice1/))
var/mob/Choice2/New_Mob=new(mob.loc)
mob.client.mob=New_Mob
..()


Now, I'm damn sure that is is bad design when using client/Click() as you've mentioned.
In response to Cheetoz
But then you have problems if the mobs that they're going to be clicking on are the same type as the ones they're becoming.

I'd do it like this:

client/Click(var/atom/a)
if(!ismob(a)) return
var/mob/m=a
if(mob.type=="/mob/creating")
m=new m.type
m.key=key


Not difficult. AFAIK, that isn't particularly bad design. :P
In response to Jp
Well, *cough* that is why god(BYOND) has such usefull checks as

if(src!=usr) or if(src==usr)



Becomming the same mob really isn't problem, but another check could be done to prevent that too if you were concerned.
In response to Cheetoz
I think it's better to overwrite client/Click() in this situation. Or better yet...

client/Click(atom/a)
mob.Clicking(a)

mob/proc/Clicking(atom/a)
ASSERT(src==usr) //Paranoia. If they aren't, something has gone wrong with the force...
src << "You clicked [a]!"


Then you define mob/Creating/Clicking() in such a way that it selects things, and everything is fine and dandy.

(I'm more worried with clicking other players once you finish the selection process thingy, incidentally)
In response to Jp
I'm just going to eat this one and ask we call it quits, which I don't do often, because we are going back and forth about a Click().