Entra:     


Forum: VirtualDJ Skins

Topic: Multiple IF/tests

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

Hey,

Just registered on the forum after lurking from my bedroom DJing, trying to make my own skin but can't work out the VDJscript to go with it.
What I have is an effect bank with a Left and Right selection button (Apply effects to left/right deck).
So there are 4 options:
Left & right active
Left active but right not
Left not active but right is active
Both not active (for whatever reason, not really required)

But I can't figure out how to code it, I can nest the var checks but they don't cover all options.
I got to this:
var '$Left' 1 ? deck 1 effect_activate 1 'flanger' & var '$Right' 1 ? deck 2 effect_activate 1 'flanger'
Obviously this only activates the right deck effect when the left deck is active too...
Usually I'd solve this by just doing it twice, something like:
var '$Left' 1 ? deck 1 effect_activate 1 'flanger' & var '$Right' 1 ? deck 2 effect_activate 1 'flanger' : var '$Right' 1 ? deck 2 effect_activate 1 'flanger'
Which I hoped would check if $Left is 1 and if it is then check if Right is 1 or if Left is not 1 go to the : part but that links to the Right check.
Gets quite confusing anyway.

Any way to do a var check, end that check and run another separate check after it regardless of the result of the first var check?
 

Inviato Sat 09 Sep 17 @ 3:00 pm
I made a wish of this earlier, something like a end script char or a new script verb, not possible yet
Try like this
var '$Left' 1 ? var '$Right' 1 ? deck 1 effect_activate 1 'flanger' & deck 2 effect_activate 1 'flanger' : deck 1 effect_activate 1 'flanger' : var '$Right' 1 ? deck 2 effect_activate 1 'flanger' : nothing

var '$Left' 1 ?
-->var '$Right' 1 ?
-->-->deck 1 effect_activate 1 'flanger' & deck 2 effect_activate 1 'flanger' :
-->-->deck 1 effect_activate 1 'flanger' :
-->var '$Right' 1 ?
-->-->deck 2 effect_activate 1 'flanger' :
-->-->nothing

the problem is doing it this way every extra query double the text size of the script, not a problem here but I've had scripts running to 70K chars
you can do this [this is about the same size for your simple script but will save typing for 3+ query scripts]
repeat_start_instant 'rsiCheckInSteps' 33ms 2 & cycle 'StepVar' 2 & var 'StepVar' 1 ? var '$Left' 1 ? deck 1 effect_activate 1 'flanger' : nothing : var '$Right' 1 ? deck 2 effect_activate 1 'flanger' : nothing

repeat_start_instant 'rsiCheckInSteps' 33ms 2 & cycle 'StepVar' 2 & var 'StepVar' 1 ?
-->var '$Left' 1 ?
-->-->deck 1 effect_activate 1 'flanger' :
-->-->nothing :
-->var '$Right' 1 ?
-->-->deck 2 effect_activate 1 'flanger' :
-->-->nothing
 

ProgD wrote :

Usually I'd solve this by just doing it twice, something like:
var '$Left' 1 ? deck 1 effect_activate 1 'flanger' & var '$Right' 1 ? deck 2 effect_activate 1 'flanger' : var '$Right' 1 ? deck 2 effect_activate 1 'flanger'


You missed the " : nothing" for left true right false
This is what you asked

var '$Left' 1 ?
-->deck 1 effect_activate 1 'flanger' & var '$Right' 1 ?
-->-->deck 2 effect_activate 1 'flanger' :
-->-->var '$Right' 1 ?
-->-->-->deck 2 effect_activate 1 'flanger'

This is what you should have asked

var '$Left' 1 ?
-->deck 1 effect_activate 1 'flanger' & var '$Right' 1 ?
-->-->deck 2 effect_activate 1 'flanger' :
-->-->nothing :
-->var '$Right' 1 ?
-->-->deck 2 effect_activate 1 'flanger'
 

You sir are a genius! (And I need to research better...)
That works, thanks so much this was driving me crazy.

Also, that fast response, awesome!
 

No worries, it was skinning and asking questions (and trial & error, erro,r error) that developed my script knowledge.
Keep at it and when you get stuck ask a question.
 



(Vecchi argomenti e forum sono automaticamente chiusi)