Roland Posted September 11, 2015 Share Posted September 11, 2015 Can self.component:CallOutput( "something" ) give a return value ? Means that the in-function returns a value that is passed to the CallOutput return Lua1.lua -------------------------------------------------------------------------------- function Script:func() local retval = self.component:CallOutput( "something" ) System:Print( retval ) -- prints "Hello" ? end Lua2.lua --------------------------------------------------------------------------------- function Script:something()--in return "Hello" end 1 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Roland Posted September 11, 2015 Author Share Posted September 11, 2015 Tested a bit and it seems that its not supported Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
beo6 Posted September 12, 2015 Share Posted September 12, 2015 (edited) it can't at least directly. But you can do it with 3 functions. 1. the argument function: function Script:something()--arg return "Hello" end 2. the output function: function Script:Use() self.component:CallOutputs("Use") end 3. the receiving function: function Script:Receive(yourvalue)--in System:Print( yourvalue ) end now just connect the use function with the receive function and drag the something function to the argument point in the flowgraph. //edit: just like in some of my scripts. For example this: http://www.leadwerks.com/werkspace/page/viewitem?fileid=510080616 Edited September 12, 2015 by beo6 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted September 14, 2015 Share Posted September 14, 2015 Just to confirm, CallOutputs does not return a value: void Entity::CallOutputs(const std::string& name) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.