x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[UE4.13] Unable to Acces Blakboard Values from Decorator

Hello. So, I'm trying to create a test Decorator called Is_AI_Close_To_Player for my AI prototype and I am unable to access blackboard values from the Decorator BP, even though they are valid and set properly at Runtime. Here are the values for the Player_Location key I expect to get when I try to get the values at runtime (Second Last Entry In Screenshot):

alt text

However, when I print the values from the Decorator, I get the following values for the Player_Location key: X=340282346638528859811704183484516925440.000

Y=340282346638528859811704183484516925440.000

Z=340282346638528859811704183484516925440.000

I'm using the Get BlackBoard Value as Vector Node to retrieve the value of the key and use it in the decorator.

Here is the setup for my Decorator: alt text

Also, here is the relevant section of my Behaviour Tree. The Decorator in question is at position 10:.

alt text

I'm really at a loss at understanding where the issue is. Am I attempting to read the value of the key incorrectly? Or is it another issue? Any help would be highly appreciated. Thank You.

Product Version: UE 4.13
Tags:
more ▼

asked Sep 16 '16 at 05:07 PM in Using UE4

avatar image

XanderWraik
48 1 6 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Whenever you see X=340282346638528859811704183484516925440.000, Y=340282346638528859811704183484516925440.000, Z=340282346638528859811704183484516925440.000 in AI code it means the value is "invalid", or in other words deliberately marked as not set. So the question is: how/where do you put player's location into your Blackboard?

Cheers,

--mieszko

more ▼

answered Sep 16 '16 at 07:40 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image XanderWraik Sep 17 '16 at 02:32 AM

So, I'm setting the Player_Location key's value only in the AIController BP. This happens when an OnPerceptionUpdate occurs. Funny thing is, at that point the values print out correctly. Here is the relevant node setup:

alt text

Also, at runtime, the Game Debugger (First Screenshot in original question) displays the correct values for the Player_Location Key in the Blackboard. However, to the Decorator, Player_Location is undefined at runtime. Is that suppose to happen, or am I missing something? Thanks.

avatar image MieszkoZ STAFF Sep 17 '16 at 04:41 PM

Sounds like the issue is in the details of your setup. Maybe the key name used in the decorator is wrong? I'd suggest triple-checking everything and making sure stuff has expected values. Also, have you tried using vislog for debugging it? It something is set up wrong it might contain useful hints or will outright tell you! :D

avatar image XanderWraik Sep 18 '16 at 11:11 AM

So, I rechecked all keys in my Decorator. They were fine. Just to be sure, I copy pasted key names from the blackboard into the Decorator BP key values. It still wasn't working. Then, I tried a more explicit approach. Specified which Blackbard to use in the Decorator BP:

alt text

Then, I set the key names in the Getters in my Decorator BP accordingly and it's working. I'm wondering why it's working with this approach though and not the former one: Is it that the Decorator is unable to recognize whch Blackboard to use if a reference is not made in the code? I made no other changes in my Decorator BP aside from the one above. Thanks.

avatar image MieszkoZ STAFF Sep 19 '16 at 02:00 PM

Use Blackboard call here is not needed, and can actually be harmful. What you need is Get Blackboard and use the component it gives you.

I'd love to debug the original issue you've encountered. If you could prepare a repro project I'd get right on it! If not, well, you have your workaround :)

avatar image XanderWraik Sep 20 '16 at 03:29 PM

How can Use Blackboard be harmful in this context? As for the repro project, I'll replicate the project in a new UE4 project instance and see how it goes from there. Perhaps starting this in a new project might help. Otherwise, I'll send it for debug. Thanks.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question