We’re moving some ABP logic to code and noticed that choosers that are evaluated from code do not show up as entries in the rewind debugger. Is there a way to enable them?
Another reason we moved them to code is to be able to get the output column values from a read/write struct context. In blueprint, even though the Evaluate Chooser node shows the output pins, the values are not set with the values specified in the rows.
FChooserEvaluationContext LocoChooserContext;
LocoChooserContext.AddStructParam(InOutChoiceParams);
return Cast(DatabaseChooser->ChooseObject(LocoChooserContext));`On the rewind debugger there are no chooser rows if I do it purely from code. I believe when evaluating choosers from BP they are nested in the ABP. So I’m assuming they need to be attached to that BP somehow? I am calling this code from a native animinstance, and specifically from a function that is bound to an OnUpdate anim node hook, in case that’s relevant.
For the blueprint issue no, the chooser I tried wasn’t a proxy chooser. I have added an Evaluate Chooser node to the character blueprint, the Chooser Evaluation row appears, but it is empty. And the output pins do not report the correct row value for their output columns.
I’m also not entirely sure I understand what you mean by selecting the chooser row first. Until the first evaluation no row appears, I’ve tried selecting it and then running the evaluation again and it doesn’t seem to do anything.
Hi [mention removed], [mention removed] passed this issue over me to take a look at.
I think that the original issue that you mentioned, with rewind debugger not showing the chooser evaluation, is because there’s no object being passed into the evaluation context. If you modify your chooser so that it takes an object, and update your code accordingly, you should see the chooser appear in the trace data. For instance, you could pass in the character bp, or the anim bp. They won’t affect the evaluation, but it should allow rewind debugger to display the information correctly. So after you update your Chooser, your code would look something like this (note that order matters here - the second parameter in your chooser needs to be the second value added to the context):
For the second issue where the read/write struct wasn’t getting the output values written into it when calling EvaluateChooser from a character blueprint, that’s not expected. It’d be interesting to get some more information on that. All that should be required is that:
The chooser has the struct type set as an input/output parameter
The output column on the chooser is bound to the property you want to set within the struct
In your character bp graph, you pass a variable of the struct type as an input to Evaluate Chooser and then get the equivalent from one of the output pins
I’d be happy to dig into the second problem in more detail if you can’t get it working. It could be useful to get some screenshots of your setup, or a small repro project if you’re able to provide one.
Hi Euan, thanks, adding the object parameter did the trick.
For the second problem I still cannot make it work when evaluating from BP. I’ve reproed it in vanilla 5.4.4, find the project attached. In the test level you can press the T key to repro. Seems that the output value of the output column variable is whatever I initialize it with, basically it is unchanged.
Thanks, that’s helpful to track down what’s going on. It looks like it’s just a case that the output column hasn’t been bound to a variable, so there’s nothing to write the value to. If you bind this column to ChoiceData.OutputC, does that give you what you expect?
It does yes. That was an oversight when reproing the example. I’ll have to go back to our original full project use case to repro again, hopefully it was a similar error somewhere. In any case now that everything’s working in fine code and that this could not be reproed in vanilla we can probably close this one.