I'm adding them to my game but I'm not sure how to differentiate between "sets". The basic stuff is no problem, I would do something like ("angle" = spread value * interval between objects in degrees). But if I wanted a bunch of different wheels - THESE guys are spaced around THIS point, THESE guys are spaced in the same way around THIS point, etc. - I'm not sure what I should do. And I'm feeling uncommonly lazy. Any help?
Thanks for the reply but I don't really understand what you're saying - is that an elaborate way of giving the objects a value in common? (I feel dumb.)
I think my problem is mostly spacing the objects - as far as I know MMF deals with the parent/child issue pretty well automatically, e.g., if you do this...
Start of frame
- Create Floater at 0,0 from Center
Always
- (rotate Floater around Center)
... then each Center will have one Floater rotating around it. And if you create 18 Floaters at each Center, each Center will have 18 Floaters rotating around it (Someone tell me if I'm wrong here, I'm not 100%).
Now, if I had just one Center, I would be able to spread 0 in one of the Floaters' values, then modify each Floater's angle by that value * the desired interval in degrees. Once you add a second Center, MMF seems to want to distribute the values 0, 2, 4, 6 to the Floaters around one Center, 1, 3, 5, 7 to the Floaters around the second Center.
Obviously my approach to object selection is incredibly primitive in the example above, but after dicking around for a few hours now, it's still the best starting point I have.
Hope the above makes more sense than my original post. Cheers
Example - this version works, ish, if your preferred interval-between-objects is divisible by the number of ring-centers, and you don't mind a slight offset in each ring: http://www.theredswanhotel.com/misc/test.mfa
I hope I can come up with something more robust, if anyone has any suggestions I'd love to hear 'em
Oh wow I just made one from scratch and had it working 100% . . . I saved it and uploaded it and couldn't find it. Seems as if it never got saved, but MMF let me close it without the save box popping up . . . I'll remake it and post it up soon. Stand by.
That really helped, my new version so far looks like this:
Start of frame
- [create the required amount of Rotators at each Center]
- Spread value 0 in ID("Center")
- Spread value 0 in ID("Rotator")
- Set value Group("Rotator") to ID("Rotator") mod NObjects("Center") [shortcut for the first loop in your example!]
Always
- Start loop "circles" NObjects("center") times
On loop "circles" AND ID("Center") = Loopindex("circles") AND Group("Rotator") = Loopindex("circles")
- Spread value 0 in ID("Rotator")
- [insert trig here, modify angle with ID("Rotator")*(desired interval between objects)]
I've ditched the auto-spacing from your example (sorry) because I don't really gain anything from being able to vary the number of rotating objects - it just needs to be a solid wall with a gap where the player can safely enter and exit.
The one thing that bothers me now is that I don't want to loop through every single Center in the level, just the ones on screen (i.e., screen edge + diameter). This seems like a much dumber problem but I can't figure it out, I'm not sure how object focus carries across to Pick or Count-type events - any ideas anyone? Cheers
Spreading values and repeatedly running fastloops is bad practice. Either use the ForEach extension, or just run the fastloop once at the start of the frame:
Originally Posted by Sketchy Spreading values and repeatedly running fastloops is bad practice. Either use the ForEach extension, or just run the fastloop once at the start of the frame:
Yeah I typically keep my loop usage to a minimum and don't like to run loops over and over, but I'm also not an avid extension user due to stability issues. I tried not looping it over and over, but when objects would get destroyed they would reassign themselves to a different center object for some reason =/.