User Tag List

Results 1 to 6 of 6

Thread: Formations of objects (same object or not)

  1. #1
    No Products Registered

    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Formations of objects (same object or not)

    Hello everyone.

    It is possible to create an object relative to an object but with the xy cooordenates depending of diferent values?

    By example, I have the object in a XY position on the frame, and I want to create object like this but in a formation like a regiment of soldiers where we have depth and long of the formation. By example create a formation of soldiers (objects) of 10x10. So each xy position of each replica of the soldier is fixed relative to the original one.

    I need to control each position, becouse by example if a soldier die in front of the formation other soldier rear have to take the position of the die soldier.

    I have thinked in to use arrays but I don’t kown exactly how to implemented and translate coordenates to “create object” function.

    Thank you in advance.


  2. #2
    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)

    Re: Formations of objects (same object or not)

    After an object is created, that one object is automatically filtered in MMF2's Object Selection System. After creating it, any action you do to that object catagory will only effect that instance. This way you can create it anywhere and set it's X and Y sepeartely right after creating it.
    Working as fast as I can on Fusion 3

  3. #3
    No Products Registered

    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Formations of objects (same object or not)

    Thank you very much LB for your responese ,but I can understand very well.
    If I create the object in real time, throgh the "create object" in the "event list editor", how can I refer to this new objects in the even list editor if those object are created in real time?.

    By the way, until I need those object individual, I need to give orders in collective as a group. By example if I order to move to the principal object (captain or chief) all the rest objects might to follow it but in a determined formation, like a group of soldiers in a formation by example in column or line. I don't know if I explain it very well

  4. #4
    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: Formations of objects (same object or not)

    If I understand you correctly, what you want is the men to move in formations, and when a man dies, the man behind will move to the empty spot. And when you move the captain, the formation will follow, smootly turning around, changing the angle of all the men, but still maintaing the formation.

    An example of this kind of movement would be what are used in the Total War games.

    If that is what you want, I am afraid it hasn't been done in MMF2 yet. At least not as I am aware of, so I don't think there is any example availible.

    I think the only way to do this is to use arrays to put the men in formations. Then, when the formation is ready, you must loop through the array, calculate the xy position of that spot, and finally position the man that is assigned for that spot, to the xy position.

    You probably need a function to position the men. Like giving them a destinaition position and move them until they reach it.

    When the captain move, new positions must be calclulated.
    When a man dies, loop through the array and find the man is behind the empty spot and assign it to the empty spot. Then recalculate the positions.

    In order to be able to do this, I recommend you have a full understanding of arrays and fastloops. Perhaps you could also use the new For Each object for parts of this.

    There are several tutorials on how to use Fastloops and object ID's.

    Good luck!


  5. #5
    No Products Registered

    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Formations of objects (same object or not)

    Thank you Popcorn, this is exactly what I want to do.
    So, ¿I need 2 arrays for each formation?

    One array control the X position in the frame, and other array control the Y position of each caracter in the frame respect the officer or caracter which control the formation. If one position in the formation is empty and might to reassigned can be controled if X and Y position in the arrays are empty.




  6. #6
    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: Formations of objects (same object or not)

    I would say, don't start on this until you know the answer of that question yourself

    Start out simple by writing to and from an array, and then when you are comfortable with that, start adding objects.

    I would think you only need one array for this. A simple 2D String array that stores the spots in the formation.
    And I don't think you would need to put the positions in the array. Then there would be no need for an array, would it?

    0,0: Swordman
    0,1: Swordman
    0,2: Swordman
    1,0: Bow & Arrow
    1,1: Empty
    1,2: Empty
    2,0: Cavalry
    2,1: Cavalry

    There is your array that only stores the spots in the formation, not the actual positions. The positions are calculated when you loop through the array, taken into account where the captain is and which angle the formation is facing.

    But then again, I have never done this myself and I might be on the completely wrong track here.

Similar Threads

  1. Datagrid object and other objects: Getting other objects to overlap datagrid order.
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th August 2013, 05:38 AM
  2. Counting objects over another object
    By EdibleWare in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th January 2011, 05:22 PM
  3. how an objects follows another object?
    By xiero in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd November 2010, 01:13 PM
  4. Object Referencing & Sub Objects
    By Bor in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th April 2008, 04:52 PM
  5. Two objects overlapping an object?
    By teddyq in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 24th January 2008, 04:29 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
  •