User Tag List

Results 1 to 8 of 8

Thread: nested fastloop question

  1. #1
    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)

    nested fastloop question

    I have some code that I can't figure out:

    I run a fastloop when an enemy's alt string A is set to "THROWN". In the fastloop, I use an index check to set a counter to the fixed value of the enemy thrown. then I set a detector to the position of the enemy. If the detector overlaps a backdrop, I run another loop an infinite number of times (nested in the first loop) to move the enemy back one pixel at a time. Then, if the enemy is not overlapping a backdrop, I set the alt string A to something other than "THROWN" and stop the nested loop. For some reason, this works fine if I throw an enemy so that it can fly a bit before it hits a backdrop. BUT if I throw the enemy point blank into a backdrop (if I am standing against a backdrop when I throw) then the enemy gets stuck. I assumed the nested loop would move the enemy out of the wall instantaneously. For some reason, the alt string is being changed from "THROWN" even though the "not overlapping" condition isn't true yet.

    Does anyone have any idea why this might be happening? My code is kind of complex now, so I don't know if anyone has the patience to look at it. ^_^' Also, it seems like the pause debugger command won't activate mid loop. Is there a way to step through loops?

    Any help is appreciated,

    mobichan

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: nested fastloop question

    Can you post a simplified example of the broken code?
    i.e. a file with just you, the enemy, detector, and the throwing events.

  3. #3
    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: nested fastloop question

    Hopefully this is simple enough. There are a lot of little things keeping stuff in check, so I couldn't delete alot of the player and enemy code.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=142141&#Post142 141

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: nested fastloop question

    The debugger steps through one frame at a time, so all loops within a frame are performed in between its steps - when trying to look at what a set of complex fastloops is doing, I usually set each action to add an identifiable character to a global string, so I can tell which events came up as true in what order. It's not perfect, but it does give you a bit more of an idea as to what's happening within the loops.

  5. #5
    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: nested fastloop question

    Wow, thanks for the suggestion. I really wish we could truly step through code with the debugger line by line, even in fastloops. Maybe in MMF3? I'll give it a shot, but I could still use help if anyone has some time to spare.

  6. #6
    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: nested fastloop question

    So after appending a string on each event, I am finding that the loop that should move the enemy out of the backdrop is only run once and then stops. I have a theory: Since I am checking an overlap condition, maybe it isn't retested each loop? By this I mean that the first time the loop is run the overlap condition returns true, but the next time the loop is run, the overlap condition is ignored because it was already tested previously. Are overlap conditions checked only once per frame? I can't really think of another reason, but I would appreciate any advice from some of the more loop savvy devs out there.

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: nested fastloop question

    Quote Originally Posted by DavidN
    The debugger steps through one frame at a time, so all loops within a frame are performed in between its steps - when trying to look at what a set of complex fastloops is doing, I usually set each action to add an identifiable character to a global string, so I can tell which events came up as true in what order. It's not perfect, but it does give you a bit more of an idea as to what's happening within the loops.
    Not related to the topic at hand, but just wanted to mention I was reading about your work on Crystal Towers 2, and your debugging methods are amazing. The outside apps you made to parse what actions the user can take in a level, etc, is quite an achievement.

  8. #8
    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: nested fastloop question

    On a total fluke, I found out what was causing my problem. But I really want to find out WHY before moving on.

    So, I have 2 things I check against when doing this overlap test: Backdrops and a door qualifier group. I put both checks on the same line using an "OR(filtered)" between the 2 checks so I could conserve lines. I just deleted the second thing I was testing against (the door qualifier) and the "OR" and suddenly the code worked.

    Why on earth would an OR statement not work in this case? I even tried switching to the filtered OR but that had the same problem as the logical OR. This is making me think I should avoid OR statements all together.

    Can anyone explain what is going on?

    [EDIT]: In a sudden moment of clarity, I now realize what is going on. I stop the loop when the enemy is NOT overlapping a backdrop (OR) NOT overlapping a door. Since the door condition is returning true, the loop is getting stopped. Sorry for the long post about nothing. You'd think simple things like this would plague me less and less the more I make games in MMF. Sigh... At least I learned a cool debug technique. ^_^'

Similar Threads

  1. Platform Fastloop Question
    By amaire13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd October 2012, 08:25 AM
  2. Just a fastloop question.
    By kjellm87 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 20th July 2011, 06:52 AM
  3. fastloop question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th February 2009, 11:26 PM
  4. fastloop order of operation question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th February 2009, 12:08 AM
  5. Fastloop Spread Value question
    By artician in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 6th June 2008, 02:46 AM

Posting Permissions

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