I also happen to have some snippets that should be useful.
Dot product and cross product of two vectors as orientations, Ou and Ov:
Set var "dotP" = ((Ou/3-1)*(Ov/3-1) + (Ou%3-1)*(Ov%3-1)) * (1+(Ou%2)*(Ov%2))
Set var "crossP" = ((Ou/3-1)*(Ov%3-1) - (Ou%3-1)*(Ov/3-1)) * (1+(Ou%2)*(Ov%2))
This should return an integer between -2 to 2: for dot product, parallel vectors give 2, 45/135 degrees angle inbetween gives 1/-1, perpendicular vectors give 0, and antiparallel vectors give -2. Cross product is more or less the same, but with usual cross product rules and right-hand rule compliant.
Practical use: Check things with directional dependence, especially force arrow blocking checks, without tons of if checks.
Oh, and also
magic formulae to convert ArrowO and TunnelO to _O:
ArrowO to _O
Set var ".O" = ( (ArrowO-4)%8 - 2*((ArrowO-17)%3)*(ArrowO/14) + ((-2*(ArrowO/15))+(4*(ArrowO/16))-(2*(ArrowO/19))) )%9
TunnelO to _O
Set var "_O" = 4 + 1*(((TunnelO-56)/6+1)/2)*((TunnelO%2)*2-1) + 3*(((TunnelO-56)/6-1)/2)*((TunnelO%2)*2-1)
Note: TSS arrows are ranged from 13-20, not 12-19. So just add every value for the arrows in the above topic Nuntar linked by 1. i.e:
Arrows Tunnels _O
20 13 14 47 0 1 2
19 15 64 63 3 5
18 17 16 48 6 7 8
[Last edited by uncopy2002 at 12-19-2016 12:55 PM]