ifThen statement to send only 1ST OSC message with button trigger & not the 2nd

I’m working on a simple TD-Unreal Engine test link & am using a button trigger to then send the value to unreal engine. However I am struggling to write the if-then statement necessary to only send the pressed/1st value, as the released/second OSC value of 0 is not desirable for the triggering. Im using a > 0 expression but I know my tscript isn’t right. Any tips? Thank you!

if ( op(‘oscout1’).sendOSC > 0 ) [then send -f IP ADDRESS]

if ( op(‘oscout1’).sendOSC = 0 )

endif

Hi Kelly,
If I understood what you re trying to achieve, you want to send a OSC value only when the button is pressed, not when it’s released?

If that’s the case, look at the operator snippets, OSC in DAT, first example “sending messages”.
That example uses a Panel execute DAT connected to a button, with an off to on function.
The snippet is under OSC in DAT but shows OSC out examples as well.

I hope this helps!

Also, if there is no reason you have to use tscript, switch over to python :slight_smile: tscript is deprecated and basicly no longer supported.

Interesting, how recent is this? I admit I’m getting back into TD after a long hiatus and haven’t heard about this.

Hi Fausto, yes I only want the pressed OSC value to be sent (the actual value) and the 2nd value (released) to not be sent as it = 0 and will cause problems. However in this case I created a custom trigger parameter in touchdesigner vs a button. I will see if this can also be completed with a button. But yes I want to prevent a 2nd OSC value from ever leaving touchdesigner

Ok, let us know if you need a hand to adjust the python code to your specific situation.

It could be done in a number of ways, execute DATs and minimal python could be one, or something like a logic Chop could also work if you are more familiar & comfortable with that workflow.

If you need a hand with your specific scenario, perhaps best to provide a simplified version of your network; take out everything and keep only the bare minimum related to the problem you are trying to resolve.

That has to be a long hiatus :slight_smile:
I think its arround 5 years now.