hi
let say a function uses a number of functions at different levels: function a calls / uses function b and function b uses function c to get an ultimate result. the result must then be passed all the way up to function a
how do you achieve that without creating copies at each return step
i cant seem to reference the function output of function c in function b to simply pass it as a reference to function a and seemingly need to create a copy first
thanks
Like this?
Easy to do if you make them ‘pure’
But it’s really the same as
1 Like
sorry i only now saw your reply
difference between your example and my case would be you have all 3 function calls in 1 blueprint
i have at most 2 function calls next to each other because they are at different levels
and you are also connecting your function output directly to your function input (parent function output in my case)
with function inputs you are able to avoid direct connections or using local variables as aliases by using the function input variables
seems when you cant use the function output that way in a blueprint without direct connection
in this elementary example i can only pass the result of function b which is also the output of function a by direct connection or by using a local variable
i cant use it the way you would use a function input (see nr in this example)
1 Like
I think if you don’t call the output node, you won’t get a result.
If you just want to ‘do something’, then that would be a custom event.
it is a very elementary example
perhaps to trivial to show the issue
thing is on the output side of functions it does not seem you can reference function variables like you can on the input side of functions
which makes it difficult to keep a blueprint tidy if you are not using local variable s to store copies
1 Like
If you use variables local to the function, you can’t talk to them outside the function. But it’s also possible to write a function that uses variables from the main graph ( as long as it’s not part of a function library etc ).
lets see if i ask the same thing differently
this is a function variable for lack of better term - a variable obtained from a function input
can you get this for a function output
if not it is a pity as it will help in cases where a function is a number of levels deep and you want to bubble a result up from the bottom level function to the top level function
in my case it is really
function a calling function b calling function c and the result of function c must reach function a again preferably by reference rather than by value
here is simply the elementary case of function a calling function b and returning the result obtained from b
it is elementary in that it is only 2 layers deep
and it is simply passing a boolean and not something more complex like a struct etc
question: if you connect it as above, is it passing the output of function b back by value or by reference
Yes, make an output node, and plug it in 
You can always pass the input to the output, even in a library…
1 Like
i tried but for some reason could not do the same for an function output
true but in some cases it does contrary to managing the tidiness and orderliness of the blueprint particularly in more sophisticated blueprints
it works better if i use / declare a variable top level
then pass by ref works and bottom layer functions dont really need to pass anything back
top level functions only need to pass by ref to lower level functions (and this is supported in blueprint)
thanks
1 Like