Lua code problem

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Namikaze123
Posts: 2
Joined: Sun Dec 17, 2023 12:27 pm

Lua code problem

Post by Namikaze123 »

Hi i am having trouble with this specific situation. You see i have invector and both dialogue system and quest machine all which are present in my project. My problem is that it keeps giving me this error which makes the game stop and i dont really know how to fix it, tried following both integrations for dialogue system and quest machine separately and they work but once they are both in the project, this problem comes up. I have attached the photo in which it shows
the error in the console. I hope you find a solution for this, because this is a school project. Thank you so much. Image
Attachments
LuA Problem.png
LuA Problem.png (15.55 KiB) Viewed 7721 times
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua code problem

Post by Tony Li »

Hi,

Are there any other warnings or errors before that in the Console?

Did you add a DialogueSystemQuestMachineBridge component to the Dialogue Manager? See page 6 of the Dialogue System Support.pdf included with Quest Machine's Dialogue System integration.
Namikaze123
Posts: 2
Joined: Sun Dec 17, 2023 12:27 pm

Re: Lua code problem

Post by Namikaze123 »

hi apologies for the late reply, yes that was missing and adding it fixed the error but now i have some interactions that where unintended so ill list them here.
1. Once i clicked the answer for the dialogue it does not give me the quest, nothing happens, no error and the game does not stop but the quest is not given.
2. I have a unwanted interaction the quest journal. You see i have binded the key letter "F" for opening the quest journal, this worked but the problem is when i press "E" in my keyboard the quest journal pop ups to, what should i do to prevent the quest journal from using both the F and E key for opening the quest journal, my intention is only to use the "F" key.
3. Lastly, pressing escape and using the load, save, exit functions do nothing, it used to work but now nothing happens. I have attached a google drive link to show my concerns, i hope i don't take too much of your time. Thank you for giving your time in answering my questions, i'm fairly new to using this asset so apologies for the wall of text.

Here is the google drive link, apologies since i think the videos are my best way of describing and showing my problem.
https://drive.google.com/drive/folders/ ... sp=sharing
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua code problem

Post by Tony Li »

Hi,

For (1), keep the Quest Editor window open during play. Click on whatever GameObject has the player's Quest Journal component. When a quest gets added to the player's Quest Journal, its nodes will appear in the Quest Editor window. Make sure there's only one Quest Journal component in the scene. You can enter "t:QuestJournal" in the Hierarchy's search bar to show all GameObjects with Quest Journal components. (It's technically possible to have multiple Quest Journals, but for a single player game you should only have one.) Also inspect the Quest Journal component's Quests list. When the NPC gives the quest, it should appear in the Quests list. If it doesn't, double check the Console window. Make sure warnings aren't being filtered out.

For (2), check if your EventSystem's "Submit" input is mapped to the "E" key. If so, then maybe the "(J)ournal" button in the top left of the screen is currently selected by the EventSystem. Pressing the "Submit" input in this case would click the button. You've probably noticed this warning in the Console window: "Dialogue System: The scene is missing an EventSystem. Adding one." To resolve this, add an EventSystem to the scene. (Menu item GameObject > UI > EventSystem.) If that's not it, check the button for a UI Button Key Trigger component. This component can map an input as a hotkey for the button.

For (3), that looks like the Save System Test Menu. If you inspect the Save System Test Menu component, you'll see that the Menu Input Button is probably set to "Cancel". Invector remaps the "Cancel" input to the Backspace key. You may want to remap it back. If you can't click on the buttons, make sure the OnShow() and OnHide() UnityEvents are configured in the inspector like they are in the Invector integration's "Shooter Example" scene. If you can click them but they don't do anything, check the Console window for errors or warnings.

Also make sure your scene has a Save System component. The quickest way to set up the Save System component is to download the SaveSystemPrefabs package (direct download) from the Dialogue System Extras page. Import it and add the Save System prefab to your scene. Then add the LoadingScreen scene to your project's build settings.
Post Reply