User Tag List

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

Thread: Creating Objects by name and then picking them

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2009
    Location
    Australia
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating Objects by name and then picking them

    Hi
    when using create object by name is there any way to pick the Active object I just created and do something with it like set it's animation frame etc?
    I currently have a list that contains all the names of the objects I would like to create and I'm using create object by name to add them to my game but I can't think of any way to pick them once they have been created.
    Any help would be appreciated.
    Thanks.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 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)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    38
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Any actions apply to the object created in the same line as creation else you will have to store the fixed value or create an ID for it on creation.

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,446
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Picking can be tricky. In my testing ... using the Foreach extension was the "only way" to pick and work with a specific object. I agree this process does need work and some new extensions to make the process easier. The Foreach loop picks active objects in reverse order ... so be aware. Again there might be a different way of picking but I have not found it based on my testing.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    124
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I had the same problem in a game to generate random objects from a pool list, I didnt find how to do it and changed the code.
    Now I thought to a possible way, it should be tested, now a cant verify it but my idea is this.

    1) Give to all the objects in the list a Flag "JustCreated" setted On and the same Qualifier.
    2) Create the object by name from the list
    3) Start a "Foreach Loop" on the Qualifier, for example "CheckCreation"
    4) On the foreach loop "CheckCreation" + "JustCreated" is On: do wath you need to do using the qualifier and remember to set the flag "JustCreated" to Off

    I think it should work, it is to be tested.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    124
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I tried it and seems my idea is working, take a look.
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    570
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi @10mbra1, nice example. You don't really need the foreach loop, though! As long as the objects you are creating by name possess a qualifier, you can simply create by name then apply actions to the qualifier in the same event, and the correct object will be scoped.

    Your example without the foreach loop: PickCreatedByName_2.mfa

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    124
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Intersting optimization, simply the Qualifier did the work, we are always lerning new things
    I am not at pc so I cant se the file... I suppose at this point the flag is useless.

    Edit:
    Thinking about this... it is very simple for scooping objet. Had I focused this 5 months ago I wuold have saved days of work.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    396
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Object picking becomes a lot easier if you can store a dedicated identifier value on it, then compare that to a value on something else. For instance, if you have a mouse cursor active object that stores an object id value when it collides with that object, then upon pressing left click, the object with an id value that matches the id value stored in the mouse cursor object sets its internal flag "Click and Drag" on. Using this method you can even have objects stacked on top of each other & only a single one will attach to the cursor.

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2009
    Location
    Australia
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi thanks for all of your responses, I have a new related question. I noticed that when you create an object by name the frame seems to need at least one instance of the object otherwise nothing is created. I'm in the process of making a level editor and I was planning on using create by name to place objects so that I don't need to create a new event line for every object in the game since there could be hundreds of them. However if I need one of every object in the main frame to load/build levels is that likely to impact performance? any ideas on how I go about handling the situation? would it actually be better to use a line for each object?

    any help would be appreciated
    thanks.

  10. #10
    Clicker Fusion 2.5 MacFusion 2.5 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)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    38
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Did you uncheck create at start?..

Page 1 of 2 1 2 LastLast

Similar Threads

  1. picking and randomizing objects
    By VinnieG in forum Fusion 2.5
    Replies: 2
    Last Post: 15th January 2017, 03:04 AM
  2. Problem with picking duplicate objects
    By Simon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 28th March 2009, 12:41 AM
  3. Picking Objects with Layer Object
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 6th February 2009, 08:56 AM
  4. MM2 - Picking objects on frame
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 15th July 2008, 04:43 PM
  5. Picking Objects in a zone
    By danjo in forum Extension Development
    Replies: 0
    Last Post: 26th January 2008, 11:04 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
  •