Jump to content

Recommended Posts

Posted

My code boils down to this;

 

in C++

Leadwerks::World* world = Leadwerks::World::GetCurrent();
Leadwerks::Entity* e=world->FindEntity(EntityName);
if ( output ) {
e->CallOutputs(EntityFunction);
}else{
e->CallFunction(EntityFunction);
}

 

 

in the first lua script

 

function Script:TestOutput(event)--out
print("[Lua] TestOutput");
if ( type(event)=="table" ) then
print ( "TestOutput has event data")
end
self.component:CallOutputs("TestOutputxx")
end

 

in the 2nd lua script

function Script:TestInput(event) --in
print("[Lua] TestInput");
if ( type(event)=="table" ) then
print ( "TestInput has event data")
end
end

 

 

Calling the function TestOutput works - it ends up calling TestInput, but when I try to skip the middle man and call "TestOutputxx" notting happens.

 

Is that a bug or am I missing something?

 

 

ps. code tags are murdering my indentation - sorry about that

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Posted

This is not official API stuff, but the actual way it works is Entity->component->CallOutputs(const std::string& outputname)

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

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...