I get the following compile errors in blueprint when I try to use the Evaluate Chooser node in the All Results mode with a chooser table that returns the Subclass Of type. It compiles error free when using the First Result mode.
[Image Removed]
Can't connect pins Return Value and Object : Array of Actor Object References is not compatible with Object Reference. Invalid pin connection from ' Return Value ' to ' Object '. You may have changed the type after the connections were made. Can't connect pins Object and Return Value : Object Reference is not compatible with Array of Actor Object References. [0199.27] Compile of BP_EvaluateChooser failed. 3 Fatal Issue(s) 0 Warning(s) [in 41 ms] (/Game/Blueprints/BP_EvaluateChooser.BP_EvaluateChooser)
Steps to Reproduce
General steps:
Create a Chooser Table with ResultType = SubClass Of.
Add an EvaluateChooser node to a blueprint EventGraph using that table with Mode = All Results.
Connect the Result array of the evaluate to another node such as Random (item from array).
Attached example files:
Create a new Third Person (c++) template project.
Copy the attached files into the project.
Open BP_EvaluateChooser and try to compile.
Hi,
thanks for reaching out and providing a repro project. I have started investigating this issue and could reproduce it on my side. So far it looks like this may be a bug, but I’m still trying to confirm that.
In the meantime, a potential workaround might be to create a new Chooser Table with Result Type = Object Of Type and casting the object to a class of Actor as shown in the screenshot below. This compiles without errors. Would this work for your project?
[Image Removed]
Thanks,
Sam
Hi,
thanks for getting back and providing some workarounds. I have filed a bug report for this issue and will post the link here when it gets added to the public issue tracker.
Thanks,
Sam
Hi,
the issue is now made public at this link.
Please let me know if you have any other questions.
Thanks,
Sam
I tried that but it doesn’t work for my case. Object Of only returns objects of an exact class type. I want to populate the table with designer created children of a base class so they can modify the base class’s behavior.
I also tried evaluating the table in code by calling UChooserFunctionLibrary::EvaluateObjectChooserBaseMulti. That works but is less flexible. The designers can’t add or modify the context objects/structs if it’s not in blueprint.
I think the Randomize column will work for now unless we need more processing of the valid results. But I couldn’t figure out how to bind the Randomization Context to add history to the selection. I think I figured it out but found a new bug. You need to add a ChooserRandomizationContext parameter to the table, then the binding on the Randomize column’s Input Value automatically connects. But it only works if the ChooserRandomizationContext is the first parameter. If you add that parameter later it doesn’t bind.
Doesn’t bind:
[Image Removed]Binds:
[Image Removed]