detocroix's Forum Posts

  • 3 posts
  • While I agree it is most likely behaving as intended (as was proven with the wait loopindex), it is unnecessarily complex way to handle it. In almost any engine/language you can do a normal yield/sleep with time in any point off a loop to add delay. The case is normal here too, except you can't directly type in time, but have to use set variable and adjust from there.

    Clear, simple, something user can randomly conjure up, follows logic Construct 2 uses everywhere:

    For loop 1 to 9

    ---- System Wait (1.0)

    ---- Do stuff

    Same (mostly), but less intuitive for user:

    For loop 1 to 9

    ---- System Wait (loopindex)

    ---- Do stuff

    Thank you for solving my issue though

    Edit: Ah! But it should also work as:

    For loop 1 to 9

    ---- Do stuff

    ---- System Wait (time)

    The reason why it should work is because it should run loops from top to down and a loop at a time. So it should first "Do stuff" then pause (loop index 1), after the pause it should run next index. It definitely should not run all indexes first and then pause the current loop indexes.

    In the current system if I do:

    For loop 1 to 10000000 (10 million)

    ---- System Wait (loopindex)

    ---- Do stuff

    It runs the loop cycle 10 million times and just sets different wait times per cycle? To me, it sounds extremely inefficient VS running each loop separately with Wait (1.0) and continuing to next index once last one is completed.

    p.s. I'm not a real coder. Just Unity game designer who discovered Construct 2 and forgot what I did before, so my explanations might not follow any real code logics

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    FOR loop with WAIT action doesn't pause the FOR loop for the wait duration. WAIT action in beginning of the FOR loop will pause the FOR loop for the duration of WAIT and then process all steps immediately but does not yield per loop. WAIT action at the end of the FOR loop will yield at that point, but again doesn't actually affect per loop.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/238 ... Issue.capx

    Description of Capx

    ForWaitIssue.capx contains simple test where a function is called at beginning of layout and the function runs a FOR loop with WAIT action. Orange square (named almost appropriately) should move once per step per second until 9 steps are made (from top to bottom of screen).

    Steps to Reproduce Bug

    • Add Sprite to scene
    • In event sheet add System -> FOR loop
    • Add bigger than 1 to the end index so that FOR loop is run more than once
    • Add WAIT action with any observable second amount to the FOR loop
    • Add action you wish to loop, in this case add cumulatively something to Sprite position

    Observed Result

    The Sprite moves all the cumulative steps in one frame.

    Expected Result

    The Sprite moves one step per FOR loop cycle with WAIT amount of delay per cycle.

    Affected Browsers

    • Chrome: (not tested)
    • FireFox: YES
    • Internet Explorer: (not tested)

    Operating System and Service Pack

    Windows 7 and SP 1

    Construct 2 Version ID

    Release 178 (64-bit), free edition

  • Hello,

    I'm making Star Control 2 super melee (SpaceWar!, Asteroids, whatever rings the bells most! ), I have one SHIP -object that contains all my ship variations, but I'd need to draw ship image on to the GUI and I don't want to make a manual copy of it nor a copy in general because it adds extra work if I end up having dozens of ship variants.

    I wish to draw the green ship (SHIP -object default animation frame 0) to the purple square in the GUI, but I have no idea how or if it is even possible. I have tried set animation with it, but it doesn't feel like it is possible... I could try writing proper code for it via Javascript SDK but I'd like to do it within the Construct 2 if it is possible.

    Best Regards,

    Detocroix

  • 3 posts