playMaker

Author Topic: Arraymaker: Select random index and store value  (Read 2051 times)

Alatriste

  • Full Member
  • ***
  • Posts: 195
Arraymaker: Select random index and store value
« on: February 08, 2014, 06:22:41 AM »
Hi,

I'm doing some basic tests with Arraymaker and I cannot find an easy way to do the following: spawn different actors in five random different positions. Each position is an index in the array. Then, from the FSM, set the spawn position for each actor and remove that index so it cannot be selected by the rest of the actors.
However when that actor is unspawn, the index used has to become available again.

Is there an easy way to do this?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker: Select random index and store value
« Reply #1 on: February 10, 2014, 03:39:33 AM »
Ah ah!

 I just did a sample doing just that last week :)

http://hutonggames.com/playmakerforum/index.php?topic=6128.msg30253#msg30253


bye,

 Jean

Alatriste

  • Full Member
  • ***
  • Posts: 195
Re: Arraymaker: Select random index and store value
« Reply #2 on: February 10, 2014, 10:38:29 PM »
Yes! Thanks Jean! I was still trying to figure out how to do it, using multiple variables, sending events... I'll look into your example as soon as I can. :)