blackhornet's Forum Posts

  • This would happen if you enable the group and then that group's code is turned on so the same event is triggered in the next group, just due to timing. If you put a Wait 0 before the activate, it will get delayed until the end of the event sheet, and will only get picked up next time.

  • You'd place your events in a function, and then call the function from those two trigger events.

  • You can use Groups to toggle whole groups of events.

    For #1, The "Main" group would be active, all others inactive.

    For #2, the "Sound" group would be active, all others inactive.

    etc.

  • The little green arrow indicates that the "On key pressed" is a trigger, which works differently than a regular event. It gets called outside of the main script loop. The second way is the most appropriate mechanism to use.

  • choose(int(random(A,B+1)), int(random(C,D+1)))

  • http://www.blackhornettechnologies.com/ ... l_BHT.capx

    Event 10: pick by the frame BEFORE the nearest.

    Use On Pathfinding arrived, instead of speed=0

  • Your SuperExplosion (event22) code is destroying them right away. You'll need to refine your logic.

  • Problem Description

    Moving from 206 to 212, I am finding my loops are broken. I ran through all of the releases up to 212, and the issue appears only in 212, presumably a side effect of the other loopindex fix. When iterating a double loop of X & Y, and calling a function which also iterates using the same variables, even though the loop iterates the correct number of times, using loopindex() returns the last values that the function had, from the previous call.

    I suspect there may be other issues with this recent change, but this was the only case I could reproduce here.

    Attach a Capx

    Description of Capx

    Iterate in "x" and also "y" which calls a function that iterates the same names.

    Steps to Reproduce Bug

      Run and look in CONSOLE for debug statements.

    Observed Result

    The outer loop works once, but after that, the outer loop only reports (via loopindex()) the last values set within the function's loop.

    Expected Result

    The scoping of the loop names/variables should revert back to the scope of the outer call.

    Affected Browsers

    • N/A

    Operating System and Service Pack

    Win 8

    Construct 2 Version ID

    212

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • http://www.blackhornettechnologies.com/ ... Timer.capx

    I use LiteTween, but you should get it if you don't already have it. The idea is similar.

  • There is a built in Timer behaviour. Just set it to trigger after X second and have it turn off an instance variable. Check that variable to see if you should fire or not.

  • When line 1 runs, you set the variable to 100. Then line 2 runs, the variable is 100, so sets it to the other value. Change your events to check On tap first, then use sub events for the speed decoding using Else on subsequent items so that the variable is only checked once.

    On tap gesture

    -> Speed=200 --> set speed = 100

    -->Else

    -->Speed=100 -->set speed = 300

  • From the manual:

    Since triggers run upon an event happening, they aren't checked in top-to-bottom order like other events. This means the ordering of triggers relative to other events is not important (except relative to other triggers of the same type, since triggers still fire top-to-bottom).

    Since the triggers aren't actually the same type, you don't know the order they will be called.

    Ref: https://www.scirra.com/manual/75/how-events-work

  • Stick with integers and divide by 100 only when you need to get the value as a decimal.

  • The issue probably is the Wait, as there is no way to cancel a wait, so when you hit the key again, you set the disable but there is still that wait in the background, and it will kick in and cancel out your disable. Try using a timer, instead of wait. Then you can reset the timeout on the next key press if it comes in quickly, and you can push out the enable code.