Page 1 of 1

script for fps games

Posted: Sun Apr 06, 2014 5:18 am
by icedd
anyone have a script for fps games using wiimote plus for mouse emulation and nunchuck for movement. iam new to this and i dont have any experience writing scripts.

Re: script for fps games

Posted: Mon Apr 07, 2014 1:30 am
by CyberVillain
Here is one using the Dpad on wiimote for walking, not tested just a quick mockup

Code: Select all

def motionUpdate():
	mouse.deltaX = filters.deadband(filters.delta(wiimote[0].ahrs.yaw), 0.1) * scale
	mouse.deltaY = filters.deadband(-filters.delta(wiimote[0].ahrs.pitch), 0.1) * scale

def buttonUpdate():
	keyboard.setKey(Key.W, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadUp))
	keyboard.setKey(Key.S, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadDown))
	keyboard.setKey(Key.A, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadLeft))
	keyboard.setKey(Key.D, wiimote[0].nunchuck.buttons.button_down(WiimoteButtons.DPadRight))

if starting:
	scale = 10
	wiimote[0].enable(WiimoteCapabilities.MotionPlus)
	wiimote[0].motionplus.update += motionUpdate
	wiimote[0].buttons.update += buttonUpdate

Re: script for fps games

Posted: Mon Apr 07, 2014 7:12 am
by icedd
thanks for your answer but i start it but nothing working and the script stops.i have the tr version of wiimote maybe thats the problem?

Re: script for fps games

Posted: Thu Aug 28, 2014 2:44 pm
by genius69
:shock:
I would like to know if anyone has already managed to create a script for battlefield 4 or Assetto Corsa or Project Cars as Freetrack.
Thanks in advanc