#Skills

1 messages · Page 1 of 1 (latest)

terse brook
#

So you want to be able to add a random component from a list of skills?

#

@tribal nimbus

tribal nimbus
#

Hi there, thanks for messaging 🙂

#

Yea thats basically what I want to do. I know how to add components and stuff, the only thing im stuck with is to get them in a list / dictionary / whatever where I can add them to the game object after being randomly selected without instantiating them.

terse brook
tribal nimbus
#

Let me give you a little more perspective

#

I'm actually working on a little "hospital" simulator for practing and dealing with (patients) illnesses instead of skills. Each illness has a chance to randomly add another illness to the patients, just like in real life.

terse brook
#

@tribal nimbus oh and I forgot. Someone else was doing something similar a couple days ago, using strings to map to components. Might be worth to check out

tribal nimbus
#

Let me try real quick

#

Yea I guess I got it working

#

Thanks for your assistance. I wonder if that's the best way tho lol

terse brook
#

@tribal nimbus is that kind of what you were looking for?

tribal nimbus
#

Well wouldn’t that only work if the scripts are actually attached to the game object to begin with?

terse brook
#

Oh they aren’t?

#

Hmm

tribal nimbus
#

No the gameobject spawns with like 1 to 3 diseases and each of these have a random chance of adding a new „follow up“ disease to the game object which I can now define on each illness thanks to your support. Maybe I’ll find I better way but it certainly works for now 🙂 thank you