Forum rules - please read before posting.

Action list buggy execution

Here is the situation. Two scenes: (1) Start Menu (2) First game scene.

From the start menu there is a button: New Game that calls an Action List to do:

  • Set global variable to true.
  • Scene switch to the first game scene

In the first Game scene, onLoad has an action list that checks for this global variable and if it is true it runs an action list, lets call it "introduction cutscene".

The game has two player characters.

Here comes the problems.

  • IF I load the "first game scene" and I run "introduction cutscene", it goes smoothly.
  • IF I load the "start menu" and it follows the normal flow, it is all buggy.

Cases:

  • The players are set with "Teleport inactive" to two different start markers/points. They are teleported to one of them (I cannot determine why that one and not the other), they collide... a mess. I found a workaround by making the start point only available for one character or another. But in my opinion this is a bug and it should not be needed.
  • The Move To action (a player has to go to another marker) using path finding does not work (Unity navigation and so on works perfectly during normal gameplay).
  • Recently (I have spent lot of time trying to find work-arounds), I saw a warning saying: "Cannot update position of player 0 because that Player is currently active!"

Apart from the fact that maybe there are scenes in memory in contrast with the case that I just run the scene (maybe the "this scene" options mess up in the actions), in the menu scene, as the player are created, I had to create a off-screen platform where I just let them be there.

Any light is very appreciated.

Thanks in advance!

Comments

  • I'll need more details on how to recreate these issues.

    What are your AC and Unity versions?

    IF I load the "start menu" and it follows the normal flow, it is all buggy.

    If a scene is opened through "natural gameplay", i.e. use of the Scene: Switch Action as opposed to loading a save file, then the scene's OnStart cutscene is run - not OnLoad. OnStart should be used to run a scene's introduction cutscene.

    The players are set with "Teleport inactive" to two different start markers/points.

    If you have two players, then you'll only have one inactive Player - use the Player: Teleport inactive Action to move the inactive Player only. Though, if you're referring to their game-starting position, this can be set in the Player's "Start data" window in the Settings Manager.

    But in my opinion this is a bug and it should not be needed.

    If you can provide steps on how to reproduce the issue, please share and I will attempt a recreation.

    The Move To action (a player has to go to another marker) using path finding does not work

    What happends instead - does the Action not run, or hang indefinitely? Is this in a gameplay-blocking ActionList, with Wait until finish? checked in the Action?

    Enable the AC Status window from the bottom of the Settings Manager - that should report which Player is active, and what ActionList(s) are currently running. Does the report match up with what's expected?

    I saw a warning saying: "Cannot update position of player 0 because that Player is currently active!"

    Can you share the message as it appears in full, stacktrace included?

  • I'll need more details on how to recreate these issues.

    Indeed. I just did not know what to send to help :)

    I will not reply in the same order, as I could make it work, but I left you some notes in case you want to use them for future improvements.

    The Move To action (a player has to go to another marker) using path finding does not work

    What happends instead - does the Action not run, or hang indefinitely? Is this in a gameplay-blocking ActionList, with Wait until finish? checked in the Action?

    It did not move, and yes, wait until finish was on. A warning here saying: "movements have been disabled, please check your engine settings" would help a lot.

    What you said: "Enable the AC Status window from the bottom of the Settings Manager" gave me the hint as I said Movements were disabled. This was because in the Menu screen I did have to disable the menus that appears by default in the game screen and I did also disable movements to avoid my players in the offscreen platform moving to somewhere.

    If you have two players, then you'll only have one inactive Player - use the Player: Teleport inactive Action to move the inactive Player only. Though, if you're referring to their game-starting position, this can be set in the Player's "Start data" window in the Settings Manager.

    Two things here:
    1. I suggest to change "Teleport inactive" to "Teleport inactive player". I wondered what in the hell the inactive word was doing there, but never past by my mind the idea of inactive player.
    2. I could not find Player's "Start data" window in the Settings Manager. And I miss something like that because the natural way for me would be able to specify the start position for each player separately rather than use a list action on each screen to say where the second player goes. I am using the latest version of AC, is there any screenshot where I can find that window?

    If a scene is opened through "natural gameplay", i.e. use of the Scene: Switch Action as opposed to loading a save file, then the scene's OnStart cutscene is run - not OnLoad. OnStart should be used to run a scene's introduction cutscene.

    I find this pretty confusing. I have read several replies of yours in the forum to catch the idea, but now I know why it is confusing. In unity similar events are being used with different semantics. Instead of OnLoad, something like OnRestoredGame would give much better idea. Same from OnStart. I would suggest something like OnSwitched, AfterSwitchAction, OnAppear, OnFocus... but I guess it is hard to make this kind of change now.

    I do not see the use case where something that is loaded from a file will not want to execute the "OnStart" actionlist, as I think there may be things that you want to do in both cases. But anyway, I took notes and I will write the logic according to that.

    Thanks for all your help as always,
    David

  • A warning here saying: "movements have been disabled, please check your engine settings" would help a lot.

    A fair suggestion, thanks.

    I could not find Player's "Start data" window in the Settings Manager.

    A text tutorial and video on Player-switching can be found here.

    I do not see the use case where something that is loaded from a file will not want to execute the "OnStart" actionlist, as I think there may be things that you want to do in both cases.

    If you haven't seen it already, an alternative to the OnStart / OnLoad cutscene fields is to use the ActionList Starter component.

    This component serves as a replacement that can be used to trigger a given ActionList when the scene starts, is loaded, or both. If Player-switching is enabled, you can also specify whether it the scene is loaded due to switching Player character.

    For more details, see the Manual's "ActionList starter" chapter.

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.