netdzynr's Forum Posts

  • Looks like iOS just doesn't like the webm format? Changing to m4a appears to allow the project to completely load.

    Still wondering about my first question: is it possible to exit out of an event sheet?

  • OK, it seems the problem is sounds. Using the default import option, sounds are added to the project in webm format. When I delete the imported sounds from the project, it loads on iOS as expected. Is there an alternate sound format I can use? Or do sounds need to be formatted in some specific way before import?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there a way to insert an exit point in an event sheet to prevent code execution beyond a certain point?

    Also, any advice on how to troubleshoot a project that doesn’t completely load? The project runs fine in all desktop browsers but when loading on iOS (iPad), loading stalls at about 75%.

  • Thank you kriand, this is really helpful. I'm not new to programming, but I'm still quite new to Construct and need to figure out all the Construct ways of coding.

  • Thanks for the explanation. If I understand how a timer would work (it's quite possible I don't), I'd need to move the action outside of the function it currently sits in, so it falls in the topmost flow of the event sheet, and enable/disable triggering of the action using the allowLoop variable. Is that right?

    In any event, I wound up using (what I believe is) a recursive function with a timed delay since it's something I can explicitly call at any time. Seems to work OK.

  • I have the following repeat loop in an event sheet, and I want to be able to exit the loop arbitrarily. I figured by setting the value of the global allowLoop variable to 0 that the loop would stop running, but it doesn't. I even added a button in the layout to manually set the allowLoop variable to 0, and verified the zero value when clicking the button. What am I missing?

  • For anyone looking to do what I wrote below, one solution is to wrap each group of animations into its own function that can be called as needed. My approach to use some method to wait/halt all code execution is not appropriate. Thanks to Cipriux for getting me in the right direction.

    Cipriux

    OK, I have the wait at the front of the loop. Now I'm wondering how to detect when all the animations are done -- I need to delay any further code execution until the tween of the last sprite has completed. I know it's possible to compare tween values but I'm at a loss to find a way to halt the code. The idea is like this:

    > Do some animations

    > wait until all animations are complete

    > Do more animations

    > wait until all animations are complete

    > Do final animations

    > wait until all animations are complete

    > Execute remaining code

    Can you offer a suggestion? Thanks in advance.

  • Cipriux

    OK, I have the wait at the front of the loop. Now I'm wondering how to detect when all the animations are done -- I need to delay any further code execution until the tween of the last sprite has completed. I know it's possible to compare tween values but I'm at a loss to find a way to halt the code. The idea is like this:

    Do some animations

    wait until all animations are complete

    Do more animations

    wait until all animations are complete

    Do final animations

    wait until all animations are complete

    Execute remaining code

    Can you offer a suggestion? Thanks in advance.

  • Thanks for the thinking here, guys. It occurs to me that a function might be a better way to go in the end, but these are some decent options for me to try.

  • Is there a way in Construct to reference a variable's value dynamically?

    For example, if I create 3 global variables "box1", "box2", and "box3", with each having a different numeric value, is there a way to grab the value of "box2" by dynamically building the variable name, something like:

    n = 2

    x = value("box" & n)

    This is sort of similar to eval() in Javascript, but I'm not sure if something like the ExecJS expression can be used to somehow interact with Construct globals.

  • Cipriux

    Thank you so much -- your solution worked for me. Now I remember reading about the loop delay method somewhere. Many thanks!

  • I'm trying to insert a delay between the triggering of an opacity tween of 6 sprite instances. Seems like it should be straightforward, but regardless of what I try, all sprites begin their tween behavior at the time. I have this setup in the event sheet:

    What am I missing?

  • Thank you. I was wondering how to physically nest the statements and it took several attempts at dragging the lines in the editor to get them to orient properly. And now I realize that loop names can be variables [forehead slap].

    Aside from the numeric values, does this arrangement look correct?

  • Not sure if this will help, but one example I've seen is a standard fade transition:

    Kind of a lot to sit through, but it works. I seem to recall seeing a plugin or similar that provides transition effects, but I believe that was only for Construct 2.

  • I'm trying generate the above grid of objects dynamically (I want to be able to fade in each cell separately). The method I started using is

    System | for 1 to 5 > create-object "hex_slot" on layer "slots", x: hex_slot.X + (loopindex*150), y: hex_slot.Y

    This allows me to generate the first row. But each instance created has an opacity of 100, so I need to change the opacity of each instance to 0. Or say I want to set an instance variable value of the instance. Would I do this after each instance is created, or use a completely separate repeat loop that runs through all the created instances?

    Also, how do I increment the Y position value to generate the next rows of cells? Typically to build a grid I would use a nested repeat loop, something like this (pseudo code):

    X = 0, Y = 0

    repeat with v = 0 to 5

       repeat with h = 0 to 5

          create object at X+(h*40), Y+(v*40)

       end repeat

    end repeat

    How is this done in Construct, or is a different method needed?