Page 3 of 3
Re: Using Invector Trouble
Posted: Fri Jan 24, 2020 6:26 pm
by DeidreReay
Not sure why but now getting these three error codes
Dialogue System: Lua code 'return vGetItemCount(2)' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
Dialogue System: Lua code 'return vGetItemCount(2) < 2' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
Dialogue System: Lua code 'return vGetItemCount(2) >= 2' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
Everything was setup correctly. Unsure what the problem is??
Re: Using Invector Trouble
Posted: Fri Jan 24, 2020 7:29 pm
by Tony Li
Your player character is probably missing the DialogueSystemInvectorBridge component.
Re: Using Invector Trouble
Posted: Fri Jan 24, 2020 11:03 pm
by DeidreReay
I thought the same but he has that component....
Re: Using Invector Trouble
Posted: Sat Jan 25, 2020 7:29 am
by Tony Li
Try unticking your character's vThirdPersonController > Grounded > Use Instance checkbox. Put your character in each gameplay scene instead of having it transfer from one scene to the next. (See
Saving, Loading, and Scene Changes)
If it happens when you change scenes, then this may be happening:
- The new player in the new scene tells the Dialogue System that the Lua functions should refer to its inventory.
- The old player in the old scene transfers to the new scene. It sees that there's a new player in the new scene, and it destroys the new player.
- The new player cleans up after itself when being destroyed, leaving the Lua functions undefined.
If you untick Use Instance, the old player won't transfer to the new scene.
Re: Using Invector Trouble
Posted: Mon Jan 27, 2020 12:00 pm
by DeidreReay
Seems like everything is working fine through all node layers of the script and now NPC takes the potions from the character. Thank you so much for your time. I am sure I will have more questions in the future. Cant wait to dig further into what you have created. Thank you
Re: Using Invector Trouble
Posted: Mon Jan 27, 2020 12:52 pm
by Tony Li
Glad to help! I'll be here if you have more questions.
Re: Using Invector Trouble
Posted: Wed Jan 29, 2020 11:08 am
by DeidreReay
Only thing I am noticing now is thus.
Have the quest tracker now popping up in top right of screen showing 0/2 Potions
When i grab said 2 potions it does not update until I return to NPC who gave quest then poof says 2/2 potions.
Guessing I missed a step somewhere here. Thanks
Re: Using Invector Trouble
Posted: Wed Jan 29, 2020 12:37 pm
by Tony Li
Hi,
You need to tell the quest tracker HUD to update when the player's inventory has changed.
Inspect the player and add a DialogueSystemTrigger. Select Add Action > Run Lua Code. Set the Lua Code field to: UpdateTracker()
Inspect the Events section of the player's vItemManager script. Configure the OnAddItem() and OnDropItem() events to call the DialogueSystemTrigger's OnUse method.