Question to "Call action"

  • #1, by LebosteinMonday, 23. March 2015, 08:25 9 years ago
    It seems an action, that is called from an other action runs parallel with that action, see (a) in my sketch. Is it possible to call an action like an inlude or a subroutine? In other words: it is possible to pause the main action until the called action is running, see (b) in my sketch? (more other words: the main action should behave as I would copy the action parts from the called action to the main action at the place of the call)

    I have many action sequences that I need several times in my game. So I would outsource them as single action sequences to call them if I need them. The problem is, if I call such action sequences, the main action (that makes the call) continues immediately.

    I have looked for a "Wait until action is finished" or something, but I found no solution for this problem.

    Key Killer

    621 Posts


  • #2, by DilatedMonday, 23. March 2015, 09:28 9 years ago
    One thing you could do (Depending exactly what he called action is?) you can figure out how many seconds/milliseconds it takes for it to complete. So after you call the action(pink) you can pause for 5000ms (or however long it takes for pink action takes to complete.

    SO an example is.

    Display character text
    Call action from another scene
    Pause for 5000ms

    Display character text
    Display animation guybrush swordfights.

    Hope that helps?

    Forum Fan

    149 Posts

  • #3, by brut69Monday, 23. March 2015, 11:07 9 years ago
    Alternatively you can create 2 actions. 1 which will be the main and 2nd which will be the main again whilst including the "extra" one.
    Then with an if statement call the corresponding one rather than calling an action inside an action

    Great Poster

    266 Posts

  • #4, by AlexMonday, 23. March 2015, 11:58 9 years ago
    Actually it's not exactly like in a), the other action starts once the first action is finished or paused (wait for..., pause action part).

    You're right, it should behave like b) in your sketch. Unfortunately we have to keep the current behavior for backward compatibility, otherwise it would break a lot of games. Maybe there is a solution (I've got an idea), I'll try it out in the next few days...

    Great Poster

    378 Posts

  • #5, by LebosteinMonday, 23. March 2015, 12:24 9 years ago
    In my case the called action starts immediately like in a) and the main script continues in the same time.

    @Alex: I think both behaviours can be useful. A checkbox inside the "call action" definition could be useful to change the behaviour ([x] Wait until called action is finished)

    @brut69: That is exactly what I want to prevent. To blow up the game with double, triple or multiple redundant code blocks that makes it hard to maintain and modify...

    Key Killer

    621 Posts

  • #6, by brut69Thursday, 26. March 2015, 21:58 9 years ago
    In my experience the two run in parallel (which is a good thing/feature)
    The only way to avoid it is to do what Alex said with a controlled pause

    Great Poster

    266 Posts

  • #7, by afrlmeThursday, 26. March 2015, 22:31 9 years ago
    I believe this has been addressed for the upcoming release. There's something mentioned about called actions in the build changelog anyway. I'm assuming it's about this.

    Another approach for b would be to create multiple called by other actions & just have them trigger the required action at the end of each action block.

    Imperator

    7278 Posts

  • #8, by LebosteinFriday, 27. March 2015, 11:00 9 years ago
    The only way to avoid it is to do what Alex said with a controlled pause
    This is a dirty hack and only helpful in some situations....

    I believe this has been addressed for the upcoming release.
    Would be nice!

    Key Killer

    621 Posts