How to cycle between 3 different states/stances? (Hard to describe in tittle, please read the post)
Posted: 16 Jan 2022, 04:54
Hello everyone.
Dayum this tittle may be confusing and it's going to be hard as heck to explain so here it goes:
Let's say I have three different stances or states: A, B and C.
I usually always start at state B, or rather, to understand it better, with B in the middle: A<--B-->C
Pressing the key 'z' moves the states to the left so it cycles through A<--B-->C to: B<--C-->A
Pressing the key 'x' moves the states to the right, so if we initially had A<--B-->C, now we would have: C<--A-->B
I want to set up this system in place in the script. I want the script to remember every state I'm in at all times, then I want to do as follows:
With that fixed cycling system in place I want to freely go from A to B to C or in any order by pressing the keys 1, 2 or 3, where 1 always puts me in state A, 2 in state B and 3 in state C, regardless of what state I'm currently at.
Just for reference, the state in the middle is the one I want to be at when I press either 1, 2 or 3.
Let's say I'm in state B as a standard and the script knows it, I press 1, so I want to go to state A, the script now sends the x input to go to state A, now the script knows I'm in state A.
I'm in state B but now I want to go to state C, I press 3, the script recognizes I'm in B and that I want to go to C, so it sends the z imput to cycle to state C, now the script knows I'm in state C.
Let's say I'm at state A and I want to go to C, so I press 3, it knows I'm at A so it sends the input x to cycle to the right to go to state C.
It should work with every single combination possible:
A to B -> pressing 2
B to A -> pressing 1
A to C -> pressing 3
C to A -> pressing 1
B to C -> pressing 3
C to B -> pressing 2
Basically I want to freely go from A to B to C by pressing 1, 2 or 3 respectively, but the catch is that I can only cycle through them one at a time with either z (moves to the left) or x ( moves to the right).
Any ideas on how to do this?
Dayum this tittle may be confusing and it's going to be hard as heck to explain so here it goes:
Let's say I have three different stances or states: A, B and C.
I usually always start at state B, or rather, to understand it better, with B in the middle: A<--B-->C
Pressing the key 'z' moves the states to the left so it cycles through A<--B-->C to: B<--C-->A
Pressing the key 'x' moves the states to the right, so if we initially had A<--B-->C, now we would have: C<--A-->B
I want to set up this system in place in the script. I want the script to remember every state I'm in at all times, then I want to do as follows:
With that fixed cycling system in place I want to freely go from A to B to C or in any order by pressing the keys 1, 2 or 3, where 1 always puts me in state A, 2 in state B and 3 in state C, regardless of what state I'm currently at.
Just for reference, the state in the middle is the one I want to be at when I press either 1, 2 or 3.
Let's say I'm in state B as a standard and the script knows it, I press 1, so I want to go to state A, the script now sends the x input to go to state A, now the script knows I'm in state A.
I'm in state B but now I want to go to state C, I press 3, the script recognizes I'm in B and that I want to go to C, so it sends the z imput to cycle to state C, now the script knows I'm in state C.
Let's say I'm at state A and I want to go to C, so I press 3, it knows I'm at A so it sends the input x to cycle to the right to go to state C.
It should work with every single combination possible:
A to B -> pressing 2
B to A -> pressing 1
A to C -> pressing 3
C to A -> pressing 1
B to C -> pressing 3
C to B -> pressing 2
Basically I want to freely go from A to B to C by pressing 1, 2 or 3 respectively, but the catch is that I can only cycle through them one at a time with either z (moves to the left) or x ( moves to the right).
Any ideas on how to do this?