Hello,
First of all I am enjoying the AC very much, it is a great tool and in 2 weeks I am already reached an understanding and a maturity of the project that impressed me. I am a 3D artist at the base, I have technical bases but I'm not into programming and still in this short time I'm flying!
My AC version on the current project is the 1.81.4
My project it is a 2D Adventure game Point and Click
Mouse and Keyboard (mouse click has default functionality)
Interaction method Context Sensitive with hotspot detection method Mouse Over
Global Cursor is Unity UI (Cursor UI)
I am encountering a specific issue with the inventory - normally I can click on the owned item, the item sticks to the cursor and I can easily drag it and use it where is needed. But there are some instances in which during the gameplay without an apparent reason I can no longer drag out items from the inventory.
The items can be clicked, and they quickly scale up in size on click but then the cursor release them in the inventory without having a chance to drag them out.
Additional info:
1. 100% of the times this issue comes out after I saved the game (only saved, not left the game and loaded but just saving the game).
2. I don't know if this could help but I also noticed that my cursor it is underneath the UI when this happens.
*thanks in advance for your time, I hope I delivered enough info.
Best regards and thanks again for this amazing AC.
Flavio
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Flavio.
I can't think of any specific reason why this would happen - particularly due to saving. What's your Unity version, and have you made any changes to the save system / Save menu?
Is this to say that the issue occurs 100% of the time after saving, or is it only happening sometimes (but always only after saving)?
If you have Drag and drop Inventory interface? enabled, does unchecking it prevent the issue from occuring?
To help figure out what's going on, we can have AC print to the Console whenever an item is deselected.
To do this, open AC's Events Editor (via the top toolbar), and create a new Inventory / Deselect event. Have this event run an ActionList that runs a single ActionList: Comment Action that prints some text to the Console (e.g. "Item deselected.").
When this log shows up in the Console - at the time the issue occurs - select the log and copy/paste it in full (including the stacktrace / code references that appear underneath). I'll see if that can provide any clues.
This won't be related, but it can be corrected. Do your Menus have their Source set to Adventure Creator? These will always be drawn atop all else, if so. Setting them to Unity Ui Prefab - to have them also rely on Unity UI - will allow the cursor to be drawn above (if this isn't the case by default, you can achieve this by raising the Canvas's Sort Order).
Hello Chris,
Thanks for the timely reply, very much appreciated.
I want to give you initial answers to most of your questions while I am following your instructions:
My Unity version is 2022.3.32f1
This issue present itself completely randomly, but when saving happens 100% of the times. Just right after I saved the item is no longer draggable.
I have the Menus set on Adventure Creator, because if I keep them set to Unity Ui I cannot switch the font to the custom font that I have.
_*I have figured out that the default font within the Unity Ui Prefab has some features I believe related to distance field and text mesh pro that the ideal font that I wish to use doesn't have. - so I had to set the menus to AC to have my font accepted. _
Regarding the Drag and Drop check box, apparently makes no difference if it is on or off.
I will come back to you regarding your suggestion with the console, because I have to understand what to do first, I need a moment - those things are not straightforward to me.
I am back, if I did all right this is what you're expecting me to copy paste:
Item Deselected
(From Action #1 in ActionList 'OnInventoryDeselect')
-> AC debug logger
UnityEngine.Debug:Log (object,UnityEngine.Object)
AC.ACDebug:Log (object,AC.ActionList,AC.Action,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:72)
AC.Action:Log (string,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/ActionList/Action.cs:1795)
AC.ActionComment:Run () (at Assets/AdventureCreator/Scripts/Actions/ActionComment.cs:54)
AC.ActionList/d__47:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:470)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:412)
AC.ActionList:ProcessActionEnd (AC.ActionEnd,int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:607)
AC.ActionList:EndAction (AC.Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:576)
AC.ActionList/d__47:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:412)
AC.RuntimeActionList:BeginActionList (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:181)
AC.ActionList:Interact (int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:283)
AC.RuntimeActionList:DownloadActions (AC.ActionListAsset,AC.Conversation,int,bool,bool,bool) (at Assets/AdventureCreator/Scripts/ActionList/RuntimeActionList.cs:136)
AC.AdvGame:RunActionListAsset (AC.ActionListAsset,AC.Conversation,int,bool,bool) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:242)
AC.AdvGame:RunActionListAsset (AC.ActionListAsset,int,int) (at Assets/AdventureCreator/Scripts/Static/AdvGame.cs:163)
AC.ActionListAsset:Interact () (at Assets/AdventureCreator/Scripts/ActionList/ActionListAsset.cs:550)
AC.EventBase:Run (object[]) (at Assets/AdventureCreator/Scripts/Events/EventBase.cs:126)
AC.EventInventorySelect:OnInventoryDeselect (AC.InvCollection,AC.InvInstance) (at Assets/AdventureCreator/Scripts/Events/Events/EventInventorySelect.cs:81)
AC.EventManager:Call_OnChangeInventory (AC.InvCollection,AC.InvInstance,AC.InventoryEventType,int) (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:1719)
AC.RuntimeInventory:SetNull () (at Assets/AdventureCreator/Scripts/Inventory/RuntimeInventory.cs:114)
AC.ActionInventorySelect:Run () (at Assets/AdventureCreator/Scripts/Actions/ActionInventorySelect.cs:88)
AC.ActionList/d__47:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:470)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:412)
AC.ActionList/d__45:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:395)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
I am also going to attach what it says when I save:
PlayerPrefs Key 'AC_TheDarkestDusk_0' saved
-> AC debug logger
UnityEngine.Debug:Log (object,UnityEngine.Object)
AC.ACDebug:Log (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:23)
AC.OptionsFileHandler_PlayerPrefs:SaveOptions (int,string,bool) (at Assets/AdventureCreator/Scripts/Options/OptionsFileHandler_PlayerPrefs.cs:25)
AC.Options:SavePrefsToID (int,AC.OptionsData,bool) (at Assets/AdventureCreator/Scripts/Options/Options.cs:110)
AC.Options:SavePrefs (bool) (at Assets/AdventureCreator/Scripts/Options/Options.cs:90)
AC.Options:UpdateSaveLabels (AC.SaveFile[]) (at Assets/AdventureCreator/Scripts/Options/Options.cs:643)
AC.SaveSystem:OnCompleteSaveOperation (AC.SaveFile,bool,AC.SaveOperation) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1119)
AC.SaveOperation:OnFinishSaveRequest (bool) (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:129)
AC.SaveFileHandler_SystemFile:Save (AC.SaveFile,string,System.Action`1) (at Assets/AdventureCreator/Scripts/Save system/FileHandling/SaveFileHandler_SystemFile.cs:105)
AC.SaveOperation:SendSaveToFile () (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:173)
AC.SaveOperation:BeginOperation (AC.SaveData&,AC.SaveFile) (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:89)
AC.SaveSystem/d__61:MoveNext () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1076)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.SaveSystem:SaveSaveGame (int,bool,string) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1019)
AC.SaveSystem:SaveGame (int,int,bool,bool,string) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:985)
AC.MenuSavesList:ProcessClick (AC.Menu,int,AC.MouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuSavesList.cs:879)
AC.PlayerMenus:CheckClick (AC.Menu,AC.MenuElement,int,AC.MouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:2364)
AC.PlayerMenus:CheckClicks (AC.Menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1916)
AC.PlayerMenus:CheckForInput (AC.Menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:2046)
AC.PlayerMenus:CheckForInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:2034)
AC.StateHandler:Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:208)
Thanks for the details.
The log message suggests that the item de-selection is coming from an Inventory: Select Action - with a Select type set to Deselect Active.
Is the log you're showing the exact one that showed up at the time of the issue, and not when e.g. the Pause menu was opened? If so, you can search for instances of this Action by selecting its type within the Actions Manager. Have you created such an Action as part of your interface?
Yes the log is from when I tried to catch the item after I saved, I was not in the pause screen. (if I have understood the question).
I am using the default interface given with the 2D template. I do not have custom actions in the Actions Manager.
"The log message suggests that the item de-selection is coming from an Inventory: Select Action - with a Select type set to Deselect Active." - I'm looking into this right now!
Hello there,
I had a breakthrough on the subject. Oddly enough this issue stopped to manifest once I removed the tick from the option "Items can be re-ordered in Menus?" Now works wonders!
Thanks for the assistance!
I really do love working on AC,
is making my Adventures Gamer dreams coming true.
Best
Flavio