User Tag List

Results 1 to 10 of 10

Thread: Question about Alterable Values

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about Alterable Values

    Hi
    I know this is kind of a basic question

    ...
    But when you create a condition like

    - ObjectaA Alterable ValueA = 0

    Only the Instances with AltValA=0 are 'selected' right?
    But what about the consequent actions of the Condition, pointers that point to ObjectA in the Actions, where do the pointers go, to the 'selected' Instances or the Object in general?

    ...
    Example1:
    ObjectaA Alterable ValueA = 0
    -->
    ObjectA set Alterable ValueB to 5

    Example2:
    ObjectaA Alterable ValueA = 0
    -->
    Set Counter to ( Advanced Direction Object ) DirDiff( ObjectA angle, 90 )

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jan 2010
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In example 1, any objectA that has the value 0 in alterable valueA, set it's valueA to 5.
    In example 2, I think you will get the counter confused (because it doesn't know which objectA to choose), so you have to add a condition that points to the specific objectA you want. I think this can be done by naming one value of ObjectA to say ID, then at start of frame spread values in the value ID, starting at 0. Then you would need a fast loop that runs as many times as there are ObjectA in the frame. When doing that, you can say this:

    ID of ObjectA = loopindex of fastloop
    ObjectA Alterable ValueA = 0

    -> Set Counter to ( Advanced Direction Object ) DirDiff( ObjectA angle, 90 )

    In that way, the counter will know to choose the specific ObjectA that has the same ID as the current place in the loop. Of course, if there are two or more ObjectA that have the value 0 in value A, the counter will only show the calculated number of the ObjectA with the highest ID, seeing as that one gets checked last in the loop.

    Wow, hard to explain :P

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for explaining Yikes.
    ...
    I see so even if the Condition performs Instance selection, as long as the Action dont originate from the Object in the Condition, the Actions are applied to the Object in general...?

  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)
    No, going down the conditions and to the actions, the object selection is always narrowed and never widened. Each condition can select fewer and fewer specific instances out of the currently selected ones, and then the actions are stuck with what was selected. Beware that actions that trigger other events can reset this or cause strange effects. There is also the Select Object extension for breaking some rules.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    Each condition can select fewer and fewer specific instances out of the currently selected ones, and then the actions are stuck with what was selected.
    From experience i can say that not all actions respect the Instance selection from the conditions.
    Specifically if the Action does not originate from the Object wich Instance selection is performed upon in the Condition.

    ( ObjectA Instance selection ) If ObjectA AltValueA = 1
    -->
    ( ObjectA ) set AltValueB = 22


    ( ObjectA Instance selection ) If ObjectA AltValueA = 1
    -->
    ( Counter ) set Counter = 22

    Quote Originally Posted by LB View Post
    Beware that actions that trigger other events can reset this or cause strange effects.
    Are you talking about something specific here?
    Like Loops, Group Of Events?

  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)
    Well obviously object selection only happens on a per-object basis, selecting fewer and fewer instances of the same object. Object pairing happens only in actions.

    Loop yes, because they get triggered immediately, also function objects, etc. but I don't know what you mean by groups of events, they are never triggered.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    Object pairing happens only in actions.
    What do you mean by Object Pairing?

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    At the start of every line (including lines that begin "on loop"), MMF2 "selects" every instance of every object. What that means, is that MMF2 creates an internal list for each type of object, containing all the individual instances of that object - a list of player objects, a list of enemy objects, a list of counter objects, etc. The order of the individual instances on their respective lists, is determined by the order in which they were created - newest at the top (although for objects created in the frame editor, the order can be manipulated using "bring to front" / "send to back" / etc).

    MMF2 then processes the list of conditions, one at a time, from top to bottom (it DOES matter how you order your conditions). If a condition is not true of an instance, that instance is removed ("filtered") from its list.
    Note that "compare two general values" does NOT filter instances in this way. It always uses values from the newest instance - if the condition is true, then it acts like an "always" condition (triggering actions, but not affecting object selection); if it is NOT true, then it acts like a "never" condition, and none of the following actions are performed.
    Actions do NOT filter instances (with the exception of when using the "select object" extension; or when creating a new object, which selects ONLY that instance).

    When MMF2 gets to the list of actions, it starts to automatically pair up instances of different object types, according to their positions on their respective lists. If you have an action that sets a property of Object_A to a property of Object_B, MMF2 will pick the instance of Object_A that's at the top of its list (ie. the most recently created that is still selected), and give it the value from the instance of Object_B that's at the top of its list. It then moves on to the second instance on each list, and so on...
    If it gets to the end of one of the lists (ie. if the number of selected instances of each type is not the same), MMF2 loops back to the start of that list, and keeps going.
    eg. If there are 5 instances of ObjA selected, but only 2 of ObjB :-
    ObjA1 (newest) = ObjB1 (newest)
    ObjA2 = ObjB2
    ObjA3 = ObjB1
    ObjA4 = ObjB2
    ObjA5 (oldest) = ObjB1

    This is the whole reason you're able to say something like:
    + Always
    -> Turret: Set position at 0,0 from Tank
    ...and it will work - regardless of how many tanks you have (it'll position a different turret object on each tank object).

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what happens in an Event is:
    (1) - A List is built for all Objects, containing all the Instaces of the Object
    (2) - Instances are removed from the Lists, depending on the criterias in the Condition.
    This much i do understand.

    MuddyMole, thank you for the detailed explanation.
    I am sorry but im still a bit confused

    ...
    Lets say i have 3 Instances of Enemy, and all have their unique ID_ value ( 1,2,3 ) and a Health_ value.
    And i have one '1 based' standard Array Object.

    If Enemy AltValueZ = 0
    -->
    Array write value 'Health_' to Array[1, 'Enemy ID_']
    ( No Enemy Instances are removed from the List )



    Isnt this whats supposed to happen?

    Array [1, 'Enemy(1) ID_'] = 'Enemy(1) Health_'
    Array [1, 'Enemy(2) ID_'] = 'Enemy(2) Health_'
    Array [1, 'Enemy(3) ID_'] = 'Enemy(3) Health_'

  10. #10
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    No, because you're setting the value of the array, and you only have one array object - so it only reads a value from the first Enemy.
    If you had a three duplicate arrays, then they would load values from three different Enemies:

    Array(1) [1, 'Enemy(1) ID_'] = 'Enemy(1) Health_'
    Array(2) [1, 'Enemy(2) ID_'] = 'Enemy(2) Health_'
    Array(3) [1, 'Enemy(3) ID_'] = 'Enemy(3) Health_'

    It's like if you say:
    + Always
    -> Counter: Add Health("Enemy")

    It won't add the health of every Enemy - only the first one, because there is only one counter.

    To store the values of all Enemies in one array, you'd need to loop through them, using a fastloop or foreach loop.

Similar Threads

  1. Quick question about alterable values
    By MonDieu72 in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 26th December 2013, 07:52 PM
  2. Question about alterable values
    By games1101 in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 18th November 2010, 03:17 PM
  3. [Request/Question] Pre-defined alterable values
    By Fanotherpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 5th February 2010, 12:16 PM
  4. Quick Question : Alterable Values
    By Alpha in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 14th September 2009, 01:13 PM
  5. A question about alterable values and decimals
    By chrilley in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th July 2009, 10:25 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
  •