ID:180637
 
how do I set objects icon_state to a randomly selected one?
when they are created (New())
On 4/22/01 11:20 am Kaidorin wrote:
how do I set objects icon_state to a randomly selected one?
when they are created (New())

Right now there is no programmatic way to know what the icon states are.

So you need to create a list of the icon states for an object, then use pick() to select one randomly.
In response to Deadron
I found a better way :)

the obj in question is an asteroid with 10 different states named 1-10. I use this:

New()
icon_state = num2text(roll(10))

it works, but only when the icon_states names are numbers. but that is probably the only time I want random states
In response to Kaidorin
On 4/22/01 11:45 am Kaidorin wrote:
I found a better way :)

Well, not really a better way. Just a different way, until we get an icon_states() proc.

(I use that method too. =)