User Tag List

Results 1 to 9 of 9

Thread: Need help with loops and object picking

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Sweden, Lund
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with loops and object picking

    I am using detectors in a nested loop to detect obstacles for a moving object. The thing is that only one of the objects behave as (I think) it should when there are more than one of them.

    I read something about a glitch(?) in MMF's object picking (or what it's called <img src="/center/images/graemlins/tongue.gif" alt="" />) and that a workaround was to insert an empty On loop-event in the code. I still couldn't make it work though!

    Can someone offer some help on this? Exactly what was that workaround as I couldn't find it again?
    Greatly appreciated!
    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help with loops and object picking

    Sorry - that seems to work ok logically but is obviously something to do with the uninduvidualality of objects in MMF.

    One thing that would be nice in MMF2 is being able to select a certian duplicate of an object in the expressions evaluator. For instance, if you wanted to set the alterable value A of "box" (#1) to that of (#2) then you could put:
    [:"blue"]
    set valueA("box",ID(1)) to ("box",ID(2))...
    [/]
    which of course couldn't be done with the current User Interface of MMF2.

    Better save it for MMF3 <img src="/center/images/graemlins/wink.gif" alt="" />

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS 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
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Need help with loops and object picking

    .:::.Joshtek.:::.

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Location
    Sweden, Lund
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    You fixed it!

    Thanks a lot! Really!!

    So was everything you did to separate the starting of the loop from the value spreading and insert an empty event in the main loop?

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS 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
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: You fixed it!

    The spread value change helps, but you can delete that empty loop as it doesn't have any effect.

    Importantly, I swapped around many of the conditions so instead of it checking the detectors alterable value against group.n, it compared group.n's value against the detector. This meant that it narrowed things down by the group, not the detector.

    Oh, and I also removed the +5 and -5 stuff from the obstacle detector, because that needs doesn't work if the object is also next to the edge of the screen.
    .:::.Joshtek.:::.

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Location
    Sweden, Lund
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: You fixed it!

    Oh well, thanks again! I feel that I know a little bit more about the object picking now. Wasn't there an article on MMF1.5's runtime-something around somewhere? Maybe I should read that again! Does anybody know where it is? It was about which order MMF runs through events and things like that.

  7. #7
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS 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
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: You fixed it!

    Maybe you mean Getting the Most of the Runtime Engine, originally written by François himself.

    The tricky thing with loops is that MMF wasn't built from scratch to handle them, so sometimes the runtime goes "I'll do that later" and it either does it too late or not at all.

    ----------------

    How the runtime works in relation to multiple instances, by Joshtek

    As far as object-picking is concerned, objects don't get picked by being referenced to in expressions en passim. They only get selected by meeting their own object conditions (e.g. flag is on).

    Scenario: You have two active objects, "Bob" and "Bill". Bob has 10 instances and Bill has 11, making 21 object instances overall. The "Start of Frame" event spreads 0 on alterable value A for both objects, meaning there are now ten pairs (objects with the same Alt A).

    What would the condition [/i]Alterable Value A of Bill = Alterable Value A of Bob[/i] with the action Set ink effect to inverted do after the objects had been paired?

    What it would do is check all of instances of Bob against the first instance of Bill. It would determine that only the first instance of Bob shares an alterable value with the first instance of Bill, ignoring the other instances of Bill completely.

    If you then did the Invert action on Bob and Bill when this condition was true, things would get ugly. Despite the fact that all Bobs have a twin, since it only checked the Bobs against the first Bill then only the first Bob would be affected.

    On the other hand, all of the Bills would be affected (even the un-twinned one) because it didn't count the condition as a reason to narrow down the instance list for that object.

    Finally, if you run a loop inside your event and then do an action relating to an object, the action will apply to all instances because MMF "forgot" the object list.
    .:::.Joshtek.:::.

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: You fixed it!

    []As far as object-picking is concerned, objects don't get picked by being referenced to in expressions, only by their own conditions.
    [/]

    As i said, this would be one thing that would help the induviduality of each duplicate

  9. #9
    No Products Registered

    Join Date
    Jul 2006
    Location
    Sweden, Lund
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: You fixed it!

    @Joshtek: Yep, that's it!

    Now you actually made me understand why the detector was only positioned at one of the objects!

    For anyone else with similar problems I'd recommend looking at my example as well as the fixed one to compare the differences! I'll attach them both in one file.
    Attached files Attached files

Similar Threads

  1. Object Picking Woes
    By MattEsch in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 8th April 2010, 10:38 PM
  2. Object picking issues.
    By Almightyzentaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th February 2010, 06:00 AM
  3. need help with picking an object
    By method72 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th September 2009, 01:31 AM
  4. Picking only one object during overlap
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th June 2007, 01:46 PM
  5. Object picking is still disfunctional...
    By Maggott in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 16th February 2007, 06: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
  •