It is currently April 19th, 2024, 9:04 am

Using Play in a conditional - cant opt to mute [solved]

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Using Play in a conditional - cant opt to mute [solved]

Post by CodeCode »

Hello,
I have a sound playing when a conditional value is reached, like this:

Code: Select all

[Variables]
On=Play #@#on.wav
Off=Play #@#off.wav
No=PlayStop
Sound=1

[MeasureSliderBop]
Measure=Plugin
Plugin=ActionTimer
IfCondition=((#OffSetB# < 0) && (#Sound# > 0))
IfTrueAction=[#Off#]
IfFalseAction=[#Off#][Wait 100][#No#]
IfCondition2=((#OffSetB# > -140) && (#Sound# > 0))
IfTrueAction2=[#On#]
IfFalseAction2=[#On#][Wait 100][#No#]
DynamicVariables=1

[MeterLowTextHidden]
Meter=STRING
LeftMouseUpAction=[!SetVariable Sound "(1-#Sound#)"][!WriteKeyValue Variables Sound "[#Sound]"][!Update]
DynamicVariables=1
Is it because actiontimer doesn't like conditionals? That can't be right since I am throwing them around like wildfire. Can't seem to find the winning combination here. Not sure what I have tried but at this stage, still no joy.

Thanks for any help or recommendations.
Last edited by CodeCode on May 8th, 2022, 12:06 pm, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Play in a conditional - cant opt to mute

Post by CodeCode »

Ok. SOrry.

No problem here. I was testing only one part of the skin and there are three where those sounds play. Testing the wrong one.

The one with that code works fine.

So SOLVED> :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Play in a conditional - cant opt to mute [solved]

Post by CodeCode »

ok, just to be clear this is what works. The IfFalseAction is not needed:

Code: Select all

IfCondition=((#OffSetB# < 0) && (#Sound# > 0))
IfTrueAction=[#Off#]
IfCondition2=((#OffSetB# > -140) && (#Sound# > 0))
IfTrueAction2=[#On#]
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.