User Tag List

Page 3 of 3 FirstFirst 1 2 3
Results 21 to 30 of 30

Thread: Fastloops, Flash, HWA... is this possible?

  1. #21
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    The For Each Object may not work in Flash. As this example here shows:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=211616&Searchpa ge=2&Main=28892&Words=Tiles&Search=true#Post211616

  2. #22
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    If for each actually doesnt work or doesnt work the same way in flash this is important to fix, because optimizing is very important for flash!

    Along the same lines, what about lava mobile, does for each work in java mobile runtime?

  3. #23
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    For Each does have limitations compared to Fast Loops. Mainly dealing with maintaining object selection with nested loops. But in general, it does the job.

  4. #24
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    Hm, as my example shows, it does not do the job

  5. #25
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    The foreach object is very powerful, very buggy. Flash is one of those bugs atm, but dont hold your breath on it being fixed

  6. #26
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    Quote Originally Posted by Dynasoft
    Use the ForEach object (it's supported in Flash too). It does the same job as spread+fastloop, but is an order of magnitude more efficient.

    EDIT: I know you said you couldn't do it, but I don't get how you could have it work with a fastloop and not a foreach, they basically work the same...
    I just have no real knowledge of ForEach and I can't really find any tutorials or anything on it... From what I attempted, it worked for detecting the falling block landing on the obstacle block, but not for landing on instances of other falling blocks...

    I'm not one to usually ask for examples, but if someone wants to convert the example I posted earlier in this thread into ForEach instead of fastloops, I would definitely appreciate it.

    If not, I'd appreciate other examples or a good tutorial/explanation on ForEach.

    I know you say they "basically work the same" but that's different than "they work the same". =P So I need to know the differences.

  7. #27
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    Quote Originally Posted by Pixelthief
    The foreach object is very powerful, very buggy. Flash is one of those bugs atm, but dont hold your breath on it being fixed
    Which is another reason I'm not using ForEach... In this scenario I'd rather have a working (although quite limited) game in Flash, instead of no game at all.

    Though if ForEach could really improve performance in my exe build, I would definitely be willing to change it and just use fastloops for the Flash demo.

    From what I've been able to gather, fastloops work great, they just eat up performance. ForEach doesn't eat up performance, but it's buggy/doesn't work with Flash, and I don't know how to use it.

    So it's pretty clear that I've gotta stick with fastloops unless I managed to figure out ForEach, and it gets some bug fixes.

  8. #28
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    If you're still trying to use it in flash, examples wouldn't do much good. Outside of flash, its pretty simple. When you run a loop in foreach, it will run that line of code N times for the N objects in the group you are running on. Each of those times, it will specify a single copy of that object and apply the action to him. If the actions operate mutually exclusive of each other, the order won't matter, but otherwise it is either the order you added them to the group or the order the objects were created.

    You can either start ForEach loops for an object, or start them for a group as defined in the foreach object. You can use groups by adding objects using its "Add object to group" function- by specifying the objects using conditions in your code, you can add say half of the instances of one object and half the instances of another. You can specify which instances of which objects you add to a group, which works much like a qualifier, except made at runtime. Make sure after running your loop that you remove all instances of all objects from that group list, if theres any chance they could be destroyed/etc

    For the conditions, you can either have a condition execute on the loop, or on the loop for a specific type of object. Any condition that triggers for the loop will trigger once for every single loop it does- N loops triggers that condition N times, and you can apply any actions you want without affecting the object scope list (ie you can operate on the set of all objects that you'd normally specify via the next condition). The next condition, "On fast loop for object" will trigger once per each instance of that object in the current group, and each time it reduces the object scope to just one instance of that object. So it might run N times for N objects, but each time only a single instance of the object is scoped.

  9. #29
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    Quote Originally Posted by Pixelthief
    Each of those times, it will specify a single copy of that object and apply the action to him.
    Does this mean it's only looking at one single copy of the object at any given time? Is this why I can't get an instance to collide with another instance? That's really the issue I'm having at the moment.

    If it's isolating one of the instances, it's not paying any attention to the hundreds of other instances, meaning it's not going to detect them at all... or am I mistaken?

  10. #30
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloops, Flash, HWA... is this possible?

    That would be correct. When it lowers the scope to a single instance of an object, it is more difficult to do collisions between instances of the same object. What you COULD do instead is just have a secondary 'detector object'.

    So you isolate the instance of the object, position the detector on top of that object, and then compare the detector to the larger set of objects for collisions. It would look like this:


    *(ON CONDITION)
    = Start ForEach loop "Test" for "Object"

    *On ForEach Loop "Test" for "Object"
    = Set Position of "Detector" to Position of "Object"
    = Set "Detector" Flag 1 Off

    *On ForEach Loop "Test"
    +"Detector" is overlapping "Object"
    = Set Flag 1 of "Detector" On
    = (DO ACTIONS SPECIFIC TO OVERLAPPED OBJECTS)

    *On ForEach Loop "Test"
    +Flag 1 of "Detector" is On
    = (DO ACTIONS FOR ALL OBJECTS)

    *On ForEach Loop "Test" for "Object"
    +Flag 1 of "Detector" is On
    = (DO ACTIONS SPECIFIC TO THE CURRENT OBJECT)



    So in this case, you have the group of all objects (ALL OBJECTS), the single instance of an object that it is iterating through one at a time (CURRENT OBJECT) and the objects of the same class that the current object is overlapping, including the current object (OVERLAPPED OBJECTS).

    So lets say you wanted to do something simple. For each of those actions, you add 10 to the value A of each of those objects- for the specified object, for the overlapped objects including specified again, and all objects, including all those.

    So if object A overlaps object B, but not object C

    First the loop iterates through A. It sees A overlapping B, therefore so it adds 10 to the set of both objects first: A = 10, B = 10, C = 0.

    Then it adds 10 to all objects: A = 20, B = 20, C = 10.

    Then it adds 10 to just the specified object: A = 30, B = 20, C = 10


    But now when it iterates through B, it also sees B overlapping A, just as it saw A overlapping B. So it repeats the above process, and you get: A = 50, B = 50, C = 20.

    Now it iterates through C, and sees no collision, so nothing increases.


    You have to think about which objects you want to scope and what actions you want to apply to them for each function you are doing. It really matters exactly what you are trying to accomplish. Are you trying to destroy two colliding objects? Are you trying to destroy only one of the two, and if so, which one do you choose? Do you want to do an action to all objects based on a value from the colliding object(s)? If so, you'd need to store it outside of the referenced object- put it in a neutral 3rd party object like the detector.

Page 3 of 3 FirstFirst 1 2 3

Similar Threads

  1. Problem with Fastloops
    By Ls2 in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 19th May 2012, 08:20 PM
  2. A question about fastloops
    By kromblite in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 16th May 2012, 12:57 AM
  3. XNA and FastLoops
    By King_Cool in forum XNA Export Module Version 2.0
    Replies: 6
    Last Post: 26th January 2012, 08:08 AM
  4. Fastloops
    By Solgryn in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 4th August 2011, 07:28 PM
  5. Fastloops
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 21st June 2007, 09:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •