If you have more than one object thats duplicated, but you want to link it to a detector thats also been duplicted more than once, how would you pair them so that MMF doesnt get confused?
It basically assigns an ID number to all objects matching the conditions of the event. If you do:
ALWAYS
- Spread 1 in A
The 'ALWAYS' condition selects all objects (since you didn't mention any objects specifically). The spread then enumerates all objects.
However, doing this:
X POS of object > 320
- Spread 1 in A
...will select only the objects whose X position is greater than 320. The spread will then only enumerate those objects. Others are left at whatever value they had before.
So you can also use it to loop through objects that meet certain conditions, and follow those objects even after those conditions no longer run true.
No wait, what are you on about Tyscorp? Why would you run a fastloop to spread a value, when the action already applies to all instances of the object when you run it once?
Tyscorp is confused... why would you loop it? Spread 0 in value A in object, will do it for all the objects... looping will just do that repeatedly, which is stupid.
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
6th November, 2006 at 16:07:29 -
No, his code makes it spread the value through all available objects, only way faster. You'd have to code more to make sure it works on any new instances of the object too, though... Which means at every condition that makes one.
Maybe I'm having a dense moment and just not seeing this, but how is it faster?
So far as I know, the Always: Spread command will ennumerate every instance of that object within one event. By the time the first frame is drawn, all your objects will be numbered.
You can see this by doing a fastloop, but telling it to run only once, like this:
Start Of Frame
... Run loop 'SPREAD' 1 time
On Loop 'SPREAD'
... Spread 1 in Value A
The loop occurs only once, yet every object is Numbered. This is because MMF is automatically fastlooping through all the objects, it doesn't need to be told.
That said, using fastloop in the above way to trigger a Spread command is better, since it saves on having pointless 'ALWAYS' commands. There's no point spreading the values again if nothing has changed. You just trigger the loop to run once when an object is created or destroyed, and once at the start.
Um, what? You really think using a fastloop, and three extra lines of code, would make it faster? And all that's required to make it work for new objects is to replace start of frame with always.