how to unset LuaConstantCombinatorControlBehavior signal?

Place to get help with not working mods / modding interface.
Post Reply
ja2
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Oct 18, 2020 2:49 pm
Contact:

how to unset LuaConstantCombinatorControlBehavior signal?

Post by ja2 »

How do I unset constant combinator signal? I tried using LuaConstantCombinatorControlBehavior.set_signal like this:

Code: Select all

behavior.set_signal(n, nil)
behavior.set_signal(n, {})
behavior.set_signal(n, {type="item"})
behavior.set_signal(n, {type="item", name=""})
None of the above work, they all throw errors. Is there other way to do this? One way to clear all signals would be to remove the combinator and place a new one in the same place, but that seems like an overkill to me.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: how to unset LuaConstantCombinatorControlBehavior signal?

Post by DaveMcW »

Code: Select all

/c game.player.selected.get_control_behavior().set_signal(1, nil)
Something is wrong with your "behavior" or "n" variables.

ja2
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Oct 18, 2020 2:49 pm
Contact:

Re: how to unset LuaConstantCombinatorControlBehavior signal?

Post by ja2 »

Ok, it turns out I wasn't actually passing the values i stated i passed to set_signal(). i had some construction like:

Code: Select all

behavior.set_signal(n, {signal=signal, count=c})
and i assumed signal set earlier would be passed to set_signal() as is.
set_signal(n,null) works as expected. Thanks for helping out.

Post Reply

Return to “Modding help”