ID:176170
 
I'm trying to write a code that allows a player to select from a list of icons (the images appearing in the list) for their character. How do I declare an icon (not a mob) so that I can populate the list with them? Or, would I have to make them their own objects and then have the players mob/icon = O.icon?

Okay, little side not here. I have the player selecting from a list of icon_states, but it only provides the text name of the icon state in the list (obviously, that's what in icon_states(O.icon) does). Also, M.icon = *selected icon* doesn't work. The player simply has no icon at all. :( can someone help me?
Why dont you just make a var that stores the name of the icon_state in it? (Im not sure if its possible with icons. but you could make it so like there is. flick(usr,"[usr.class]punch") or something like that.)

So when they login. You store the name of their iconstate in a variable. So it can be used over and over without referring to it harder. Hope this helps. Because I couldn't really understand wat you meant by it.

-GDT
In response to GoodDoggyTreat
Okay, this is what I want. When a player creates a new character, their mob does not have an icon yet. During character creation, they are shown a list of icons (preferably displaying the actual images in the list itself). Once they choose one, that becomes the icon for their mob. The list they will be shown will be different based on previous decisions they make during creation.
In response to Krosse
i don't really know, and i don't know if you figured it out already, but i might as well answer, since i THINK i know...
there's a few ways, i think... i don't think it's possible to actualy select it from a popup list, but you can make it, so you have to click on an icon, to proceed, which would be on a small introduction map, where you're invisible, and cannot speak.
another way, is making a stat panel, and add objects, with the icons, and give these objects a Click() or DblClick() proc, which would continue on with character creation...

i'm not sure if that's what you want, if it isn't, please explain what you want further, and i'll try 'n help... ^_^
uh, aren't you using icon states?
please explain it more, and in a reply...
thanks, i think o.O
In response to Roara
During character creation, players select an age, this is divided into child, teen, adult, elder and ancient. Right now, I have an object that's icon is determined by what age they select

if(src.age == "Teen")
O.icon = 'teen icons.dmi'

then, what I wanted was for that object to appear in a list (or something similar) with all of its different icon_states (there are multiple icon states for each age group). Once they select it, I then make that icon be the characters icon. I have it display in a list as text right now, but I can't get the images to appear.
I haven't worked with click procs too much, but that may be an idea. Any other thoughts?
In response to Krosse
Krosse wrote:
During character creation, players select an age, this is divided into child, teen, adult, elder and ancient. Right now, I have an object that's icon is determined by what age they select

if(src.age == "Teen")
O.icon = 'teen icons.dmi'

then, what I wanted was for that object to appear in a list (or something similar) with all of its different icon_states (there are multiple icon states for each age group). Once they select it, I then make that icon be the characters icon. I have it display in a list as text right now, but I can't get the images to appear.
I haven't worked with click procs too much, but that may be an idea. Any other thoughts?

O.icon_state = input("Which one?") in icon_states(O.icon)


That should do the trick.

~>Volte
In response to Volte
That's essentially what I have. The problem is icon_states(O.icon) returns a text list. I wanted the icon states to be visible.
In response to Krosse
Krosse wrote:
That's essentially what I have. The problem is icon_states(O.icon) returns a text list. I wanted the icon states to be visible.

Lists do not have the ability to display icon states in them to my knowledge. If you want to do that, you should do research on forms.

~>Volte