User Tag List

Results 1 to 4 of 4

Thread: Having trouble loading from an array

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Having trouble loading from an array

    I'm making a flexible inventory system. It's a grid-based system that snaps items to the slots in the grid and has strings below the slots showing the item names. I have a bunch of variables that I can adjust like number of rows, columns, slot size, padding, etc. I have it set up so that it matches an array file. So every slot in the grid of the inventory represents a cell in my array. When I move an item around the inventory, I record the item name in the array. Then when I want to load the array file, I would start a fastloop to go through the array and check the cells to see if there's a name written. If so, use that name and the "create object by name" action to create the appropriate object.

    I'm having difficulty trying to destroy all the items in the inventory and clearing all the strings before loading the objects. All the inventory items are in a qualifier group, so I thought I could just destroy the qualifier group and set the string to nothing, since all the strings are instances so it would affect all of them. But when I try to do that and then load my array, I'm getting weird results. Only one of the objects is destroyed and another object doesn't seem to load. I tried checking the array file and it seems to be writing to the array fine. So I believe there's something wrong with my loading.

    I've attached my .mfa file, so hopefully someone can help me out. Thanks.
    Attached files Attached files

  2. #2
    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,365
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    This is a mean one. Fusion doesn't like you to start a fastloop in the same event where you're destroying objects, so what you need to do is to create another event just below the "Upon pressing L" event. Copy the condition from the other event and move the Start loop action down to the new event. This will fix your problem

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you popcorn, that fixed it. I wonder why Fusion doesn't like to start fastloops in the same event when you're destroying objects, sounds like a bug. I know I've run into this problem in the past too, it's nice to know the workaround.

  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,365
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Well, I assume it has something to do with the object selection getting messed up, and there's probably no easy fix for it. It would be nice to get an explanation from @Yves or someone else at clickteam, though

Similar Threads

  1. Loading an object from array when needed (loading an array in chunks)
    By fishrod in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2014, 07:01 PM
  2. Array save trouble
    By Om1nO in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 19th October 2011, 01:07 PM
  3. Array Trouble
    By EonDev in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th February 2008, 04:33 PM
  4. Array trouble
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th December 2006, 08:43 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
  •