How do I create Dynamic / Random actors?

TitamTitam Member Posts: 20
edited June 2012 in Tech Support
Hello there,

I search but I don't find so... I'm asking you ^^
I would like that, when a scene is generated, it chooses "randomly" 4 elements (actors) in a pull of 10 elements available, and the same behavior when the scene is reset.

I don't have ideas on how I could do that... your help will be appreciated again ^^

Thanks

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    @Titam

    make a blank table … name it: TB-use … or something else

    at start of each scene:
    on an actor:
    add Copy Table (the Behavior) … copy originalTable to that TB-use

    do your code work referencing TB-use … not the original

    image MH

Answers

  • TitamTitam Member Posts: 20
    Hi, I'll test that if I can do everything you say ^^ ahah !
    Thanks,
    Keep you posted.
  • TitamTitam Member Posts: 20

    add/remove table row
    table, row )game.random) , column 1
    Hi,
    This part is a bit weird to me, can you explain please ?

    Thanks again
  • TitamTitam Member Posts: 20
    Here what I did but something does'nt work.
    I created 3 actors, spawn random 2

    https://www.dropbox.com/s/n9zsp2f4ie4oekx/Test Random.zip

    Thanks Tshirt ^^
  • TitamTitam Member Posts: 20
    You are my master ^^
    Thank you very much, I'll read this to understand how it works !!
    Thanks again :)
  • TitamTitam Member Posts: 20
    http://gshelper.com/gs/demo-spawn 4 out of 10.zip
    Hello,
    One more question about the file :) I understand you remove the row which has been randomly chose, can you confirm I understand well : Is that to avoid to get twice the same actor ?
    Thanks,
    Titam
  • TitamTitam Member Posts: 20
    edited June 2012
    Hi there,
    Another question on this topic. I would like to have the same random behavior on my next scene, but I guess the table is empty since we removed each.
    Is there any way to call back the "default" values automatically ? Or I have to use the change table value on the new scene ?
    What I did right now is, before leaving the scene, create again 4 rows and change their values. I'm wondering if there is a best way to proceed !
    Thanks !
  • TitamTitam Member Posts: 20
    Nobody ? :)
    Thanks
  • TitamTitam Member Posts: 20
    Yeah, thanks... I'am an idiot ^^
Sign In or Register to comment.