Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: markinjapan on September 02, 2012, 09:25:01 AM
-
I want to define an array of x amount of gameobjects and then loop through them, wondering if there was an action that did this?
Something like the 'Select Random Gameobject' action but sequential.
I'm thinking that maybe ArrayMaker might have something like this but I think it would be useful to have this kind of thing within the standard Playmaker actions.
Would tidy up a lot of my FSMs :)
Thanks
-
Hi,
Yes, ArrayMaker has this ability, as for selected random GameObject within an array, do you expect to not select the same one again? like picking cards out of a deck?
bye,
Jean
-
Yes, That that's correct, it would only be used once, if the user wanted to use again they could loop the action. And also sequence them (just in order top to bottom) would be perfect.
-
Hi,
I can't find it, but I think I had this discussion before on this forum.
basically, one way of doing this is the following:
Have a temporary arrayList ( a copy of your actual list) and pick a random one in it, AND delete it, then pick a random one again, etc etc etc. This would be the best approach I would say,
Have you tried that?
bye,
Jean
-
This is the action I mean.
https://hutonggames.fogbugz.com/default.asp?W442 (https://hutonggames.fogbugz.com/default.asp?W442)
So where it says 'weight', that would be 'order'.
When this action was called it would get the 1st gameobject in the order and pass it to the next action, the next action would then loop back and then the 2nd gameobject would be called and so on. It's the sequencing that's important.
I guess this should be done in an array (and I really need to get my head around arraymaker...) but for really small lists (of gameobjects) this would be really handy :)
Mark
Hi,
I can't find it, but I think I had this discussion before on this forum.
basically, one way of doing this is the following:
Have a temporary arrayList ( a copy of your actual list) and pick a random one in it, AND delete it, then pick a random one again, etc etc etc. This would be the best approach I would say,
Have you tried that?
bye,
Jean
-
Hi,
I don't think this is the action you need, as it will pick randomly in that list of gameObject, even if you put weight, The solution of using arrayMaker and a second list acting as a pool to select gameObjects is likely the right way to do it,
Have you tried to mess around with arrayMaker already?
bye,
Jean
-
Hi,
In truth, not much, I guess I should as arrays are really useful.
If there were video tutorials it would make learning arraymaker a lot quicker ;)
Thanks
-
Hi,
Unfortunatly, no screencast on arrayMaker... but given the demand, I really need to get down with this,
bye,
Jean
-
True, I think it would be great if whoever is doing the Hutong games youtube videos could do a few tutorials. He's doing a great job so far, I've learnt a lot.