Forum rules - please read before posting.

bug: phoneme hangs at 3 when skipping speech

 ac153d, u536p4
using sprite unity complex with salsa lip sync

when my player speaks a long sentence he finishes fine on phoneme 0 unless I skip the speech with a click. then it is possible that the phoneme hangs at 3

Comments

  • Thanks for posting, I will let you know if I need more detail.
  • edited September 2016
    Can't recreate.  What happens if you skip a short sentence, and are you making use of speech tags?

    In Char.cs, there's a function named GetLipSyncFrame:

    Replace:

    if (isTalking && salsa2D != null)
    {
      return salsa2D.sayIndex;
    }
    return 0;


    with:

    if (isTalking && salsa2D != null)
    {
      Debug.Log (gameObject.name + " is speaking - frame " + salsa2D.sayIndex);
      return salsa2D.sayIndex;
    }
    Debug.Log (gameObject.name + " is not speaking.");
    return 0;


    That will output some logs to the console.  What does it say when the problem occurs?
  • Player is speaking - frame 2
    UnityEngine.Debug:Log(Object)
    AC.Char:GetLipSyncFrame() (at Assets/AdventureCreator/Scripts/Character/Char.cs:2876)
    AC.AnimEngine_SpritesUnityComplex:AnimTalk(Animator) (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_SpritesUnityComplex.cs:683)
    AC.AnimEngine_SpritesUnityComplex:PlayIdle() (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_SpritesUnityComplex.cs:549)
    AC.AnimEngine_SpritesUnityComplex:PlayTalk() (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_SpritesUnityComplex.cs:610)
    AC.Char:AnimUpdate() (at Assets/AdventureCreator/Scripts/Character/Char.cs:770)
    AC.Char:_Update() (at Assets/AdventureCreator/Scripts/Character/Char.cs:445)
    AC.Player:_Update() (at Assets/AdventureCreator/Scripts/Character/Player.cs:168)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:371)
  • Maybe I found a reason.
    It happens when I load the save game where the speech is where the phoneme hangs.
    When loading the save game this warnings are logged.

    The referenced script on this Behaviour is missing!
    UnityEngine.Resources:LoadAll(String, Type)
    AC.AssetLoader:RetrieveAsset(Texture2D, String) (at Assets/AdventureCreator/Scripts/Static/AssetLoader.cs:73)
    AC.Player:LoadPlayerData(PlayerData) (at Assets/AdventureCreator/Scripts/Character/Player.cs:675)
    AC.SaveSystem:ReturnPlayerData(PlayerData, Player) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1678)
    AC.SaveSystem:ReturnMainData() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1465)
    AC.SaveSystem:_OnLevelWasLoaded() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:775)
    AC.SaveSystem:OnLevelWasLoaded() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:72)



    and this

    The referenced script on this Behaviour (Game Object '<null>') is missing!
    UnityEngine.Resources:LoadAll(String, Type)
    AC.AssetLoader:RetrieveAsset(Texture2D, String) (at Assets/AdventureCreator/Scripts/Static/AssetLoader.cs:73)
    AC.Player:LoadPlayerData(PlayerData) (at Assets/AdventureCreator/Scripts/Character/Player.cs:675)
    AC.SaveSystem:ReturnPlayerData(PlayerData, Player) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1678)
    AC.SaveSystem:ReturnMainData() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1465)
    AC.SaveSystem:_OnLevelWasLoaded() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:775)
    AC.SaveSystem:OnLevelWasLoaded() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:72)



    Maybe this initial loading error makes everything a bit unstable.
    Maybe this save state doesn't fit the actual game objects anymore as I m constantly working on everything.

    I will keep on bug fixing till I am at that point of the game again and try again. Maybe it's just because of the save game and there is nothing to do here.

    My first guess was that cinema director is the problem because it sometimes makes everything sluggish which makes the drag and drop from the inventory impossible. But that was not the case here.


  • the same speech actions work fine when I don't load the savegame.
    So I think I will try again when the game is done and non of my changes in unity messes up the save games.
  • The error relates to the portrait graphic - are you changing the player's graphic during the game?  If so, give each graphic file a unique name, and place them in a folder named Resources (they can be in a subdirectory within that).
  • edited September 2016
    Thank you for looking into this.
    It is interesting.

    My player has a portrait graphic, which I don't exchange or touch during gameplay.
    I also don't animate the portrait graphic.
    So the checkbox at "Animate?" isn't checked.

    In the speech settings I need to choose "Portrait and Game Object" for the "Perform lipsync on" dropdown. This is the only setting that makes the mouth animated on my player character in game.
    "Portrait" only, doesn't animate the mouth on my player
    "Game Object Texture" also doesn't animate the mouth on my player.
    This might be a bug. I think it should right?

    I'm using sprite unity complex

    What I tried now is that I removed the portrait texture, but the phoneme stills hangs in that particular situation in that save game. For now I'm not able reproduce this situation somewhere else. I'll keep trying.

    something else:
    I noticed the sluggishness I experience form time to time which makes the inventory unresponsive that I can't drag and drop is cause by the AC Game Editor inspector.
    When the AC Game Editor tab  is hidden the game works fine, when it is visible it looks like having 3 frames per second. This won't affect the performance on a device of course. DockArea.OnGUI is called thousands of times and this affects only the unity editor.

    UPDATE: It is just the Speech-Tab that causes this, so it's not that big of a deal.

  • "Game Object Texture" is only useful when dealing with 3D characters (think Grim Fandango), so that option can be ignored.  If you're not switching or animating the portrait, I think you should also be safe to ignore the Console message.

    When the phoneme hangs, is it because the parmater is also incorrect?  Check your Animator window and find the value of the phoneme integer - is it non-zero at this time?

    I need to be more clear on when exactly this occurs - when you save the game, or when you load the save?  Does speech have to be playing at the point you save?
  • The phone hangs because the parameter is also incorrect.
    I will keep my eyes open if it occurs at some other place.
    I hope I can reproduce it and give more details.

    Speaking of saves.
    Is there a way to remember the state of particles?
  • With so many potential parameters within a particle system that you may wish to save, a custom remember script would be the answer - see this tutorial.
  • I ve handled all the states of the particles in my game with state-variables I set when playing or stoping and onLoad particle switch scripts get called by Object: SendMessage TurnOn/Off. 
    not too convenient for an AC beginner. 

    if the Particle Switch had a checkbox remember state (playing or not) would be enough I think.
    Other AC users might like that feature, especially beginners.
    just a recommendation, I have a construct that works for now.

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.