ID:158345
 
So basically I'm wondering:

1. If there are more than one type of the same card, and I want to be able to pick each individual card, how would I do so? Ex:

obj
card

mob
var/list/deck=new
verb
pick_card()
var/obj/card/picked=input("Select a card") in deck
world<<"You picked [picked]!"


If I have more than one of "card", it still only displays the one and only, and not the rest.


2. Furthmore, leading off of point one, the reason I am paticular about this is because each card has it's own individual variables... Ex:

obj
card
var
this_card_is_happy
information

I'm wondering if there's a way for the input to not only display the cards individually, but also if it would be possible for it to have in parenthesis beside it; the information and happy variable, for example. Like this:

input("Choose") in deck and then put the information beside it.


Or if there was a simple way to do this through windows (which I have absolutely zero experience with...), which in the long run is what I want anyways.


Any ideas?

EDIT: I've tried this so far, to add information to the input box, and perhaps make it so that more than one of the same type will appear on the input:

        make_deck()
var/list/card_inf=new
for(var/a in pack)
var/obj/new_a=new a
card_inf += new_a
card_inf[card_inf.len] += "[a.information]"
var/obj/X=input("What cards would you like to add?","Add") in card_inf
deck+=X
Of course, it doesn't work. Is there a way to do it through browsers, or something? It would be way more appreciated if there was a way to accomplish this in a way that the browser can display the information on each of the cards in the list.
In response to Speedro
I've posted a solution to something similar to this here: [link]
In response to Garthor
That's excellent, any ideas how I would go about accomplishing this with the interface? I don't understand how I can have variables and lists in the interface. I've read the Interface guide several times...
In response to Speedro
If you are going to be using an interface control to select from this, then you'd be using a grid control and there really wouldn't be an issue because that can display multiples just fine.
In response to Garthor
Ok, would this be able to display information on the card as well, particular to that card (such as variables etc)?

I know next to nothing about interfaces and am unsure of how to give an interface a variable.
In response to Speedro
The grid would only be able to display the object. I think it may display the object's suffix, so you'd have to embed any important statistics in that or the object's name. Or, create a new object just for the interface with that data in its name / suffix.
In response to Garthor
Garthor wrote:
The grid would only be able to display the object.

That only goes for the specific cell holding the object. A grid is a free-form control and you can have any number of cells you want with all kinds of info or data in them, so there's no issue with displaying the extra attributes he wants in cells next to the one showing the icon; no dummy objects needed.
In response to Kaioken
Ok. I don't know how to send information to the interface though. Is there a demo, or simple guide to explain it?


Kaioken, a few years ago when I was just starting out, you made a beam demo in response to one of my posts, maybe you could do it again! ;) No, but really, thanks for that- even though of course it was for everyone :p Off topic for just one more second, why haven't you made any games or something? You've been here for years, very experienced, yet only one demo.

Thanks- haha.

In response to Speedro
Use the forum search. You can type in "author:[ckey]" to search for posts from a specific person, in addition to any other parameters.
In response to Speedro
Speedro wrote:
Ok. I don't know how to send information to the interface though. Is there a demo, or simple guide to explain it?

-The DM Reference on the interface procs (winset(), winget(), winclone(), [winshow()]).
-The Skin Reference.
-Lummox JR's series of Dream Maker articles on skins (note: in DM, skin is a synonym for interface).

Kaioken, a few years ago when I was just starting out, you made a beam demo in response to one of my posts, maybe you could do it again! ;) [...]

If you had looked a bit you'd have seen that it's actually still available on my member page intact, just as it was then (though I've made a few better versions since that I need to get around to polishing and uploading). There are too many comments in the old one, but I guess that doesn't bother you.

Off topic for just one more second, why haven't you made any games or something? You've been here for years, very experienced, yet only one demo.

Probably lack of motivation to work on a big project for a lot of time, among other things. I'm also somewhat demotivated to make more demos and libraries since the result of that could be pretty counterproductive (newbies simply copy-pasting code from them instead of learning, only making the situation worse).