playMaker

Author Topic: Also class project- Sending events to 3 of many clones[SOLVED]  (Read 2586 times)

pdunton

  • Playmaker Newbie
  • *
  • Posts: 35
Also class project- Sending events to 3 of many clones[SOLVED]
« on: September 17, 2013, 10:01:04 PM »
I am creating a game where people are forced to leave because of an action the player makes.  How do I send events to a random three of a thousand clones?
Thanks!
« Last Edit: September 20, 2013, 02:39:06 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Also class project- Sending events to 3 of many clones
« Reply #1 on: September 18, 2013, 02:33:25 AM »
Hi,

3000 clones?! in game, that's quite a lot... Be careful, you may hit some severe performance drawback if you have all of them active in game...

I would have the clones registered in an list, and then pick one randomly in that list.

For this, you can use ArrayMaker:
https://hutonggames.fogbugz.com/default.asp?W715

Bye,

 Jean

pdunton

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Also class project- Sending events to 3 of many clones
« Reply #2 on: September 18, 2013, 07:40:49 PM »
No, you misunderstood me. :)  I meant that I want to send an event to 3 random clones, out of 1000.  (Will 1000 Clones cause me tons of lag?  They only have like 3 scripts on them and this is a 2d game.)  I need to send an event to 3 objects to delete themselves for a shop use.  My computer won't let me download so is there another way?
Thanks

pdunton

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Also class project- Sending events to 3 of many clones
« Reply #3 on: September 18, 2013, 08:23:20 PM »
NVM Lane on another thread introduced me to Get Random Object (with tag).  So I will get 3 random objects set them as variables, and send events to them.
Thanks!