script for fps games

Official forum for open source FreePIE discussion and development.
Post Reply
icedd
One Eyed Hopeful
Posts: 2
Joined: Tue Jan 21, 2014 2:24 pm

script for fps games

Post 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.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: script for fps games

Post 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
icedd
One Eyed Hopeful
Posts: 2
Joined: Tue Jan 21, 2014 2:24 pm

Re: script for fps games

Post 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?
genius69
One Eyed Hopeful
Posts: 2
Joined: Wed Aug 27, 2014 6:38 am

Re: script for fps games

Post 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
Post Reply

Return to “FreePIE”