User Tag List

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

Thread: Duplicates and spreading values

  1. #1
    No Products Registered

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

    Duplicates and spreading values

    I have an object that has a ALT value called PlayerNumber.

    If I create 6 duplicates (instances of an object) I can't set particular instance's Alt Value. Since they don't share the Alterable values, why is it impossible to set each value in edit-time?

    I can do the Spread Value, but that's even wors in my case - it assigns the value inversely than the order in which they were created. Of course, I can set the alt value to = (Count-Alt-1) to inverse it, but shouldn't one be able to simply change the specific Alt Value on a specific instance at edit-time?

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    I made a post about this a while back... It's a feature I really would like to see implemented eventually. Being able to set initial alterable values. It's the same sort of thing as setting an instanced object's position. If you can edit the initial x/y values of each instanced object... why can't you also edit the initial alterable values?

    Just seems like it would make a lot of sense and be really useful.

    But as of right now, yeah, you can't edit those initial values outside of doing it through events.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Nov 2010
    Location
    Switzerland
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    Hi Kaisean Games,


    Perhaps i missunderstood something but why would you use 6 instanced duplicates if you need to access them independently? Why not just using 6 different objects (clone command works wonders and if you have already coded something on the Objects Behaviours, then it would clone that code to the new Object too and the new objects would behave like to original one).

    Greets,

    jahkri

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    The simplest way to force which objects have which AltVars is to use a fastloop to create the objects. In your case, you would run a fastloop (call it "CreateObj" or something) 6 times. each time you create an object, you would set that object's AltVar to the LoopIndex of the fastloop.

    But you are correct, there is no way to do it in the frame editor. If this wasn't the case, then you would find it hard to deal with large groups of instances where you DO want them to share variable values.

    Mobichan

  5. #5
    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 Jahkri
    Hi Kaisean Games,


    Perhaps i missunderstood something but why would you use 6 instanced duplicates if you need to access them independently? Why not just using 6 different objects (clone command works wonders and if you have already coded something on the Objects Behaviours, then it would clone that code to the new Object too and the new objects would behave like to original one).

    Greets,

    jahkri
    It's simply the way of an object-oriented design. For example, I don't want to have 6 different (CLONE) car objects for the same type of the car. Then I would have to code the same behavior 6 times for each of them. But I want 6 instances of the SAME object so I can code the behavior for them only once, and then all 6 instances (which can have different alt values - for example, remaining fuel, armor level etc.) would have that same behaviour. What I want is already possible, but not achievable during edit-time. The thing is that the properties window shows the class (in programming sense) itself and not the object instance, which is a strange design decision.

    Quote Originally Posted by mobichan
    The simplest way to force which objects have which AltVars is to use a fastloop to create the objects. In your case, you would run a fastloop (call it "CreateObj" or something) 6 times. each time you create an object, you would set that object's AltVar to the LoopIndex of the fastloop.

    But you are correct, there is no way to do it in the frame editor. If this wasn't the case, then you would find it hard to deal with large groups of instances where you DO want them to share variable values.

    Mobichan
    Regarding your first paragraph, this is the way, but a hard way. Especially for any kind of level editing, because I need to enter coordinates manually. But for the purposes of my current game, it's ok.

    The other paragraph is a bit problematic. I am a .NET developer and I work much in MS Visual Studio. For example, the Windows Forms Designer in VS works the following way: If multiple instances are selected, the property window shows only properties that are common to all selected objects. If selected instances have different values, the properties are empty. But if I set that property, all selected instances' values will be set. This way I can change specific properties/values of specific instance, while still being able to select all instances and change the value. However, I am aware that the two IDE are conceptually different. I find VS way a bit more intuitive, but since MMF2 was built on a code base that has roots in previous versions of MMF (maybe even TGF) I would not be surprised if implementing property window the other way would be difficult.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Nov 2010
    Location
    Switzerland
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    If you code the behavior of one car in the Objects-Behavior, then everytime you clone the car, the code will be cloned to that car too. So you just have to code one car.

    You can code Object-Behavior by selecting the Object and in the Properties-Panel click on the Events-Tab and then under "Behavior" click onto the New-Button. Then click on the "Edit-Button" on the Right-Side of "Behavior #1" and then code your Behavior. If you clone an Object you have coded that way, then the "code" will also be cloned to the new Object.

    Greets,

    jahkri

  7. #7
    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 Jahkri
    If you code the behavior of one car in the Objects-Behavior, then everytime you clone the car, the code will be cloned to that car too. So you just have to code one car.

    You can code Object-Behavior by selecting the Object and in the Properties-Panel click on the Events-Tab and then under "Behavior" click onto the New-Button. Then click on the "Edit-Button" on the Right-Side of "Behavior #1" and then code your Behavior. If you clone an Object you have coded that way, then the "code" will also be cloned to the new Object.

    Greets,

    jahkri
    This is not exactly true.
    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.

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Duplicates and spreading values

    Quote Originally Posted by KaiseanGames
    It's simply the way of an object-oriented design. For example, I don't want to have 6 different (CLONE) car objects for the same type of the car. Then I would have to code the same behavior 6 times for each of them. But I want 6 instances of the SAME object so I can code the behavior for them only once, and then all 6 instances (which can have different alt values - for example, remaining fuel, armor level etc.) would have that same behaviour. What I want is already possible, but not achievable during edit-time. The thing is that the properties window shows the class (in programming sense) itself and not the object instance, which is a strange design decision.
    I totally agree. For MMF being so object oriented, it's definitely a strange design decision that they don't let you edit an instanced object's variables at edit-time.

    I've felt the same way about setting up games like this... Like what if you have 20 enemies on the screen and you want each one to have specific starting health, yet they are all the same enemy? It's just such a pain to do it with fastloops and events... I mean, I know everyone says "well it can be done..." but that doesn't mean "problem solved, forget about it". There's still the fact that it's just more sane to be able to do it in edit-time as well as in events if you so choose.

    Also it's a lot more complicated doing it with events because if you want specific values set to specific instanced objects, you first have to determine which object the game is labeling as what number in spread value, and then you need to compile a list/array of numbers to correspond with the order the game is ordering the objects so that they get assigned properly.

    Huge pain in the hindquarters when compared to just selecting the object in the editor and modifying the value in a couple seconds.

  9. #9
    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

    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..

  10. #10
    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

    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.

Page 1 of 2 1 2 LastLast

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
  •