Page 1 of 1

how to unset LuaConstantCombinatorControlBehavior signal?

Posted: Sun Oct 18, 2020 3:27 pm
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.

Re: how to unset LuaConstantCombinatorControlBehavior signal?

Posted: Sun Oct 18, 2020 4:02 pm
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.

Re: how to unset LuaConstantCombinatorControlBehavior signal?

Posted: Mon Oct 19, 2020 11:32 am
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.