ID:155515
 
I am wanting to create a stat panel where it shows the cards from a certain set. for example:

obj/cards/Set1
obj/cards/Set2


if I only want to list something in the stat panel that is only under Set1 but I don't want it to list anything underset 2. How can I list only one thing that is only under Set1 without putting it in the game so it only shows in the stat panel and nowhere else.

Also, if this is possible, can you change the direction of the icon instead of putting it in the game?
<<Bumped>>


And Edited.
In response to AnimeDuelist9
.
In response to Kenpachi12
proc
Set_Check(var/Card/C,var/set)
if(C.set==set && C)
return 1


You just checked for the Card -after- checking its variable. You'll get runtimes like that.

EDIT: Also, that's not a datum

EDIT: Another thing; if you add a variable to a certain object type, that doesn't add the variable to all objects...

obj
apple
var/color
orange; color = "orange"


Making a datum with the parent_type /obj is the same thing as making a branch of the object type...

obj
apple

/// is the same as

apple
parent_type=/obj


Also, the set variable, (I'm not a Yugi-Oh fan), but shouldn't it be a list? What if a card belongs to more than one set? (again, I've never played Yugi-Oh, I wouldn't know, but I'm quite certain it can)



EDIT: (omg, everytime I read your post over I see more errors that will likely impregnate his code with more problems)

set is a reserved term; you can't use it, the variable would have to be _set or SET or Set or something

type is a built-in variable, ALL objects have it, even lists, savefiles, and so on.

Description is already a variable that /objs have, if anything you're giving him more variables than he already had; which is the opposite intention of what you posted.



In response to Kenpachi12
You're not making datums there, Kenpachi.
Card
parent_type=/obj/


By stating that its parent_type is /obj, it will inherit all the variables of type /obj;
just like its children /obj/Card/x will inherit all variables of its parent_type /obj/Card.

A datum has no explicit parent_type.
In response to Gooseheadeded
A datum is the parent of atoms, which means any atom is a datum ;).
In response to Nadrew
Nadrew wrote:
A datum is the parent of atoms


"The datum object is the ancestor of all other data types in DM. " -DM Reference

Nadrew wrote:
which means any atom is a datum ;).

How?
Atoms are not the parents of atoms. And also, a datum is basically in its simplest, a type that has no parent (that can be accessed in DM).

"When you define a new "top level" object, if you do not specify a parent_type, it defaults to /datum. " - DM Reference

He specified a parent_type, /obj, therefore it is not a /datum.


In response to Ill Im
Your first statement basically said exactly what I said. Datums are the parent (ancestor) of all data types in DM. /atom is a data type. All an /atom is is a /datum with more variables and procs defined.

/datum
/atom
/turf
/area
/movable
/obj
/mob


Everything under /datum is a datum at heart, it just has more stuff defined for it. This includes /obj.

That's how inheritance works.