User Tag List

Results 1 to 8 of 8

Thread: 'Spread Value' is broken!

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'Spread Value' is broken!

    I have this one event with only one condition (always) and it has 2 actions, spread value '0' in 'ID' (alterable value A), and the second action is to start a loop. This isn't working. I made it put those object in the debugger. The first object's 'ID' is 1, and all the rest are 0.

  2. #2
    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: 'Spread Value' is broken!

    Do it in two events, not one. Spreading a value and starting a loop in the same event is a *bad idea*.
    .:::.Joshtek.:::.

  3. #3
    No Products Registered

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

    Re: 'Spread Value' is broken!

    especially if the loop comes before the spread event

  4. #4
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: 'Spread Value' is broken!

    raytrace:
    doesn't matter, spread values messes up in the same event because of this:

    "Spread values" is an action that is called upon all instances of the object you called it on. The problem is that the first instance of the object gets a value assigned immediately and then MMF2 runs the fastloop before giving ID's to the other objects. After the loop MMF2 will have forgotten which objects it was about to give an ID and then stops.

    Events that looks like this:

    + Some conditions
    --> Spread value 0 in val A
    --> Start loop "blah"

    Will be executed like this:

    [Instance 1] Give value 0
    Start loop "blah" //This is were MMF2 forgets the objects
    [Instance ?] //huh?!? The objects are forgotten and MMF2 cannot give the rest of the objects an ID with 'spread values'

    For info, Francois said this is design decision and not a bug... Even though most people would believe it is :P

    Why start the first action and then put the rest of the instances in the end of an action queue? Why not just trigger them immediately in a loop before moving on? Would also save you the trouble of having a temporary list of actions.

  5. #5
    Clicker Multimedia Fusion 2 Developer

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

    Re: 'Spread Value' is broken!

    It's because all the actions are executed in order for each object.

    If you have two set value actions in one event for example, it'll do them alternately until they're applied to all objects. Conditions on the other hand are executed one at a time, looping the same condition for all objects of that type before going on to the next.

    So if you have two objects of one type, two conditions and two actions in one event you'll get this happen:

    Condition1 executes for Object 1
    Condition1 executes for Object 2
    Condition2 executes for Object 1
    Condition2 executes for Object 2
    Action1 executes for Object 1
    Action2 executes for Object 1
    Action1 executes for Object 2
    Action2 executes for Object 2


    With Spread value and a loop it ends up looking like this:
    (Ignoring the "MMF forgetting the selection list across a loop" bug. This bug basically stops all actions in the same event as a "Start Loop" action affecting more than one object.)

    Spread Value to Object 1
    Start Loop for "Special Object"
    (the special object is where the start loop action is. There's only 1 special object, so this action doesn't run again this event)
    Spread Value to Object 2
    (If there was two special objects, another loop would be run here. This could have happened with the old fast-loop extensions, but it's only possible to have one "special object".)

    Basically, the problem is the order the actions are executed in. You should get the same problem with "Set Value" btw, so this shouldn't work correctly either (should only destroy one object):

    [events]
    *User clicks left button
    -Set Alterable Value A of "Object 1" to 2
    -Start Loop "Kill A" 1 times

    *On Loop "Kill A"
    +Alterable Value A of "Object 1" equals 2
    -Destroy "Object 1"
    [/events]

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 'Spread Value' is broken!

    Oh ok. I will try it in 2 events. Thanks!

    EDIT: Yay, it worked like a charm.

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 'Spread Value' is broken!

    Just a quicky to see if I've understood why this is the case:


    Suppose we have this event, and there are 5 enemies, and 5 detectors.

    Start of Frame
    - Spread 1 in ID of Enemy
    - Spread 1 in ID of Detector

    MMF selects all objects by default, and there are no conditions to narrow that selection down.

    So what MMF *ACTUALLY* does is this:

    Start of Frame
    - Spread value in enemy 1
    - Spread value in detector 1
    - spread value in enemy 2
    - Spread value in detector 2
    - spread value in enemy 3
    - Spread value in detector 3
    - ...etc...
    - spread value in enemy 5
    - Spread value in detector 5

    literally like a mini fastloop, it just keeps repeating until all selected objects have been handled.

    However, if we were to include a fastloop, like this:

    Start of Frame
    - Spread 1 in ID of Enemy
    - Spread 1 in ID of Detector
    - Run Loop "My Loop" 6 times

    Then MMF would do what it normally does - repeat EVERY action for every selected object. Since there are 5 enemies selected, the 'Run Loop 6 times' action would itself be run 5 times - giving us 30 loops. EG:

    Start of Frame
    - Spread value in enemy 1
    - Spread value in detector 1
    - RUN LOOP 6 TIMES
    - spread value in enemy 2
    - Spread value in detector 2
    - RUN LOOP 6 TIMES
    - spread value in enemy 3
    - Spread value in detector 3
    - RUN LOOP 6 TIMES
    - ...etc...
    - spread value in enemy 5
    - Spread value in detector 5
    - RUN LOOP 6 TIMES

    So, to stop this happening, the first fast loop has to stop any other action-loops from happening, so that it doesn't get repeated.

    But as a result, it stops the other actions from being applied to all the other objects.

    That would explain it being a 'Design Decision'.

  8. #8
    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: 'Spread Value' is broken!

    If an action is performed on an object and 5 objects are selected, it will do that action 5 times - but not *all* actions 5 times. Some actions it puts on the backburner and goes "I'll do that later".

    Fast loops mess up object instance selection and backburner actions such as spread value. Put them in separate events.
    Quote Originally Posted by Francois
    This is not a bug, this is how the action routines are coded. I perform several loops of actions. The first exploration of the actions, calls all the actions, including the one shot actions like loops, sound etc., and the object oriented actions for the first object to be explored.
    Then the next loops explores the remaining object oriented actions for the other objects, including the spread actions.
    So if you want your spread action to be executed before, just duplicate the line of events.
    .:::.Joshtek.:::.

Similar Threads

  1. Builds are broken
    By Keith in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 28th December 2013, 03:05 PM
  2. How are spread values spread ?
    By rudy in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th December 2011, 08:15 PM
  3. Is my overlay broken?
    By Game_Master in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th August 2011, 02:34 PM
  4. This is broken.
    By Corlen in forum File Archive
    Replies: 10
    Last Post: 9th August 2009, 07:56 PM
  5. A Few Broken Examples
    By Atom in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th July 2009, 03:26 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
  •