Switch On/Off Output

Hello everyone, @grazer, would it be possible to have two new outputs on the Switch behavior?

One would be for the On input and the other for the Off input. There isn’t much to explain but I know there have been countless times where this would be useful, it just makes the code easier to follow and would make things more organized.

Switch On Off Triggers

2 Likes

Wait. What witchcraft is this how did you even make this :no_mouth:

1 Like

Uhhh… I took a screenshot and photoshopped it with Paint 3d.

1 Like

Niiice
I wanna see if I can actually make this block (perhaps change some code in the import behavior and take a crash course on HACKX (or whatever they use))

1 Like

Anyway, what do you think of the idea?

1 Like

Cool
OKAY I JUST REALIZED WE CAN CUSTOM MAKE BLOCKS
image

2 Likes

Lookin’ good!

2 Likes

Okay now I just need to figure out how to make it work…

2 Likes
"Here I made a thing

{“data”:{“behavior”:{“v”:“2”,“nodes”:[{“inputCount”:3,“outputCount”:3,“name”:“Switch”,“behaviorType”:“logic.NodeGroup”,“x”:-450,“y”:192,“group”:"",“id”:“dc66532253dbd840”,“isMenuItem”:false},{“inputCount”:0,“outputCount”:1,“name”:“Bundle Input”,“behaviorType”:“logic.NodeGroupInput”,“x”:-90,“y”:-32,“group”:“dc66532253dbd840”,“id”:“dc66639d12c99140”,“portId”:“dc66532253dbd840i0”,“tag”:“On”,“dataType”:2},{“inputCount”:0,“outputCount”:1,“name”:“Bundle Input”,“behaviorType”:“logic.NodeGroupInput”,“x”:-90,“y”:32,“group”:“dc66532253dbd840”,“id”:“dc6666a1000a1b49”,“portId”:“dc66532253dbd840i1”,“tag”:“In”,“dataType”:2},{“inputCount”:0,“outputCount”:1,“name”:“Bundle Input”,“behaviorType”:“logic.NodeGroupInput”,“x”:-90,“y”:-96,“group”:“dc66532253dbd840”,“id”:“dc66676b6e2a2a43”,“portId”:“dc66532253dbd840i2”,“tag”:“Off”,“dataType”:2},{“inputCount”:3,“outputCount”:1,“name”:“Switch”,“behaviorType”:“logic.logic.Switch”,“x”:90,“y”:0,“group”:“dc66532253dbd840”,“id”:“dc66bff41c2d094c”,"_startVal":0,“dataType”:2},{“inputCount”:1,“outputCount”:0,“name”:“Bundle Output”,“behaviorType”:“logic.NodeGroupOutput”,“x”:270,“y”:-96,“group”:“dc66532253dbd840”,“id”:“dc67dd4c43f4064c”,“portId”:“dc66532253dbd840o0”,“tag”:“Off”,“dataType”:2},{“inputCount”:1,“outputCount”:0,“name”:“Bundle Output”,“behaviorType”:“logic.NodeGroupOutput”,“x”:270,“y”:-32,“group”:“dc66532253dbd840”,“id”:“dc67dfb7ed6d2e4a”,“portId”:“dc66532253dbd840o1”,“tag”:“On”,“dataType”:2},{“inputCount”:1,“outputCount”:0,“name”:“Bundle Output”,“behaviorType”:“logic.NodeGroupOutput”,“x”:270,“y”:32,“group”:“dc66532253dbd840”,“id”:“dc67e2154b357042”,“portId”:“dc66532253dbd840o2”,“tag”:“Out”,“dataType”:2}],“links”:[{“input_id”:“dc67dfb7ed6d2e4ai0”,“output_id”:“dc66639d12c99140o0”},{“input_id”:“dc66bff41c2d094ci1”,“output_id”:“dc66639d12c99140o0”},{“input_id”:“dc66bff41c2d094ci2”,“output_id”:“dc6666a1000a1b49o0”},{“input_id”:“dc67dd4c43f4064ci0”,“output_id”:“dc66676b6e2a2a43o0”},{“input_id”:“dc66bff41c2d094ci0”,“output_id”:“dc66676b6e2a2a43o0”},{“input_id”:“dc67e2154b357042i0”,“output_id”:“dc66bff41c2d094co0”}]}}}

Now if I can figure out a way to transfer this bundle into a switch…

I don’t see the point of this, you can already achieve the desired result with the already available set of behaviors. What are you trying to do?

2 Likes

I’m trying to find a way to manipulate the input system to make a functional custom block (a lot of words, I know)

1 Like

I was actually talking to @AbstractGallery, but I’m interested to see what you come up with

1 Like

Hey @Ramshackle, I do realize that this could be considered useless because you could just use whatever output that triggers the On or Off to act as the output, but I feel like this would just be something that would keep the code more organized even though it doesn’t improve the way Flowlab works.

2 Likes

I really don’t see the point in it; behaviors are scanned left to right, up and down in the editor.
I feel like this would slow down the process of links being activated on a lower level.
As well links to turn on/off switches are usually specific, not much would be going from their respected outputs (that I can think of).

2 Likes