Using Invector Trouble

Announcements, support questions, and discussion for the Dialogue System.
DeidreReay
Posts: 93
Joined: Wed Jan 22, 2020 1:20 pm

Re: Using Invector Trouble

Post 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??
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Invector Trouble

Post by Tony Li »

Your player character is probably missing the DialogueSystemInvectorBridge component.
DeidreReay
Posts: 93
Joined: Wed Jan 22, 2020 1:20 pm

Re: Using Invector Trouble

Post by DeidreReay »

I thought the same but he has that component....
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Invector Trouble

Post 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.
DeidreReay
Posts: 93
Joined: Wed Jan 22, 2020 1:20 pm

Re: Using Invector Trouble

Post 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
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Invector Trouble

Post by Tony Li »

Glad to help! I'll be here if you have more questions.
DeidreReay
Posts: 93
Joined: Wed Jan 22, 2020 1:20 pm

Re: Using Invector Trouble

Post 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
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Invector Trouble

Post 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.
Post Reply