Ecation's Forum Posts

  • Would be nice to have support for global layers for the dynamic layers feature.

    This way we could design our menus in a separate layout, without ever having to worry about including a layer with the same name in each layout. If there are tens or hundreds of layouts, it can be quite a chore.

  • That indeed does it! :)

    Thanks for your help!

  • After many years this still seems to stump me: I have some instances of a family outside the visible screen area. Every x seconds I want to take one of them and move them to the the visible area, but only if there are no instances of that family already on-screen. In other words, only one instance of that family should exist at the same time on the screen.

    I tend to go for the "is on-screen" condition, but then my subevents wont fire if that condition is false.

    Is there a simple way to do this or do I need to start adding variables to keep track of the amount of family instances on-screen?

    Tagged:

  • Objects can be added to multiple families. You shouldn't need to get rid of the old ones or consolidate variables.

    Thanks for your responses!

    The problem with the new family would be that it would not "see" any of the instance variables of the other families (in the set action dialogue), so I couldn't change them.

    tarek2 I think I might need to go with your idea of storing the family type in the y-axis of the array. That seems like the least inconvenient option that would let me keep a lot of my existing code.

    Thanks!

  • Thanks for your reply!

    The difficulty with "pick last created" is that it requires me to select an object, but I don't know which of the 20 objects to pick.

    Even families don't seem to help in this situation, since the objects can be members of two different families.

    I considered adding them all to just one family, but then I would have to move all the instance variables from the two families into this one unified family, which in a complex game sounds like a total nightmare..

    I wish I could just do what I do in JavaScript and store a reference to the newly created object..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have an array of 20 object names.

    When I call a function called updateObjects, I need to loop through the array and create the objects based on the object names in the array.

    After each created object, I need to change an instance variable value of that object (I'm just assigning the loop index to the created object).

    How can I refer to the newly created object in order to change it's instance variable?

    Tagged:

  • Thanks dop2000 that looks really promising!

    Do I need to do something in addition to typing that in the console?

    When I put this in the console:

    c3_callFunction("LogRuntime", [])

    I get:

    VM161:1 Uncaught ReferenceError: c3_callFunction is not defined

    at <anonymous>:1:1

    EDIT:

    The problem was that I was running the game in Debug mode, when I tried with regular preview, I no longer got that error! But now there is a pending promise, that doesn't seem to resolve..

  • Referring to this C2 thread:

    construct.net/en/forum/construct-2/how-do-i-18/values-using-console-116907

    I was wondering if there is away to explore the Construct 3 runtime interactively using the Developer tools console?

    Tagged:

  • You do not have permission to view this post

  • Thank you for your answers!

    dop2000 That is a brilliant function, will definitely keep that one around for reference.

    In my situation, I ended up solving the need of "backing down" or "traversing up" the hierarchy by storing the paths at various points into variables and loading the required nesting level from those.

  • Hi!

    I know I can dig deeper into a nested JSON object by adding new elements to a path.

    For example if I have an array of objects called NPCs then I can add ."my1NPC" to change the path to NPCs.my1NPC and then ".health" to change the path to NPCs.my1NPC.health and so on.

    But is there a way of moving back up in the chain? If the JSON.path is currently set to NPCs.my1NPC.health then how can I back it down back to just NPCs.my1NPC (for example)?

    Tagged:

  • Hi!

    Thanks for all the answers!

    Alextro, I donwloaded your file but didn't quite understand it.

    Dop2000, the Advanced Random -plugin solution looks good!

  • My goal is to use choose(1,2,3,4) to choose one of four values. But I want to always exclude the value which was chosen previously, which I store in a variable.

    Is it possible to exclude the previously chosen value from the arguments inside choose() with some kind of an expression?

    I would like to keep things simple and not use an array for this.

  • That's a clever and good solution! Thanks!

  • Hi!

    I have some variables in my game that indicate how many ready things the games has so far; for example a variable called "readyLevels" that I use to indicate how many levels the game currently has.

    I'm not certain how to handle these variables on app updates. The problem is that I'm using the save-feature of construct which will save all the variable states. So even if I indicate that the amount of "readyLevels" has increased from 10 to 12, when the end user loads the game, the saved state of that variable will override the new value and set it back to 10.

    What would be a good way of handling such variables when using the save feature?

    Tagged: