Jump to content
Roland

CallOutputs return value?

Recommended Posts

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

Share this post


Link to post

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 by beo6

Share this post


Link to post

Just to confirm, CallOutputs does not return a value:

void Entity::CallOutputs(const std::string& name)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...