Object doesn't wait and flash, how to fix?

  • Hey guys, another thread by me.

    This time the problem is this;

    [attachment=0:z65f2dke][/attachment:z65f2dke]

    What happens is that the enemy gets frozen, time scaled to 0 as per events. Then what happens is the enemy waits 10 seconds without flashing and then turns invisible.

    What should happen is that, enemy gets frozen and time scaled to 0 as per events, then waits 9 seconds, flashes for 1 second and returns to normal.

    Anyone know how to fix this?

    If I just use the flash action without the wait action, it works fine. If I use the wait action without the flash action, it also works fine.

    Can anyone please help out?

  • The wait action usually breaks the picking, specially in families. After the wait action, probably all the objects in the family will flash. Also I think the wait action doesn't affect the enemy that's been frozen since its time scale is zero (I'm just guessing here)

  • I'm guessing the "wait" action ignores the time scale ?

    If the wait is really the problem, try using a variable that you use as counter (a separate event that adds 1 every 1 second until value = 9, then reset to 0 if not frozen)

  • The wait action usually breaks the picking, specially in families. After the wait action, probably all the objects in the family will flash. Also I think the wait action doesn't affect the enemy that's been frozen since its time scale is zero (I'm just guessing here)

    No, after the wait action just the "frozen" object which was hit by a weapon shot "flashes". My problem is that is doesn't flash correctly, and instead just turns invisible and then seemingly becomes immune to being frozen again (but that's on another set of actions I set up I think).

    I'm guessing the "wait" action ignores the time scale ?

    If the wait is really the problem, try using a variable that you use as counter (a separate event that adds 1 every 1 second until value = 9, then reset to 0 if not frozen)

    I might try that with the value, as for the wait action being the problem, the actual problem shows up when flash and wait are used together with a family. I think. If just wait and family, or flash and family are used, then everything works fine. Regardless of it's timescale being 0.

  • Order matters.

    The Bool should be first since the trigger is constant, and waiting to set the bool......

    Time scale should be set next

    Then wait

    Then restore time scale

    Then flash

  • 'Wait' does not stop the event from running again. Since you only set 'Is frozen' to false after 9 seconds, the event continues to be true for the next 9 seconds, queuing up a new wait every tick. So at 60 FPS it will queue up 540 waits which will all conflict with each other.

  • [attachment=0:mr1kvjhf][/attachment:mr1kvjhf]

    Using a "Trigger Once" condition solved the flash not working, but it start flashing when the object time scale is restored.

    And if I use a "wait" action for the 1 second while the flash finishes, then the object turns invisible during the wait action, restores time scale and sets frozen to false then resumes flashing.

    So thanks Ashley for reminding me that the event is continuous.

    newt

    Tried that but it gets the same result as my events in this post's screen cap. I need it to flash and then when it stops flashing, runs the next actions.

    I tried using a "On Flash Stopped" sub event with the restore time scale and Frozen set to false actions, but then the sub-event never runs. If I use a stop flash action after the flash action, it obviously stops the flash as soon as it starts, making the object invisible.

    It'd be cool is there was a "Flash Wait" action, that puts the rest of the actions on hold while the object flashes.

  • Behaviors do use timescale via dt.

  • Try Construct 3

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

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

    Can you post a screencap of how you would do it?

    I tried setting the timescale to something like 0.0001 and adjusting the behaviours and waits accordingly, but then my player takes damage, even though I set the damage event the way so that the player only ever takes damage from enemies if they're not frozen.

    I shoot the enemy, they're frozen. I step on them, player still takes damage. This happens if the time

    scale isn't 0.

    If I set bullet to be disabled so they are effectively frozen, along with making their frozen instance variable set to true, then only the first enemy I shoot freezes, they rest are immune. And then when the one I shot unfreezes, he becomes immune himself. Except I don't take damage from colliding with them because they're still frozen. Even though the last action in the event is to set the "Frozen" bool variable to false.

    Either I'm retarded, or something is buggy in the engine.

    The closest I've gotten is making the enemy freeze, waiting 9 seconds, then the enemy unfreezes and flashes. Rather than flashing and then unfreezing.

    I've tried using multiple events, triggers, a ton of different variations, I've tried not using the timer and option for an event that increases a local variable by one every second so I can use that as a timer instead of wait. NOTHING WORKS.

    Honestly, I'm thinking of asking rexrainbow to build a freeze plugin where you can set a "wait to unfreeze" time along with a "flash before unfreezing" time.

  • If you have set object time scale to 0, how is the Flash behaviour supposed to work considering it "affects the object's behaviors and its own dt expression"? Also for this reason you can't have a Timer behaviour on the object (which would be better than a Wait).

  • codah, if flash had it's own time scale that would just be great.

  • Use a group to isolate the events you don't want to happen when the enemy is frozen, then on Frozen, set it inactive; on Not frozen, activate it again.

  • You need to disable whatever else you have the object doing while it flashes first.

    Hard to say what else without knowing what that is.

  • Use a group to isolate the events you don't want to happen when the enemy is frozen, then on Frozen, set it inactive; on Not frozen, activate it again.

    It doesn't show on the screencaps, but the events are in their own separate group.

    You need to disable whatever else you have the object doing while it flashes first.

    Hard to say what else without knowing what that is.

    The only thing the object is doing while is a flashing is the bullet behaviour,

    are you suggesting that I wait for the 9 seconds, restore time scale, disable bullet behaviour, flash and the enable the behaviour?

    There's a bug where the enemy still damages my player despite it being frozen, but I'll try to work around it.

  • "are you suggesting that I wait for the 9 seconds, restore time scale, disable bullet behaviour, flash and the enable the behaviour?"

    Sure, unless you are doing something with acceleration.

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