Working with AC 1.50i and Unity 5.3.2f1. I've been having some issues with sounds with constant IDs. When the sounds are played during game play, they are being duplicated in the scene with new IDs and sometimes missing the sound (script) component. This is causing the game to freeze. The sounds are in the top of the hierarchy and not in the "sounds" folder in the scenes, and they are all synced to their prefabs in the project folder. Sometimes my ActionLists on play are also loosing connection to the sounds for some reason (even if the action is not running, happens instantly on play). I've tried changing the constant IDs to manual and automatic, tried referencing the prefabs in project over the sounds in the scene, all sounds are set up properly.
I am getting this error, which is probably the culprit but I'm not sure how to fix it:
InvalidOperationException: This cannot be used during play mode.
AC.UnityVersionHandler.CustomSetDirty (UnityEngine.Object _target, Boolean force) (at Assets/AdventureCreator/Scripts/Static/UnityVersionHandler.cs:410)
AC.ConstantID.SetNewID () (at Assets/AdventureCreator/Scripts/Save system/ConstantID.cs:172)
AC.ConstantID.CheckForDuplicateIDs () (at Assets/AdventureCreator/Scripts/Save system/ConstantID.cs:186)
AC.ConstantID.Update () (at Assets/AdventureCreator/Scripts/Save system/ConstantID.cs:136)
An additional note worth mentioning: When this problem first started cropping up I noticed that I bunch of sound effects that were previously working fine were now not playing at all. Upon further inspection, I figured out that all of their settings were changed on their own. They now had constant IDs and were set as looping "Music" instead of SFX, even though I did not change these settings and never gave them constant IDs. I reverted all of those back to sfx and haven't had any issue with them changing since that. Though the issue above still persists.
Any help or insight is greatly appreciated!
Comments
It's important to separate any bugs you're encountering from AC's intended behaviour: if you reference any scene-based object (e.g. a Sound) from an ActionList asset file, then the Action's field will not always show the scene object (because, for example, a different scene is loaded).
This is why Constant ID numbers exist: they are AC's way of allowing asset files to keep track of scene objects. The only thing you need to be mindful of is the recorded Constant ID number beaneath the field in the Action - when the Action runs (again, in an ActionList asset), it will look for any scene object flagged with the matching Constant ID number. Therefore, be careful not to change ID numbers manually, otherwise there'll be a mismatch and the Action may not be able to find it.
To fix the duplicating sound / game crashing bug, I will need you to provide a list of steps that reproduce this error when followed.
Your final mention of your Sound objects being given Constant ID numbers and set to Music sounds like you updated the original Sound prefab (in /Assets/AdventureCreator/Prefabs). Because of how Unity works, this can happen if you click on "Apply" a the top of a scene-Sound's Inspector. Be careful not to do this, as it will affect the root prefab (which you can override, however, by dragging your scene-Sound object into a new folder in your Project window, to make a new prefab).