Timer Pin Glitch

0 favourites
  • 6 posts
From the Asset Store
Tweakable and easy to use effects for your projects.
  • Problem Description

    ____ When an "On timer " condition is met for 2 of the same objects and and each one spawns an object, then you try to pin these spawned objects to the spawner, only the first spawner is picked and pinned to, However, the correct spawner is picked for any other variables or expressions you wish to pass on to the spawned object. ____

    Attach a Capx

    ____ https://dl.dropboxusercontent.com/u/530 ... litch.capx ____

    Description of Capx

    ____ The Cap X shows how when two cannons fire a laser, the laser gets colored correctly and even gets the proper angle, but gets pinned to the wrong cannon ____

    Steps to Reproduce Bug

    • Step 1 Click on the Button that says "Fire Laser"
    • Step 2 Observe the wacky pinning of the blue laser
    • Step 3 Repeat until you've had your fill....

    Observed Result

    ____ Blue laser is pinned to green cannon ____

    Expected Result

    ____ Blue laser should have been pinned to the picked blue cannon, as every other expression picks as expected ____

    Affected Browsers

    • Chrome: Yes
    • FireFox: Yes
    • Internet Explorer: Yes
    • Node Webkit: Yes

    Operating System and Service Pack

    ____ Windows 7 ultimate Service pack 1 ____

    Construct 2 Version ID

    ____ R 190 (64 Bit Steam) ____

  • Here are some other event combinations that cause the same problem when pinning

    https://dl.dropboxusercontent.com/u/530 ... xample.PNG

    The image above shows how even when not triggered, the same result is present

    https://dl.dropboxusercontent.com/u/530 ... sworks.PNG

    In this one I tried deviating the time slightly and this will pin properly 50% of the time. However, if I deviate the two timers by 0.1 seconds it pins properly every time.

    https://dl.dropboxusercontent.com/u/530 ... iggers.PNG

    In the above example, I use a different Object trigger (the button) and a "For Each" condition which ultimately does cause the lasers to pin properly; a functional work-around.

    Hope this helps!

  • Closing as not a bug - it's actually working correctly, given that the event runs with two instances picked, but your events assume there is only one object picked. Simply add a 'for each' after the condition and it works fine.

  • If this is working correctly, why does it pick individual objects for variables but not when pinning? or why would two timers triggering at the same time but within 0.01 seconds of each other sometimes register as firing at the same time, but not always?

    It just feels kind of broken since it works for certain cases but not in every case or even a minuscule delay causes random results.

    I should also mention using a "for each" brings a host of new problems. If your objects have two different timings they will then always fire off at the same time because its running the event for each laser cannon.

    The only work-around is to delay them by 0.1 so they run their triggers seperatly so then the timers can have different set times

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The problem is the event runs with two instances of 'Sprite' picked. Then you spawn 'Sprite3' from 'Sprite', which creates two 'Sprite3' instances. Then the actions that follow apply to both 'Sprite3' instances. In particular 'Pin to Sprite' takes an object parameter, and the way the C2 engine works this does not pair up instances, it will just find one 'Sprite' and use that for both actions on 'Sprite3'. If you add a 'for each' condition it then properly runs the actions once per instance, spawning one object at a time and applying the actions for just that one spawned instance. As far as I can see this entirely fixes the problem in general, there should not be any other problems from doing that.

  • Okay I think I see where my thinking was wrong, I assumed that since the turrets were picked individually for their variables, they would be picked individually for the purpose of pinning. But as you have stated C2 will not pair up instances for object parameters in the same way it will with object variables. I will simply try to work around this inconvenience. which so far, has involved simply adding object.iid*0.1 to any attack timer since the "for each" condition will cause all lasers to fire even when they are intended to have different timings or can have the same exact time as is determined by the player.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)