Ask a simple question, get a simple answer
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
So it needs to be stereo?
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
Sounds NEVER need to be stereo. But 3D sounds CANNOT be stereo. 2D sounds can be stereo or mono.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
is there a way to ask if a socket holds NOT a specific item?
I have 4 sockets. several doors have to open if the combination of gems in them is right.
so what works well is
But now I have to check if socketA has a gem, socketB has a gem, socketC has everything but not a gem, socketD has everything but not a gem.
Is there a way to deny the query?
I have 4 sockets. several doors have to open if the combination of gems in them is right.
so what works well is
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
Is there a way to deny the query?
Re: Ask a simple question, get a simple answer
concerning to my previous post: it seems there is nothing like an "if not" command, right?
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
http://lmgtfy.com/?q=lua+if+notTHOM wrote:concerning to my previous post: it seems there is nothing like an "if not" command, right?
Re: Ask a simple question, get a simple answer
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?
http://www.troubleshooters.com/codecorn/lua/luaif.htm
Re: Ask a simple question, get a simple answer
found out, this works
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
Re: Ask a simple question, get a simple answer
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.
Have tried to use Component:addConnector(event, target, action) in a few ways without results.
Done a workaround using a LeverComponent for now.
Re: Ask a simple question, get a simple answer
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.
When a connector is triggered, it tries to find the target entity, and if successful, calls the action function in the component of that entity named "controller". For example, door objects have a ControllerComponent named "controller" with onOpen, onClose, and onToggle hooks, so the action can be "open", "close", or "toggle". script_entity objects have a ScriptControllerComponent named "controller" which can see all public functions defined in the object's ScriptComponent named "script", so if you define a function called "moo" in that ScriptComponent, a connector with that object as its target can use "moo" as an action.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
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.
Visual scripting via the GUI.
@Hei&Yin: That doesn't exist in the editor; except as seen in the connector UI for triggers and teleporters. It could be a neat feature to add, but probably more work than it's worth. It's far easier to spend a day learning the basics of the task using script; unless you have a specific reason that demands a scriptless GUI?