User Tag List

Results 1 to 8 of 8

Thread: Create Object Relative to Qualifiers

  1. #1
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)

    Create Object Relative to Qualifiers

    Hi,

    i found something that you may check for the next build

    When you create object relative using their own qualifiers and the XY is 0 it fails and build until reach the object´s limit.

    but if you use the same qualifiers but relative different than zero it work OK. after further testing this is not true,

    This not happen when using different qualifiers and zero distance.

    Here the example


    EDIT: i have made a mess here, the problem persist even if the distance is zero or not, sorry to send wrong info!
    Attached files Attached files
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  2. #2
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,846
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)
    Hi,
    I found problem when create object related to qualifiers as well.
    Please look this MFA.
    Sorry if it different cause of problem.
    Attached files Attached files

  3. #3
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ASD View Post
    Hi,
    I found problem when create object related to qualifiers as well.
    Please look this MFA.
    Sorry if it different cause of problem.
    i will take a look and let you know
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Using the "create object relative to another" action will create 1 instance of that object relative to each object that is currently scoped, then scope to the created objects.
    When you run the fastloop that creates objects relative to themselves, you are exponentially scoping the objects as you create them and doubling the amount created each loop

    On frame 2, set it to 5 loops and it makes 31 objects. Set it to 10 and it makes 1023 objects. Its 2^x - 1. At 100 objects, it attempts to make 2^100-1 and runs into the maximum number of object limit, 1.26x10^30 objects and all.

    The reason your X/Y offset has an effect is because you have enabled the "Deactive/Destroy when too far from playfield" properties of the objects.
    Because some of the objects are logically spawned outside the playfield due to the offset, they are destroyed and reduce the number of created objects.
    If you merely disable those parameters, the objects again flood the stage up to the maximum number, which is 500 by default. Set this to 20000, and you'll crash your application in no time.

    You'll notice the object count goes down- this is because some objects spawn far enough away from the frame to be outside of it, but not far enough to be inactive or destroyed, but when they move in a random direction, they might get far enough away to be destroyed.




    In general, if you only want to make 1 object with an event, you should never spawn it relative to another object, and instead use the default create dialogue (or the create by name extension) and then set its X/Y coordinates with events. This is way more stable, you never know how it could get screwed up otherwise.

  5. #5
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Thanks Pixelthief!

    i know all you mention before, but when you create and object (is an object right? not objects) unless i want to create a group using qualifiers in that case is what you mention before in the first run (if i start with one) i made 2, after 4 after 16 and go on. but again i want to create is an active object not a qualifier.

    the create relative is a position not a quantity (right?), the quantity is defined by the object i want to create.

    at least is what i take from help files

    "Create Object
    This very important action creates an object of your choice in the frame during application runtime. You can position the new object at specific coordinates on the screen or relative to another object."

    "The Create New Objects object addresses issues related to sets of duplicate objects. On the outside, duplicate objects look identical and are difficult to tell apart. However, individual objects within a set of duplicates can be selected by their internal variable values or at random. A group of duplicates can be selected according to which zone of the frame the duplicates are in, or all duplicate objects can be selected. This object can be used to manipulate groups of duplicate objects or individual objects within a set of duplicates, independently from the rest of the set."
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well the question is really, how many objects do you want to create each time you use the Create Object() action. Is it supposed to be 1 created, and hence 1 per loop? Or should it be 1 created for each object, which raises exponentially?

    When you use the Create Object() function, if you aren't using a position relative to another object, it creates one and only one object. However when relative to another object, whether thats through a qualifier or directly referencing, it creates one object for each instance of the former that is scoped (referenced) by the event. Lets say you had 10 "Bad Guys", with value A from 1 to 10, 1,2,3,4,5,6,7,8,9,10. Then you ran an event that said:

    +Value A of Bad Guy >= 6
    =Create Bullet at (0,0) from Bad Guy

    This would spawn 5 bullets, at the 6,7,8,9 & 10 bad guys. The value check would scope only those with A>=6, and then for each of them, a bullet is spawned
    Using qualifiers or offsets other than 0,0 shouldn't have any effect on this, qualifiers merely act as a different way to reference all the objects in their group.
    You can't create qualifiers, they aren't objects. They are a class of objects, one or more different types.



    Now heres where it gets funky. MMF2's create object() function has a tricky bit where it actually modifies the object scope list and scopes the new objects. When the new object is created, all of previously scoped objects of that type are forgotten, and instead it scopes only the newly created object. It doesn't matter how many Bullets you specified in the conditions or narrowed it down to, once you create a Bullet object, only that bullet is referenced for the remaining actions in that event. So any lines like "Set X Position" or "Set Value A" will apply only to the newly created object, while if you put those same lines just *above* the create object, they'd apply to whatever objects were scoped.

    Say you have those same 10 bad guys, and a line that says:

    +Always
    =Create Bad Guy at (0,0)
    =Add 1 to Bad Guy value A

    The value A of the original 10 bad guys would be unchanged by this event the first time it runs. Even though it says "Always" as the only condition, meaning all instances of bad guys are scoped when you head into it. As the screen fills with bad guys, the A value of the original 10 never changes and the new ones have their value set to 1 and never change either.
    However if you slightly modified the order:

    +Always:
    =Add 1 to Value A of Bad Guy
    =Create Bad Guy at (0,0)

    Then the value A of each bad guy would raise each frame, while a new one is created at A = 0
    If you create more than 1 object of a type with more than 1 create object event, then all the new instances are scoped, it doesn't forget the other created ones each time you make a new one, but adds it to the list and only forgets the first time. So you can create 10 in a row, apply the actions, and it will apply to all 10 created new bad guys and none of the original ones. BUT, if you use the "create relative to object" like in your example, it bizarrely only scopes the last created object. Which is weird. If you create more than one copy of a "relative to object" object creation event? It goes weird, they all get referenced, I simply don't understand the logic behind it.


    Now heres where it gets *incredibly* funky. There is a glitch in MMF2, that this logic doesn't work quite right. See how the code after a create object applies only to the newly created object? Well if the create object() function fails to create a new object, it doesn't change the scope list. If your game reaches the maximum number of objects, as your example does, the create object will fail because of too many objects. That line is skipped, and it continues on and applies the following lines. However, you probably wrote those lines expecting it to only apply to the new object. Now it will apply to all scoped objects from the conditions- which is probably *all* objects of that type. One result is that when object maximum #s are met, events like that will often make objects clump together as their X/Y values are initiated to the same position when they weren't supposed to be.

    Yet if you used a "create object relative to another" event for a referenced object of which none exist, no new objects will be created, but the scope list will be forgotten anyway and the following events don't apply. It makes no sense.

  7. #7
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Sorry not agree with you in this (point one of your article),
    try this!.

    If you get my example in the first frame and get the brown/ocre box, maker smaller and clone 20 time, (if you see all the object have the handshake qualifiers)

    in the create object relative change the position to something in the center.


    run the example

    you will get only 100 object what is correct!

    the problem is a confusion that the create object have when the object to be created share the same qualifier.
    Attached files Attached files
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  8. #8
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Hi PixelThief,

    after update to 257.1 now i got the same result as you!.

    this is the second time that i update MMF and i get different behavior than previous update, i need to check why, i did a full install some time before but now just the update, i will have to check to see what it is.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

Similar Threads

  1. create objects relative to another object problem
    By 1234cb in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th April 2013, 04:38 PM
  2. How to make an object always stay at a position relative to another object when yo...
    By StardustSpeedman in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 2nd June 2012, 01:13 PM
  3. Create object relative to a qualifier
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th January 2011, 07:36 PM
  4. Create object relative Xmouse/Ymouse?
    By SP6MEN in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th April 2010, 01:50 PM
  5. Create Object relative to X/ Y Action issue
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd January 2007, 01:07 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
  •