Code: Select all
function socketContains(socket, item)
for _,i in socket:contents() do
if i.go.name == item then return true
end
end
end
function checkSockets()
if socketContains(gem_socket_A.socket, "green_gem") and
socketContains(gem_socket_B.socket, "green_gem")
then
waterwall_6.controller:deactivate()
else
waterwall_6.controller:activate()
end
end
http://lmgtfy.com/?q=lua+if+notTHOM wrote:concerning to my previous post: it seems there is nothing like an "if not" command, right?
http://stackoverflow.com/questions/1165 ... hat-in-luaTHOM wrote:concerning to my previous post: it seems there is nothing like an "if not" command, right?
Code: Select all
if socketContains(gem_socket_A.socket, "green_gem") then
if not socketContains(gem_socket_B.socket, "green_gem") and
not socketContains(gem_socket_C.socket, "green_gem") and
not socketContains(gem_socket_D.socket, "green_gem")
then
I have no idea what you are actually asking here. When you add a connector to a component, that component needs to have a corresponding event to trigger the connector. For example, LeverComponent has an onActivate event. When it calls its onActivate hook, it will also call any onActivate connectors that it has.Hei&Yin wrote:Is it possible to make a ControllerComponent where you can add connectors, without scripting, inside the editor?
Have tried to use Component:addConnector(event, target, action) in a few ways without results.
Done a workaround using a LeverComponent for now.
Sounds like Hei&Yin is looking for a node editor after a fashion... similar to Kismet/trueSpace/Blender logic & node material editors.minmay wrote:I have no idea what you are actually asking here.Hei&Yin wrote:Is it possible to make a ControllerComponent where you can add connectors, without scripting, inside the editor?
Have tried to use Component:addConnector(event, target, action) in a few ways without results.
Done a workaround using a LeverComponent for now.