planetarian's Forum Posts

  • 4 posts
  • Working with arrays in Construct is not fun, it's a lot easier to manipulate instance variables, and then copy them into the array.

    So I would toggle the icons like this:

    And when the inventory is closed - copy them back into the array. For example:

    > For each Icon ordered by Icon.ID
    .. Array set value:Icon.isActive at X:loopindex
    

    You can create a helper function WriteToArray and call it every time any icon in the inventory is changed - toggled state, dragged and dropped, re-sorted etc.

    I see. Thank you for your suggestion. I will probably just stick with your method of managing arrays and objects. It is indeed a pain manipulating arrays real time in Construct 3..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So I did eventually manage to get the array toggle to work by just squeezing bunch of conditions and a couple of Stop loops. I probably optimized it horribly but at least it works. But now I can't seem to pick the objects properly. How do I properly pick objects in a structure like this?

  • Since you have isActive variable on on the icons, why do you need an array to keep selection state? This task can done a lot easier without it.

    I also suggest using number type variables (0/1) instead of boolean, it's easier to work with them in Construct.

    I am very aware of the easy way to implement this feature, but the reason why I have it as an array form is because:

    1) These objects are dynamically created and tied to multiple of inventories that perform individually from each other(i.e. dozens of these objects are tied to inventory A, another dozen to inventory B, etc).

    2) These objects are drag and droppable and will involve sorting and reordering as well since they are in an inventory.

    3) Due to above reasons I figured using arrays will be significantly more efficient.

    So going back to the original question, I want to ask how to set up condition-action sequence that will jump an iteration during a loop, since it seems like Construct 3 does not have built-in continue statement.

  • Hello, I'm working on a selection system in Construct 3 where clicking on an object toggles its state. I've successfully implemented the toggling functionality for the array, but I can't seem to update the states of all non-selected items.

    Currently the array consists of object UIDs on the X axis and boolean values(0 or 1) on the Y axis.

    My goal is to untoggle every other object each time an object is clicked and toggled. I'm trying to figure out how to exclude a value from X axis from the loop then pick only the values except for the excluded one.

    Thank you very much in advance.

  • 4 posts