Having trouble loading from an array

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

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

  • 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 :)

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

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!