Circumventing Event Timing

This forum is currently in read-only mode.
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • I'm trying as hard as I can to work around the lack of a wait function, but it just isn't working.

    Every single event happens at once across the board, and attempting to prioritize or restrict the active events just causes freezing (using complex variable strings to kludge a wait function) or crashes (all the time division functions like 'while' just break eventually while waiting for input).

    There needs to be a simpler way to call events and cause delays (and no, functions aren't effective, unless you make a different one for every single game event and make constant calls back and forth, in which case I may as well be coding.) I don't want an entire scene to flash by in a series of ticks because I have no way to slow it down.

    Can someone help me figure out how to make the system wait without causing an endless loop or a crash?

    What would also be useful is a 'wait until user input' plugin, because that would at least solve a couple of the problems with having any kind of pausing in your game (allowing for prompting in a turn-based system, for example.)

  • timer behavior, timeline object, key press and enabling/disabling groups.

    Wouldn't any of those do the trick?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Timeline and timer seem to have a mind of their own, and attempts to work them in doubled the size of my event sheets and still didn't work.

    Theoretically I could separate everything into individual groups, but that would be equally as convoluted as making a function for every little event lineup.

    Keypress doesn't stop the system. It just allows for a key input while merrily wandering off through the code, even when I attempt to bracket it in with states/variables/groups/etc.

  • If your using behaviors that use timedelta, you could use timescale to stop those actions.

    There's a nice article on the wiki about it.

  • I just make my own timers (globals or pv's) and use a state machine to control events. I've never had any problem with that, even with complex tasks like choreographing cut-scenes.

    If you're having trouble with that method or the timeline object then I suggest you post your attempts so someone can help you work out a solution.

  • On the few occasions I've needed to delay the running of some actions, I'd just throw in the function object and call a function after a delay.

    What are you doing that requires so many of these delays as to make it impractical?

  • A turn-based battle system that requires deliberate separation of events with delays in between, to prevent events from not happening in a sequential order, eg.

    Player attacks (with corresponding movement)

    Delay until it finishes and slight afterdelay

    Damage floater

    Delay until it finishes and slight afterdelay

    Prompt for next turn

    It just burns through all of the events over the course of five ticks and I see nothing but the variables jump from initiating to done, even with dozens of events in between. And then crashes because there is no way for it to wait for user input without causing an endless loop behind the scenes if the user does not input.

    I'm attempting to get the hang of timescale, but it's honestly really confusing.

    The call function after delay I have tried in multiple ways but I cannot seem to get it to work, as it does delay the function call but delays nothing else.

    I just make my own timers (globals or pv's) and use a state machine to control events. I've never had any problem with that, even with complex tasks like choreographing cut-scenes.

    This is more what I'm looking for.

    I attempted to do this in a few different ways, and could not get it to actually work. Could you elaborate on how you do it?

  • [quote:3r1yrsfh]Player attacks (with corresponding movement)

    Delay until it finishes and slight afterdelay

    Damage floater

    Delay until it finishes and slight afterdelay

    Prompt for next turn

    I think I see what you mean. The function behavior probably is your best bet, but I would use it in combination with groups. You could then enable group player a with a function, at the same time disabling player b group.

    Timescale would be better for messages, pop up windows, imputing stats, etc.

    BTW the timer behavior does remember picked objects, but you cant make new timers. Its a bug I think, but you can add additional timer behaviors.

  • > I just make my own timers (globals or pv's) and use a state machine to control events. I've never had any problem with that, even with complex tasks like choreographing cut-scenes.

    >

    This is more what I'm looking for.

    I attempted to do this in a few different ways, and could not get it to actually work. Could you elaborate on how you do it?

    Here's a simple version that does basically what you outllined:

    http://www.box.net/shared/xdjh6kjg4d

    A state machine is basically you defining the state of the game, however you choose, and restricting events based on what that state is. In this example I define the state in global('state'), and use global('state') as a condition to control events.

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