User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: For each and compare two general values

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    For each and compare two general values

    How do you use the For Each object together with compare two general values?

    For instance, how do I convert this to work with the For Each object:

    * Always
    - spread 0 to ID of Enemy1

    * Always
    - start loop "Enemy"

    * On loop "Enemy"
    + DistObjects( "Clickteam Movement Controller", Fixed( "Enemy1" ), Fixed( "Player" )) < 150
    + Enemy1: ID = loopindex("Enemy")
    - Enemy1: Look at 0,0 From Player


    I tried replacing the loop with a For Each loop, but I just don't get it to work.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    Ehm, you don't even need a loop for that in the first place. MMF2's event loops will do it for you...
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    What are you talking about? You need a loop for that. If not, please show me how you do it
    And besides, this was just an example. The fastloop work, but as an for each loop, it doesn't.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    Well, I will post an example of what you wanted. You'll have to give me a different example though if you want to see the for each object in action.

    http://www.LB-Stuff.com/MMF2/EnemyWatching.mfa
    (my server is messed so it thinks it's a tiff, just save and change it to mfa)
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    I have seen it in action, and I love it so far. But I need it to work in this scenario, and that is what I struggle with.

    So here's the example for you:

    For Each Enemy
    When This Enemy is getting within a radius of 600 from the player
    This Enemy: Move towards player


    That is what the example in the first post does with fastloops.

    And I need to run it in a loop because the following condition (without loops or anything) will not work:
    When Enemy is getting within a radius of 600 from the player

    Because it is affecting ALL the enemies.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    OK, as I said, it would still be much more efficient without any loops at all. Really just let MMF2's action loops do it, they're much faster.

    Just set a flag off before you check thier distance, and set flag on for ones who are within the distance. Then move the ones that have flags on.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    That doesn't solve it. The compare two general values condition will still affect every object in the condition. Unless I am missing something basic here?

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    OK, I guess you didn't see my example. Set the distance as an alterable value and use "Compare to Alterable Value" from the obejct you want to select.
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    Isn't there a "ForEach" object already anyway??

  10. #10
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: For each and compare two general values

    Quote Originally Posted by Popcorn
    How do you use the For Each object together with compare two general values?
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


Page 1 of 2 1 2 LastLast

Similar Threads

  1. Compare two general values = 0 not work
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 31st August 2013, 04:16 AM
  2. 'Compare to one of the alterable values' VS 'Compare two general values'
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st January 2012, 06:26 PM
  3. 'Compare General Values' with OINC
    By Asholay in forum Lacewing
    Replies: 3
    Last Post: 29th January 2009, 10:30 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
  •