ID:1860631
 
(See the best response by Maximus_Alex2003.)
Code:
obj/perk
Click()
if(src in usr.contents)
if(usr.Viewingperk)
usr << output ("Close your open perk window first!","Sayout")
return
src
usr << output("<center><b>[src.name]</b><br><br>[src.desc]</center>","Perkwindow.Perkout")
winset(usr,"Perkwindow","is-visible=true")
winset(usr, "Perkwindow.Show","is-visible=true")


Problem description: This Click() proc is used for specific perk obj's further down the obj/perk tree. But anyway what this does is shows a small window where it has the name and description of the perk (think of it as a Yugioh card if you'd like) the usr clicks. Problem with this is that it displays the [name] and [desc] in an output control, and other players will also have perks (or "cards") that will be displayed in the same output box if they click it. It would be annoying to be reading your perk when a second later Jimmy wants to read his perk so the [name] and [desc] of his perk replaces yours.

I want a "card" effect, so to speak, where if you click your perk you can read it's description in the window. If someone else clicks their perk to read it, it shouldn't effect the viewing of yours. Maybe I shouldn't use an output control to display text?

Any help?
Best response
Unless you're outputting the name and desc specifically to multiple clients or to the world, outputting or winset() buttons, labels, outputs, etc. are client-specific and setting name and desc for me wont be the same for setting name and desc for you.

Just strictly output to the specific player like you already are with
usr << output("<center><b>[src.name]</b><br><br>[src.desc]</center>","Perkwindow.Perkout"
and
winset(usr,"Perkwindow","is-visible=true")
In response to Maximus_Alex2003
Maximus_Alex2003 wrote:
Unless you're outputting the name and desc specifically to multiple clients or to the world, outputting or winset() buttons, labels, outputs, etc. are client-specific and setting name and desc for me wont be the same for setting name and desc for you.

Just strictly output to the specific player like you already are with
usr << output("<center><b>[src.name]</b><br><br>[src.desc]</center>","Perkwindow.Perkout"
and
winset(usr,"Perkwindow","is-visible=true")


A lightbulb just turned on over my head after reading your response. That's why we tend to put "for(var/mob/M in [world, hearers, etc])" before an OOC or say post. Damn I need sleep. Thanks again dude.
In response to Oleic
No problem.

You can always replace sleep with coffee.
Actually...for OOC, you don't need for(var/mob/M in world)
You usually just use world instead of usr or src:
world<< output("Text goes here","windowname.outputname"


In response to Kidpaddle45
Kidpaddle45 wrote:
Actually...for OOC, you don't need for(var/mob/M in world)
You usually just use world instead of usr or src:
> world<< output("Text goes here","windowname.outputname"
>


Ah, right. That's very true.