Forum rules - please read before posting.

Bug with actionlist execution order

edited May 2023 in Technical Q&A

I've run across a really strange bug.

I have a really complex OnStart actionlist. It calls a bunch of different actionlists that run both in parallel and linearly. I don't think this bug has anything to do with this complexity, though, but I thought it was worth mentioning.

So OnStart calls Actionlist 1, which calls Actionlist 2, and actionlist 2 has logic that teleports NPCs to different markers depending on the TimeOfDay global variable. I only noticed this bug because there are a few markers whose position is changed by actionlist 2 (they represent the position of grains of corn on the ground, and their parent has different animation states that change their coordinates). Linearly, after those actions, the chicken characters are then teleported to those markers. I noticed the bug because the chickens are being teleported to the location the markers occupied BEFORE the animation of the parent was changed.

Now, that was the reason why I noticed the bug, but it's more widespread than that. Say there is a static marker near a tree, and Actionlist 2 teleports a lumberjack to it. If I toggle a breakpoint on the very first action of the OnStart actionlist, the game will be paused as soon as it starts, but the Lumberjack will already have been teleported to the tree marker when it pauses! I can toggle a breakpoint at any point along the long chain of actions, over three actionlists, and the lumberjack will still be found near the tree when the game is paused.

However, if I actually break the action chain (say, if I remove the connection from the first action to the second action on the OnStart actionlist), then the character will not be teleported.

It looks almost looks like AC is reading through the ENTIRE chain of actions, running all the teleport actions, and then running the other actions in order? How is that even possible? I don't know if this affects any other action type, but I haven't noticed any other problems yet.

Comments

  • edited May 2023

    I did some more investigating, and I think we can break this down into two possibly related bugs:

    (1) 'Toggle breakpoint' is not pausing the game at the correct action. The actionlist seems to run all the way to an action like Wait or Fade In, where the game is then paused. This means all sorts of actions beyond the breakpoint (like setting and checking variables) are being run.

    (2) An object>animate action (playing a custom clip with "wait until finish" enabled) that manipulates a marker's position is also run (you can observe it has changed positions when the breakpoint pauses the game), but any teleport actions after it will still teleport the object to the marker's former position.

    I will DM you a project with reproduction steps.

  • Thanks for the report - I will look into it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.