Dolphin, the GameCube and Wii emulator - Forums

Full Version: Creating a conditional input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all, I've been trying to map a conditional input, so Dolphin register the input only if I move my mouse a certain speed

I figured I'd have to use the If function, but beyond the start of it, I'm a bit stumped
What am I supposed to put as the true_expression and false_expression?

This is my current function, missing the true and false

if(`DInput/0/Keyboard Mouse:Axis X-`|`DInput/0/Keyboard Mouse:Axis X+`>1, , )

I know what true and false are FOR, but I don't know, in dolphin case, how I'm supposed to write them, and googling various things (like dolphin function input, or dolphin if input) yielded no infos

Anyone know what I need to put in there to make it work?

thanks in advance!
Update: I tried putting a simple "true" and "false" in the respective spaces, but it still didn't work

I'm still no closer to solving this :c
(03-30-2020, 02:55 AM)FelinaLain Wrote: [ -> ]Hello all, I've been trying to map a conditional input, so Dolphin register the input only if I move my mouse a certain speed

I figured I'd have to use the If function, but beyond the start of it, I'm a bit stumped
What am I supposed to put as the true_expression and false_expression?

This is my current function, missing the true and false

if(`DInput/0/Keyboard Mouse:Axis X-`|`DInput/0/Keyboard Mouse:Axis X+`>1,  ,  )

I know what true and false are FOR, but I don't know, in dolphin case, how I'm supposed to write them, and googling various things (like dolphin function input, or dolphin if input) yielded no infos

Anyone know what I need to put in there to make it work?

thanks in advance!

As far as I know, true_expression is what's used if the condition is true and false_expression is what's used if the condition is false (like an if/else statement).

For example:
if(`Shoulder L`, 18.00, 72.00)
Will pass through 18 as a value if Shoulder L is pressed and pass through 72 if Shoulder L isn't pressed.

Anyway, maybe something like this on each of the axes will work? (I don't know what you're using it for, of course, so adjust as needed)
if(`DInput/0/Keyboard Mouse:Axis X-` > 0.5, `DInput/0/Keyboard Mouse:Axis X-`, 0)

Don't know if it'll work for what you're doing, but hopefully this helps.

Edit: Found a conditional to make the inputs less stiff, since slight movements on one axis during strong movements on the other axis weren't reading:
(`DInput/0/Keyboard Mouse:Axis X-` > 0.5 | `DInput/0/Keyboard Mouse:Axis Y-` > 0.5 | `DInput/0/Keyboard Mouse:Axis Y+` > 0.5)
(04-02-2020, 01:32 PM)Rusty Potato Wrote: [ -> ]As far as I know, true_expression is what's used if the condition is true and false_expression is what's used if the condition is false (like an if/else statement).

For example:
if(`Shoulder L`, 18.00, 72.00)
Will pass through 18 as a value if Shoulder L is pressed and pass through 72 if Shoulder L isn't pressed.

Anyway, maybe something like this on each of the axes will work? (I don't know what you're using it for, of course, so adjust as needed)
if(`DInput/0/Keyboard Mouse:Axis X-` > 0.5, `DInput/0/Keyboard Mouse:Axis X-`, 0)

Don't know if it'll work for what you're doing, but hopefully this helps.

Edit: Found a conditional to make the inputs less stiff, since slight movements on one axis during strong movements on the other axis weren't reading:
(`DInput/0/Keyboard Mouse:Axis X-` > 0.5 | `DInput/0/Keyboard Mouse:Axis Y-` > 0.5 | `DInput/0/Keyboard Mouse:Axis Y+` > 0.5)

Aaaah thanks that worked!
That's the part I was missing, the idea of putting the input as a true or false, and the 0 for false
Thanks tons!