Questions about a new fast loop
Hello all,
I am considering implementing a new kind of fast loop in MMF.
This because I have realised that many people were using the fast loops to explore a list of objects. To do so, they spread a value in one of the alterable values of the object, then start a loop and compare the number of the loop to the alterable value, to select only one object in the loop.
This works, but is a little complex and long winded.
So the new loop action would be :
Start object loop "Name of loop", Object
And the condition would be :
On object loop "Name"
Basically, it would call the on object loop condition for each one of the "object", selecting only one object at a time. The result would be exactly the same as with spread, but much simpler.
Question : do you think such a loop is necessary?
Next question.
I have a dilema here. When the program calls the start object loop action, I have two options.
* Option one, is to explore the list object objects selected in the condition, and only them. For example if you have :
- Collision between A and B
+ Start object loop "Myloop", A
... this will only call the loop for the collisionning object A. Of course, if you do not select any object in the condition, then all the A objects will be explored.
* Option 2 : whatever the selected objects in the condition, I explore all the objects. In our example, all of the A objects would be called.
In my opinion, option 1 is more powerful, and more in line with how MMF works, but sometime it would be not practical (you may want to explore all of objects A when a collision occurs).
Question : which one should I do? 1, 2? Both? If both, I would need a name for the conditions / actions
Waiting for your intelligent input on this!
Re: Questions about a new fast loop
Question 1: Yes, I think such a loop would be necessary as the creator has more control of the loops
Question 2: Both, you can do a function like:
- Collision between A and B
Start loop "Name_here" With object A, then it asks you like "Select all A objects = 0, Select unique A object =1, so if I want all the A's I type in 0.
I hope it makes sense.
Re: Questions about a new fast loop
This sounds like it would be a real simplifier in the way we do things, so defiantly room for this feature. As far as the options, I agree with Dines - that would work pretty much perfectly.
Re: Questions about a new fast loop
This would indeed be a great feature. I have tried making an extension for this kind of loop, but I never managed to get it working.
Re: Questions about a new fast loop
Definitely option 1 (only explore the selected objects). If they want to affect all objects they can do it easily (setting a global, using the select object's "reselect all", etc).
The opposite isn't true. If you make it loop through all objects always, then it's much harder for the user to only loop the objects he's interested in.
Re: Questions about a new fast loop
For the second question, its somewhat like an "Or vs Or(Logical)" type of thing. As long as the two different looping methods are clearly distinguished and understood feature-wise, then I don't see a problem.
Re: Questions about a new fast loop
SWEEEEEEEEEEEETTTTTTTTTT!
Re: Questions about a new fast loop
I do use the old fastloop method to select an individual, and when doing this alot it can slow down MMF. My question is, will this new kind of fastloop be faster?
Also I'm totally in for this, it's a really great idea :D
Re: Questions about a new fast loop
Excellent! Asked for that many times :D
Could you call it "For each loop"? That would be consistent with what people with programming background expect and look for.
Such a loop would be a REAL timesaver and it'd save us from always needing to dedicate one alterable value to enumerate objects (and keep track of the numbers or spread value every frame).
Definitely go for option one.
I would recommend, to cover option two, to have a special action "reselect all", which you can run to "undo" what the condition selection did. If you run it before running the loop, you get what option 2 would do. Plus it can be handy in all kind of situations where you want to affect all objects, if a certain condition is true.
Re: Questions about a new fast loop
As Dynasoft said, definitely the option 1 and maybe you can include a function in MMF2 to select all the objects (delete the current object selection). ;)