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"

[Closed] AI Data Provider How to?

I can't find anything on how to use the data provider and it looks like something I want to use. Any chance there is a write up on how to use it somewhere, that I'm missing?

Product Version: Not Selected
more ▼

asked Jun 18 '16 at 07:26 PM in Using UE4

avatar image

Answers.Archive STAFF
1.9k 209 316 689

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

The question has been closed Jun 18 '16 at 07:27 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted

1 answer: sort voted first

I don't think it's documented anywhere. Data providers are currently used by EQS to create parameters that can be changed in runtime or based on some gameplay criteria, but in general, they can be used anywhere in code.


Structure with dynamic parameter's value, commonly used via derived structs: FAIDataProviderIntValue, FAIDataProviderFloatValue and FAIDataProviderBoolValue. Important member variables:

  • DataBinding is instanced object with UPROPERTY holding value which will be passed to data provider

  • DataField is optional and used (and displayed) only if DataBinding has more than one member property with matching type (e.g. MyPawnProvider with 3 floats: MaxHP, CurrentHP, Speed). Grouping properties together is less efficient, since you'll need to bind them all, but still useful.

You always need to call BindData() function before accessing value. Owner and RequestId params are whatever your DataBinding uses to work. In case of EQS, this is actor requesting query and query Id. Once data is prepared, you can either use GetValue() helper function (float/int/bool) or use GetRawValuePtr() to read directly from bound property.

Check UEnvQueryTest_Distance::RunTest for example use case.


Object providing data. A few things to keep in mind:

  • requires UPROPERTIES to interact with data provider structs

  • this object should be used through struct wrappers (e.g. default value support)

  • EditInlineNew class flag

Override BindData() and use it to initialize your properties with values. In case of EQS, Owner will be usually a Pawn. ToString() can be left alone, unless you need custom descriptions for provider and field pairs (property names, not values).

Existing providers:

So far only one at engine level - QueryParams. It gives access to float / int / bool named parameters passed with query execution (usually with FEnvQueryRequest.Set***Param functions)

more ▼

answered Jun 18 '16 at 07:26 PM

avatar image

Answers.Archive STAFF
1.9k 209 316 689

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

Follow this question

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

Answers to this question