playMaker

Author Topic: random 5 of 25 fields are true with random animation or object ?  (Read 1173 times)

losaposta

  • Playmaker Newbie
  • *
  • Posts: 2
i need to populate 5 of 25 fields  and when i click on field and if it is true it should play 1 of 5 animations  or populate with 1 of 5 object



thing I have now is  random bool  for field and when it is greate than 5 is should not have possibility to make true bool
but very often it makes more that five

Any thoughts ?
« Last Edit: October 15, 2016, 06:49:09 AM by losaposta »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: random 5 of 25 fields are true with random animation or object ?
« Reply #1 on: October 16, 2016, 10:03:45 AM »
Hi,
From what i can see, you have this fsm on all 25 fields, If so what is happening is
that all fsm's are doing this at the same time.

You might want to set this up differently.

you can use an array and add your 25 fields in it, then you need a custom action from the Ecosystem called 'iterate' to loop 5 times.
In the loop you get a random field from the array with "Array Get Random" then place it in a different array, call it 'ActiveObjects' for example.
and loop 5 times.

after the loop add the "mouse down" Action and on the next state have a mouse pick and store your game object, then use "Array Contains" on the 'ActiveObjects' to see if its one of the 5 objects, if it is you can use a random event to do a random animation.

Here you can find tutorials for these actions.

losaposta

  • Playmaker Newbie
  • *
  • Posts: 2
Re: random 5 of 25 fields are true with random animation or object ?
« Reply #2 on: October 19, 2016, 09:10:57 AM »
Thanks a bunch