ID:150248
 
Ok I've been trying to do this and keep getting all kinds of unexpected results. Could someone show me how I should do this?

I want to fill the desc of a mob with 3 various var
1) PC Name
2) Their Class
3) Their Religion

So when u look in an area and it shows them, it comes back as.
You see:

LJR, Knight(Holy Grail)

Any suggestions?
LJR
Use [] to embed the vars into a text string.

example:

mob
var
description
class


mob/Login()
switch(input("Choose your class")in list("Class one","Class two"))
if("Class one")
src.class = "One"
else
src.class = "Two"
src.description = "[src.name]'s class is [src.class]"


This isn't a very great example but is gives you the idea.
Forget about desc... you could write a proc that would update desc periodically with the information you want, but why?

You're limiting your thinking here... you're thinking, "Desc is the variable that we use to store the information you get when you look at something." Ordinarily, yes, but there's nothing hardcoded (or set in stone) about that... there's no reason you couldn't use the variable desc to hold HP and a variable called HP to store what you get when you look at someone.

More to the point... there's no reason to use a variable to store the dynamic information returned by a proc when you could reference the proc itself. Eliminate the middle person... take a look at this:

mob/proc/Show()
return "[src.name]: [src.class] ([src.religion]"

mob/verb/look()
set src in oview()
view() << "[usr] looks at src."
usr << src.Show()