Character Can't Pick Up Multiple of Object (Unreal, Actions)

Original Discord Post by aridelta_arktheythem | 2024-10-23 00:37:59

Blueprint Runtime Error: “Accessed None trying to read property Pickup Item”. Node: Attach Actor To Component Graph: EventGraph Function: Execute Ubergraph BP Taro Blueprint: BP_Taro

For some reason, the character 9/10 can’t pick up multiple version of the same object (sticks). It only picks up the first object. Once it found some other sticks. Above is the error that I get. In your example, https://www.youtube.com/watch?v=phAkEFa6Thc&t=867s, you have a character going to a tree, or picking up an axe. Imagine that I want the character to pick up multiple axes; do you have any advice for programming this?

Embedded Content:
AI NPCs Take Action from Conversation | Environment and Object Awar…
Characters feel life-like if conversations have consequences involving not only verbal responses but also behaviors and actions. This may include interacting with the environment or other characters. Convai’s NPCs can navigate complex verbal instructions and convert them to natural actions in the game engine. For example, characters can perform …
Link: https://www.youtube.com/watch?v=phAkEFa6Thc

Reply by aridelta_arktheythem | 2024-10-23 00:53:04

Do I have to programmatically delete them from the array of objects in the character’s object memory after he finds them?

Reply by aridelta_arktheythem | 2024-10-23 00:57:52

something like this?

Images:

Reply by aridelta_arktheythem | 2024-10-23 00:57:59

then maybe he’ll pick up other sticks?

Reply by aridelta_arktheythem | 2024-10-23 00:58:35

please advise; TLDR need to pick up multiple of same object (sticks1, sticks2, sticks3, etc., sequentially).

Reply by k3kalinix | 2024-10-23 22:11:08

<@1216254232957685765>

Reply by mighty_brute | 2024-10-24 06:55:23

Hello <@960306118339473419> ,

If you want to remove the object from the character, you need to call the Remove Object function, which is available in the Environment variable of the chat bot component.

Images:

Reply by mighty_brute | 2024-10-24 06:56:52

For your case, you can use the narrative design feature. I am attaching documentation with the steps on how to set it up. Narrative Design - Google Docs

Embedded Content:
Narrative Design
This is a simple demo about how to use Narrative Design in Unreal Engine. Below, you can see a simple Narrative Design consisting of 2 triggers: “On Player approach it” and “Reached Monument,” and 3 sections: “Welcome,” “Escort Player to Monument,” and “Speak about the Monument.” For this…
Link: Narrative Design - Google Docs

Replying to mighty_brute’s Message

Reply by mighty_brute | 2024-10-24 06:55:23
Hello <@960306118339473419> ,

If you want to remove the object from the character, you need to call the Remove Object function, which is available in the Environment variable of the chat bot component.

Reply by aridelta_arktheythem | 2024-10-24 21:30:35

I will try this.

Replying to mighty_brute’s Message

Reply by mighty_brute | 2024-10-24 06:56:52
For your case, you can use the narrative design feature. I am attaching documentation with the steps on how to set it up. Narrative Design - Google Docs

Reply by aridelta_arktheythem | 2024-10-24 21:30:55

I’m not sure why you would need this in order to just pick up multiple sticks in an environment? Could you explain?

Reply by aridelta_arktheythem | 2024-10-24 22:07:53

this is my setup, I have a stick object, when the player collides with it, it deletes the actor, and then casts to my convai character and tries to delete the stick from his references
it doesn’t work, bc when I do the print out, he still has all the sticks even when I remove them from the world and his list of objects
I must be doing something wrong?

also I have four sticks, and he often has weird behavior when I ask him to pick up a stick, like he just bends down and picks nothing up from the ground

Images:

Reply by aridelta_arktheythem | 2024-10-24 22:08:04

^ this is my stick blueprint

Reply by aridelta_arktheythem | 2024-10-24 22:11:30

Here’s some of what’s going on.

Attachments:

Reply by aridelta_arktheythem | 2024-10-24 22:11:43

It used to work fine with one stick, so I’m trying to figure out how to extend this so I can keep asking him to pick up sticks in the environment.

Reply by aridelta_arktheythem | 2024-10-24 22:19:03

Yeah, works fine with one stick, so I’m trying to extend this behavior, so he can pick up different stick bundles, bc it’s part of a game mechanic.

Reply by aridelta_arktheythem | 2024-10-25 23:11:08

<@1216254232957685765>

Reply by aridelta_arktheythem | 2024-10-26 21:14:58

<@1023671043287699568>

Reply by k3kalinix | 2024-10-26 21:39:20

Since today is the weekend, my teammate will check on Monday.

Reply by mighty_brute | 2024-10-28 08:51:43

<@960306118339473419> You can easily set up these game mechanics using Narrative Design. Regarding the Object array, it is primarily used to populate data when the game starts; beyond that, it is not utilized. Once you remove the object using the Remove function in the Environment, that object is also removed from the character’s information. You can verify this by checking the logs. Every time you interact with the character, an action_config is sent. You can review the logs to confirm what type of information the character is using to generate replies.

This conversation happened on the Convai Discord Server, so this post will be closed.