Dive Board



Re: Durovis Dive Play Computer Games Easy Step Guide

Re: Durovis Dive Play Computer Games Easy Step Guide

by Amantis on Jul 4th, 2014 05:27 AM

def update()&#58;   <br />    #Apply deadband filter to avoid drift<br />    #And continousRotation filter to yaw axis to avoid jumps when passing tracker center<br />    x = filters&#46;deadband(filters&#46;delta(math&#46;degrees(filters&#46;continousRotation(android&#91;0&#93;&#46;yaw))), deadband)<br />    y = filters&#46;deadband(filters&#46;delta(math&#46;degrees(-android&#91;0&#93;&#46;pitch)), deadband)<br />      <br />    mouse&#46;deltaX = x * multiply<br />    mouse&#46;deltaY = y * multiply<br />   <br />if starting&#58; <br />    deadband = 0&#46;01<br />    multiply = 5<br />    android&#91;0&#93;&#46;update += update

Amantis

Posts: 22

Joined: 27.06.2014


Re: Durovis Dive Play Computer Games Easy Step Guide

by Sipheren on Jul 4th, 2014 05:40 AM

"Amantis" wrote:
code



Try this one, it's from the first page of this thread.

def update()&#58;<br />	global yaw<br />	global roll<br />	global pitch<br />	yaw = -android&#91;0&#93;&#46;googleYaw<br />	roll = -android&#91;0&#93;&#46;googleRoll<br />	pitch = android&#91;0&#93;&#46;googlePitch<br /><br />if starting&#58;<br />	yaw = 0<br />	roll = 0<br />	pitch = 0<br />	enabled = False<br />	android&#91;0&#93;&#46;update += update<br /><br />diagnostics&#46;watch(yaw)<br />diagnostics&#46;watch(roll)<br />diagnostics&#46;watch(pitch)<br /><br />deltaYaw = filters&#46;delta(yaw)<br />deltaPitch = filters&#46;delta(pitch)<br />deltaRoll = filters&#46;delta(roll)<br /><br />if (enabled)&#58;<br />	mouse&#46;deltaX = -deltaYaw*600<br />	mouse&#46;deltaY = -deltaRoll*1000<br /><br />toggle = keyboard&#46;getPressed(Key&#46;M)<br /><br />if toggle&#58;<br />	enabled = not enabled


You might want to keep the drift removal part from the start.

Sipheren

Posts: 19

Joined: 27.06.2014

dive-owner


Re: Durovis Dive Play Computer Games Easy Step Guide

by Amantis on Jul 4th, 2014 05:53 AM

That one does nothing, mouse doesn't move at all. Is there something special I have to do?

Amantis

Posts: 22

Joined: 27.06.2014


Re: Durovis Dive Play Computer Games Easy Step Guide

by Sipheren on Jul 4th, 2014 06:00 AM

"Amantis" wrote:
That one does nothing, mouse doesn't move at all. Is there something special I have to do?



Not that I know of.

Make sure you have freePIE installed and running on your phone and then start the script.

Sipheren

Posts: 19

Joined: 27.06.2014

dive-owner


Re: Durovis Dive Play Computer Games Easy Step Guide

by Amantis on Jul 4th, 2014 06:09 AM

Er, yeah did that its how I got the other script to work. Doesn't do anything

Amantis

Posts: 22

Joined: 27.06.2014


Re: Durovis Dive Play Computer Games Easy Step Guide

by Amantis on Jul 4th, 2014 06:15 AM

Oh god I have to press M to toggle.

Amantis

Posts: 22

Joined: 27.06.2014


Re: Durovis Dive Play Computer Games Easy Step Guide

by Sipheren on Jul 4th, 2014 06:16 AM

"Amantis" wrote:
Oh god I have to press M to toggle.



Oh sorry, forgot to mention that. It has a toggle there at the bottom of the script so you can disable it.

Sipheren

Posts: 19

Joined: 27.06.2014

dive-owner


Re: Durovis Dive Play Computer Games Easy Step Guide

by Moerf on Jul 4th, 2014 10:48 AM

You should also use this lines to prevent the mouse from jumping when you reach the end of the screen:

<br />if math&#46;fabs(deltaYaw) &gt;= math&#46;pi&#58;<br />   deltaYaw = 0<br />


so in total:

<br />def update()&#58;<br />   global yaw<br />   global roll<br />   global pitch<br />   yaw = -android&#91;0&#93;&#46;googleYaw<br />   roll = -android&#91;0&#93;&#46;googleRoll<br />   pitch = android&#91;0&#93;&#46;googlePitch<br /><br />if starting&#58;<br />   yaw = 0<br />   roll = 0<br />   pitch = 0<br />   enabled = False<br />   android&#91;0&#93;&#46;update += update<br /><br />if math&#46;fabs(deltaYaw) &gt;= math&#46;pi&#58;<br />   deltaYaw = 0<br /><br />diagnostics&#46;watch(yaw)<br />diagnostics&#46;watch(roll)<br />diagnostics&#46;watch(pitch)<br /><br />deltaYaw = filters&#46;delta(yaw)<br />deltaPitch = filters&#46;delta(pitch)<br />deltaRoll = filters&#46;delta(roll)<br /><br />if (enabled)&#58;<br />   mouse&#46;deltaX = -deltaYaw*600<br />   mouse&#46;deltaY = -deltaRoll*1000<br /><br />toggle = keyboard&#46;getPressed(Key&#46;M)<br /><br />if toggle&#58;<br />   enabled = not enabled<br /><br />

Moerf

Posts: 21

Joined: 10.12.2013


Re: Durovis Dive Play Computer Games Easy Step Guide

by nils16 on Jul 4th, 2014 16:17 PM

Thx, but then comes "Line: 16: name 'deltaYaw' is not defined"

nils16

Posts: 29

Joined: 25.11.2013


Re: Durovis Dive Play Computer Games Easy Step Guide

by Sipheren on Jul 5th, 2014 00:51 AM

"nils16" wrote:
Thx, but then comes "Line: 16: name 'deltaYaw' is not defined"



Try this:

def update()&#58;<br />   global yaw<br />   global roll<br />   global pitch<br />   yaw = -android&#91;0&#93;&#46;googleYaw<br />   roll = -android&#91;0&#93;&#46;googleRoll<br />   pitch = android&#91;0&#93;&#46;googlePitch<br /><br />if starting&#58;<br />   yaw = 0<br />   roll = 0<br />   pitch = 0<br />   enabled = False<br />   android&#91;0&#93;&#46;update += update<br /><br />diagnostics&#46;watch(yaw)<br />diagnostics&#46;watch(roll)<br />diagnostics&#46;watch(pitch)<br /><br />deltaYaw = filters&#46;delta(yaw)<br />deltaPitch = filters&#46;delta(pitch)<br />deltaRoll = filters&#46;delta(roll)<br /><br />if math&#46;fabs(deltaYaw) &gt;= math&#46;pi&#58;<br />   deltaYaw = 0<br /><br />if (enabled)&#58;<br />   mouse&#46;deltaX = -deltaYaw*600<br />   mouse&#46;deltaY = -deltaRoll*1000<br /><br />toggle = keyboard&#46;getPressed(Key&#46;M)<br /><br />if toggle&#58;<br />   enabled = not enabled

Sipheren

Posts: 19

Joined: 27.06.2014

dive-owner