Enhancements for the "Repeat" Event Type

Hello fellow GDevelop enthusiasts,

I hope this message finds you well. Today, I would like to discuss an underrated gem in GDevelop’s event system – the “Repeat” event type. While it’s a powerful tool, I believe it could benefit from some additional features that could make it even more versatile and user-friendly. Let’s explore a few ideas that could elevate the “Repeat” event type’s capabilities:

  1. Expression for Repeat Count:
    It would be immensely useful to have an expression that allows us to retrieve the current number of repetitions within the “Repeat” event. This would enable us to create dynamic conditions and actions based on the repetition count.

  2. Condition for Specified Repeat Count:
    Imagine having a condition that checks if the “Repeat” event has occurred a specific number of times. This feature could open up possibilities for creating complex patterns and sequences in our games without relying solely on additional events.

  3. Action to Stop Repetition:
    At times, we might want to halt the repetition prematurely based on certain conditions. A dedicated action to stop the “Repeat” event would provide more control and flexibility in managing our game’s logic.

  4. Pause and Resume with Identifiers:
    Taking inspiration from the Tween behavior, implementing pause and resume functionality for the “Repeat” event using identifiers would be a game-changer. This feature could empower us to create interactive scenarios where we can temporarily halt the repetition and then seamlessly resume it.

It’s worth mentioning that these proposed enhancements could not only improve the workflow for developers but also encourage more creative use of the “Repeat” event type in game design. By expanding its capabilities, GDevelop would further distinguish itself as a user-friendly yet powerful game development platform.

I invite you all to join the conversation and share your thoughts on these suggestions. Let’s collaborate to showcase the potential of the “Repeat” event type and help shape the future of GDevelop.

Thank you for your time and consideration.

Best regards,
Reborn

  • Message generated with ChatGPT 3.5
1 Like

Not saying this couldn’t be worthwhile, but it is worth clarifying the following:

#1-3 are already currently possible, just use a while event instead of the repeat event, set the condition to check if a scene variable is less than whatever number of repeats you want, then increase the variable by one as the last action.

You can now use the variable by expression inside the event, as well as stop the repetitions by immediately setting the variable to above the repetition limit (or something silly like 9999).

As far as I can think of, #4 isn’t realistically possible, as both repeat and while events stop the rest of the event sheet from processing until the repeat count is completed or the while condition is false. Pausing it wouldn’t work as other events outside of the loop cannot be proccessed while it is running, and the loop itself cannot be accessed by other events outside of it for this same reason.

I’ve wanted something like this. It’s basically a for … next statement. It would be similar to the repeat or for each child event. A for next would have a variable name, start, end and step amount which could be positive or negative.

Looping is tricky. It’s helpful but it also can cause lagging and the appearance of an app being unresponsive. For me, it’s mostly beneficial for setting up a scene.

Kinda off topic, but even before I read that bit I already thought it might be chat gpt🤣

Never thought that about the resuming part, I guess I suppose that would only work if there was no conditions before the repeat event. I still stick with stopping a repeat execution.