Forum rules - please read before posting.

Struggling with player switching

Hello,

In the game I am developing I have to change the main character model. The main/defaul character is an old man, but we have 2 scenes where you can control his young self. I have 3 and I have tried aproaching the player switch in 3 forms:

By not having character switch enabled and just placing the prefab on the scene
By having character switch enabled on and switching trough action lists
By having character switch enabled and using action lists with the prefab on the scene

all  3 forms lead to the same problem - If controlling a non-default player character, the player character gets deleted and a new default player spawns on 0,0,0 when a dialog or cutscene is skipped.

Am I doing something wrong or is this a bug?
Thanks in advance.

Comments

  • edited February 2017
    Thanks for the report - I will try to reproduce.  And this only occurs when skipping?

    What version of AC are you using?  If not the latest, update to v1.55c - we'll need to know if this is occuring in the latest version.
  • I'm using 1.54c I'll Update and test it out. Is there any relevant information I could provide?

    Yes this only occurs when skipping. Also occurs when skipping dialog in an unskippable cut scene (which also breaks the cutscene)
  • Breaks the cutscene in what way?  What if you start the game from this scene?

    Can't reproduce from first attempt.  Let's get some debug info - in KickStarter.cs, there's a function called ResetPlayer that's used to instantiate the player prefab into the scene.  Assuming that the issue is that this is running inadvertently, place this in at the top of it after updating:

    Debug.Log ("Switching player: " + ref_player + ", ID: " + ID);


    If it then shows in the Console when the error occurs, post the full message as it appears in the Console window - including the script line references beneath.


  • edited February 2017
    I updated to 1.55c and tested it out. The same thing happened.
    I added the line to the KickStarter and got the following:

    image
    The first one when the game started, the second one is the action list player switch and the third one happened when I skipped a dialog. Log follows:

    Switching player: Olaf (AC.Player), ID: 0
    0x0000000140E4704D (Unity) StackWalker::GetCurrentCallstack
    0x0000000140E48D71 (Unity) StackWalker::ShowCallstack
    0x0000000140602A93 (Unity) GetStacktrace
    0x00000001405FFE5E (Unity) DebugStringToFile
    0x00000001406002BC (Unity) DebugStringToFile
    0x0000000140E86EAC (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x0000000009E4CF4B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x0000000009E4CE35 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 
    0x0000000009E4C9A8 (Mono JIT Code) [Logger.cs:42] UnityEngine.Logger:Log (UnityEngine.LogType,object) 
    0x0000000009E4C2DC (Mono JIT Code) [UnityEngineDebugBindings.gen.cs:101] UnityEngine.Debug:Log (object) 
    0x0000000009E4AAA1 (Mono JIT Code) [KickStarter.cs:787] AC.KickStarter:ResetPlayer (AC.Player,int,bool,UnityEngine.Quaternion,bool,bool) 
    0x000000001166492D (Mono JIT Code) [ActionListManager.cs:103] AC.ActionListManager:EndCutscene () 
    0x00000000112D6DFF (Mono JIT Code) [PlayerInput.cs:211] AC.PlayerInput:UpdateInput () 
    0x00000000112D4AB3 (Mono JIT Code) [StateHandler.cs:266] AC.StateHandler:Update () 
    0x0000000004FB68E2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x00007FF87F5B4FFB (mono) [mini.c:4937] mono_jit_runtime_invoke 
    0x00007FF87F508341 (mono) [object.c:2623] mono_runtime_invoke 
    0x00000001404CA51B (Unity) ScriptingInvocationNoArgs::Invoke
    0x00000001404CA4A7 (Unity) ScriptingInvocationNoArgs::Invoke
    0x0000000140344C51 (Unity) MonoBehaviour::CallMethodIfAvailable
    0x0000000140348902 (Unity) MonoBehaviour::CallUpdateMethod
    0x00000001401332EA (Unity) BaseBehaviourManager::CommonUpdate<BehaviourManager>
    0x0000000140468C87 (Unity) PlayerLoop
    0x0000000140BD7395 (Unity) Application::UpdateScene
    0x0000000140BD8919 (Unity) Application::UpdateSceneIfNeeded
    0x0000000140BE07D4 (Unity) Application::TickTimer
    0x0000000140E4179E (Unity) FindMonoBinaryToUse
    0x0000000140E42DD1 (Unity) WinMain
    0x00000001415C3540 (Unity) strnlen
    0x00007FF89E3413D2 (KERNEL32) BaseThreadInitThunk

    Edit: I just noticed it only happens if I skip dialog during a non-skippable action lists and ONLY if I haven't interacted with a skippable before

    I don't know if it clear but for exemple: I have two tables on the scene, both have the same "look at" interaction which has only a play speech action. A is skippable and B isn't. 

    The bug only happens If i skip the dialog on B before interacting with A.
  • edited February 2017
    OK - so which method of the three you mentioned is this with?

    Given the results of the last log, here's another one to place in ActionListManager.cs:

    Debug.Log ("Resetting play because starting ID (" + playerIDOnStartQueue + ") does not match current player " + KickStarter.player.name + " (" + KickStarter.player.ID + ")");

    Place this just above the line:

    Player playerToRevertTo = KickStarter.settingsManager.GetPlayer (playerIDOnStartQueue);

    Please also post a screenshot (hosted on e.g. imgur.com) showing the ActionList that causes the issue in full.
  • edited February 2017
    The method I am using is the second one: no player prefab on the scene and switching characters on the OnStart cutscene.

    The new line resulted in:

    Resetting play because starting ID (0) does not match current player YoungOlaf (1)
    0x0000000140E4704D (Unity) StackWalker::GetCurrentCallstack
    0x0000000140E48D71 (Unity) StackWalker::ShowCallstack
    0x0000000140602A93 (Unity) GetStacktrace
    0x00000001405FFE5E (Unity) DebugStringToFile
    0x00000001406002BC (Unity) DebugStringToFile
    0x0000000140E86EAC (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x0000000009E13C5B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x0000000009E13B45 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 
    0x0000000009E136B8 (Mono JIT Code) [Logger.cs:42] UnityEngine.Logger:Log (UnityEngine.LogType,object) 
    0x0000000009E12FEC (Mono JIT Code) [UnityEngineDebugBindings.gen.cs:101] UnityEngine.Debug:Log (object) 
    0x0000000004F5AF04 (Mono JIT Code) [ActionListManager.cs:102] AC.ActionListManager:EndCutscene () 
    0x000000001B50C5EF (Mono JIT Code) [PlayerInput.cs:211] AC.PlayerInput:UpdateInput () 
    0x000000001B50A2A3 (Mono JIT Code) [StateHandler.cs:266] AC.StateHandler:Update () 
    0x00000000051668E2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x00007FFD69724FFB (mono) [mini.c:4937] mono_jit_runtime_invoke 
    0x00007FFD69678341 (mono) [object.c:2623] mono_runtime_invoke 
    0x00000001404CA51B (Unity) ScriptingInvocationNoArgs::Invoke
    0x00000001404CA4A7 (Unity) ScriptingInvocationNoArgs::Invoke
    0x0000000140344C51 (Unity) MonoBehaviour::CallMethodIfAvailable
    0x0000000140348902 (Unity) MonoBehaviour::CallUpdateMethod
    0x00000001401332EA (Unity) BaseBehaviourManager::CommonUpdate<BehaviourManager>
    0x0000000140468C87 (Unity) PlayerLoop
    0x0000000140BD7395 (Unity) Application::UpdateScene
    0x0000000140BD8919 (Unity) Application::UpdateSceneIfNeeded
    0x0000000140BE07D4 (Unity) Application::TickTimer
    0x0000000140E4179E (Unity) FindMonoBinaryToUse
    0x0000000140E42DD1 (Unity) WinMain
    0x00000001415C3540 (Unity) strnlen
    0x00007FFD7F2913D2 (KERNEL32) BaseThreadInitThunk

    Also it occurs on any non-skippable action list. Even the ones as simple as this http://imgur.com/a/0Z7uU

    Edit: I just tested and switching the player from another scene with "Player: Switch appear in other scene" made no difference.
  • Thank you for your continued patience with this issue.  With each debug log we get closer to the source.  And the debug output was exactly the same with the second test?

    One more log, this time placed as the first line inside ActionListManager's CanAddToSkipQueue function:

    Debug.Log ("Adding " + actionList.name + " to skip queue (" + originalValue + ") - Skippable? " + actionList.IsSkippable () + ", In Skippable Cutscene? " + KickStarter.actionListManager.IsInSkippableCutscene () + ", Played ID: " + KickStarter.player.ID);

    I shall PM you an updated scripts package to test shortly, though that'll be a separate test - please let me know the result of the above as well.
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.