User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: Duplicates and spreading values

  1. #11
    No Products Registered

    Join Date
    Jan 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    Quote Originally Posted by Popcorn
    There actually is a way:

    1: Place your 6 cars in the frame editor.
    2: Make 6 new objects, named ID1, ID2, ID3 etc...
    3: Give the cars a unique id, by placing an ID object on it so they overlap
    4a: In the event editor, make this event:

    * Start of frame
    + Car is overlapping ID1

    - Car: Set alterable value to 1
    - ID1: Destroy

    4b: Alternatively you can give each of the ID objects an alterable value A corresponding to their ID. ID1 gets value A = 1, ID2 gets value A = 2 etc... Then you put all the ID objects in a qualifier. This way you would only need one event in the event editor. First, put all ID objects in one qualifier, and all the objects that will get an ID in another qualifier:

    * Start of frame
    + Group.ID is overlapping Group.Object

    - Group.Object: Set alterable value A to alterable value A of Group.ID
    - Group.ID: Destroy


    I used ID as an example, you can of crouse use this technique to give the cars different car speed, health etc as well, by making Speed objects, Health objects etc..
    You do realize I would have to make 120 objects and name them appropriatelly If I'd have 120 instances of a car? I don't think this makes sense for any number greater than a few.

    Quote Originally Posted by Dynasoft
    Quote Originally Posted by KaiseanGames
    Take this scenario, for example.

    I create an object, say a car.
    Then I create a behaviour like you said.
    Let's say I have defined a complex logic behind the car, all in behaviors.
    Then I clone the object so I all of my cars clones have this behavior.
    Up to here, you are correct.
    But now, I playtest the game and then decide I want to change a minor detail in the car behavior.
    I can't simply change it on one place, I have to change it in ALL clones' behaviors.
    And this is not exactly the right way to approach a good object-oriented design.

    So, your proposed solution has many drawbacks when it comes to maintenance, cause it makes all subsequent changes decentralized (even if all the objects represent the same object class).

    Besides, behaviours have their own limitations.
    The real solution to that is to add the cars to a qualifier, and do the coding using the qualifier instead (in frame/global events).

    But I agree, would be nice to be able to override alt values of individual objects.
    The qualifiers should work in a way as an interface/inheritance model, not as the classing model. Using qualifiers would work, but it's a workaround, not the correct object-oriented behavior.

    classes should be classes, and instances should be instances.

    Let's wrap this up. At the moment, MMF interface does not provide a direct way to modify objects per instance. And that's it. Although I wish it would be added to the MMF eventually.

  2. #12
    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: Duplicates and spreading values

    Of course, I do realize that. No need to be rude, I just tried to be helpful. If you have 120 instances you should use fastloops anyway. You said 6 cars, and that's why I came up with that solution.

  3. #13
    No Products Registered

    Join Date
    Jan 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    Quote Originally Posted by Popcorn
    Of course, I do realize that. No need to be rude, I just tried to be helpful. If you have 120 instances you should use fastloops anyway. You said 6 cars, and that's why I came up with that solution.
    Oh, no. I didn't mean to be rude. It's my bad english... I apologize if you take that as something rude.

    I surely appreciate your input.

  4. #14
    Clicker Multimedia Fusion 2 Developer

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

    Re: Duplicates and spreading values

    People often work around this by making a separate editor which stores the data to file, and having your game load this file on start, create the appropriate number of objects and initialise them with values as it goes.

    Yes it's still only a workaround, but it works.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Spreading values in a random order across an array
    By Ibis in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th September 2012, 04:34 AM
  2. Spreading Values Over New Objects
    By variant in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 29th November 2009, 04:26 AM
  3. Having trouble spreading values on detectors
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th March 2009, 01:42 PM
  4. a little problem with spreading values
    By ruffgang in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 21st July 2007, 10:23 AM
  5. Spreading Values
    By stAtrill in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 29th January 2007, 04:47 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
  •