freepie скрипт для vjoy
Мышь в джойстик (vJoy + FreePIE + скрипт)
И так, есть очень много желающих управлять самолетом в режиме привязки к нему камеры, как будто мышка управляет джойстиком.
Предлагаемый способ дает возможность использовать мышь как джойстик, то есть, движения мыши по столу, игра будет рассматривать, как отклонение джойстика.
Установка
устанавливаем vJoy
Во время установки ничего не меняем, соглашаемся с установкой неподписанных драйверов в окошке с красным сообщением.
Дожидаемся сообщения vJoy installed sucefully и жмем OK.
Настройка виртуального джойстика
Проверяем что для виртуального джойстика назначены:
Если что-то не так, то убирайте лишнее, так как лишние настройки будут только мешать при проверке виртуального джойстика.
Жмем Apply и закрываем.
Проверка vJoy
Запускаем одно из 3х вариантов:
В игровых устройствах выбираем vJoy Device, жмем Дополнительно, выбираем предпочтительным устройством vJoy Device.
Подвигайте движки Axes в окне vJoy Feeder и щелкните на окно Свойства vJoy Device и убедитесь, что крестик переместился, так же как и вы поставили движок.
Если все ОК, закрывайте все 3 окна и переходим к следующему пункту.
Устанавливаем FreePIE
Проводим установку по умолчанию.
Выбираем файл test.py из архива.
Сворачиваем окно FreePIE.
Запускаем самолеты
Идем в настройки и сначала назначаем оси управления самолетом в схеме Джойстика, на виртуальный джойстик.
В настройках выбираем схему Джойстик.
Выбираем Тангаж, ставим мышку где-то на уровне Применить и двигаем ей, вверх-вниз. Когда отобразится Ось 1 (vJoy Device), жмем Применить.
Выбираем Рыскание, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 0 (vJoy Device), жмем Применить.
Выбираем Крен, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 2 (vJoy Device), жмем Применить.
Подвигайте мышкой и убедитесь, что точка управления джойстика движется вслед за курсором.
Кривые должны быть идеально прямыми!
Ставьте Вертикальная инверсия, если вы хотите, чтобы самолет двигался в ту же сторону, куда и мышь.
Для применения моей раскладки:
В расширенных настройках Джойстика выберите схему Личный и сохраните настройки.
Закройте клиент игры.
Запустите setting_win(.cmd) из архива.
Запустите клиент игры снова.
Расладка выглядит так:
Для игры используется скрипт mouse_joyz_mbm.py
Пример боя с такими настройками под спойлером. К сожалению, воспроизведение реплеев глючит, и я с удивлением узнал, что наводился не точно в точку упреждения, а куда-то рядом.
Обновление от 2015-05-25:
Сравнивая управление на Свободном горизонте с мышки и получившуюся схему, понял в чем причина сложностей управления и прицеливания.
На максимальных углах отклонения рулей, мышеводы используют клавиатуру, а мышкой только доводят самолет к цели.
Отсюда, решил попробовать сделать так же и на виртуальном джойстике.
Теперь, отклонение мыши отклоняет виртуальный джойстик с одинаковым усилием на любом отклонении от центра экрана.
При достижении мышью 100% края экрана, джойстик отклоняется на 55% от максимального значения.
Клавиатура WSADQERF забита на резкие маневры.
После 2х дневного тестирования, могу заявить, что данная схема мало чем уступает мышке по точности наведения.
Мышь в джойстик (vJoy + FreePIE + скрипт)
И так, есть очень много желающих управлять самолетом в режиме привязки к нему камеры, как будто мышка управляет джойстиком.
Предлагаемый способ дает возможность использовать мышь как джойстик, то есть, движения мыши по столу, игра будет рассматривать, как отклонение джойстика.
Установка
устанавливаем vJoy
Во время установки ничего не меняем, соглашаемся с установкой неподписанных драйверов в окошке с красным сообщением.
Дожидаемся сообщения vJoy installed sucefully и жмем OK.
Настройка виртуального джойстика
Проверяем что для виртуального джойстика назначены:
Если что-то не так, то убирайте лишнее, так как лишние настройки будут только мешать при проверке виртуального джойстика.
Жмем Apply и закрываем.
Проверка vJoy
Запускаем одно из 3х вариантов:
В игровых устройствах выбираем vJoy Device, жмем Дополнительно, выбираем предпочтительным устройством vJoy Device.
Подвигайте движки Axes в окне vJoy Feeder и щелкните на окно Свойства vJoy Device и убедитесь, что крестик переместился, так же как и вы поставили движок.
Если все ОК, закрывайте все 3 окна и переходим к следующему пункту.
Устанавливаем FreePIE
Проводим установку по умолчанию.
Выбираем файл test.py из архива.
Сворачиваем окно FreePIE.
Запускаем самолеты
Идем в настройки и сначала назначаем оси управления самолетом в схеме Джойстика, на виртуальный джойстик.
В настройках выбираем схему Джойстик.
Выбираем Тангаж, ставим мышку где-то на уровне Применить и двигаем ей, вверх-вниз. Когда отобразится Ось 1 (vJoy Device), жмем Применить.
Выбираем Рыскание, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 0 (vJoy Device), жмем Применить.
Выбираем Крен, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 2 (vJoy Device), жмем Применить.
Подвигайте мышкой и убедитесь, что точка управления джойстика движется вслед за курсором.
Кривые должны быть идеально прямыми!
Ставьте Вертикальная инверсия, если вы хотите, чтобы самолет двигался в ту же сторону, куда и мышь.
Для применения моей раскладки:
В расширенных настройках Джойстика выберите схему Личный и сохраните настройки.
Закройте клиент игры.
Запустите setting_win(.cmd) из архива.
Запустите клиент игры снова.
Расладка выглядит так:
Для игры используется скрипт mouse_joyz_mbm.py
Пример боя с такими настройками под спойлером. К сожалению, воспроизведение реплеев глючит, и я с удивлением узнал, что наводился не точно в точку упреждения, а куда-то рядом.
Обновление от 2015-05-25:
Сравнивая управление на Свободном горизонте с мышки и получившуюся схему, понял в чем причина сложностей управления и прицеливания.
На максимальных углах отклонения рулей, мышеводы используют клавиатуру, а мышкой только доводят самолет к цели.
Отсюда, решил попробовать сделать так же и на виртуальном джойстике.
Теперь, отклонение мыши отклоняет виртуальный джойстик с одинаковым усилием на любом отклонении от центра экрана.
При достижении мышью 100% края экрана, джойстик отклоняется на 55% от максимального значения.
Клавиатура WSADQERF забита на резкие маневры.
После 2х дневного тестирования, могу заявить, что данная схема мало чем уступает мышке по точности наведения.
Мышь в джойстик (vJoy + FreePIE + скрипт)
И так, есть очень много желающих управлять самолетом в режиме привязки к нему камеры, как будто мышка управляет джойстиком.
Предлагаемый способ дает возможность использовать мышь как джойстик, то есть, движения мыши по столу, игра будет рассматривать, как отклонение джойстика.
Установка
устанавливаем vJoy
Во время установки ничего не меняем, соглашаемся с установкой неподписанных драйверов в окошке с красным сообщением.
Дожидаемся сообщения vJoy installed sucefully и жмем OK.
Настройка виртуального джойстика
Проверяем что для виртуального джойстика назначены:
Если что-то не так, то убирайте лишнее, так как лишние настройки будут только мешать при проверке виртуального джойстика.
Жмем Apply и закрываем.
Проверка vJoy
Запускаем одно из 3х вариантов:
В игровых устройствах выбираем vJoy Device, жмем Дополнительно, выбираем предпочтительным устройством vJoy Device.
Подвигайте движки Axes в окне vJoy Feeder и щелкните на окно Свойства vJoy Device и убедитесь, что крестик переместился, так же как и вы поставили движок.
Если все ОК, закрывайте все 3 окна и переходим к следующему пункту.
Устанавливаем FreePIE
Проводим установку по умолчанию.
Выбираем файл test.py из архива.
Сворачиваем окно FreePIE.
Запускаем самолеты
Идем в настройки и сначала назначаем оси управления самолетом в схеме Джойстика, на виртуальный джойстик.
В настройках выбираем схему Джойстик.
Выбираем Тангаж, ставим мышку где-то на уровне Применить и двигаем ей, вверх-вниз. Когда отобразится Ось 1 (vJoy Device), жмем Применить.
Выбираем Рыскание, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 0 (vJoy Device), жмем Применить.
Выбираем Крен, ставим мышку где-то на уровне Применить и двигаем ей, влево-вправо. Когда отобразится Ось 2 (vJoy Device), жмем Применить.
Подвигайте мышкой и убедитесь, что точка управления джойстика движется вслед за курсором.
Кривые должны быть идеально прямыми!
Ставьте Вертикальная инверсия, если вы хотите, чтобы самолет двигался в ту же сторону, куда и мышь.
Для применения моей раскладки:
В расширенных настройках Джойстика выберите схему Личный и сохраните настройки.
Закройте клиент игры.
Запустите setting_win(.cmd) из архива.
Запустите клиент игры снова.
Расладка выглядит так:
Для игры используется скрипт mouse_joyz_mbm.py
Пример боя с такими настройками под спойлером. К сожалению, воспроизведение реплеев глючит, и я с удивлением узнал, что наводился не точно в точку упреждения, а куда-то рядом.
Обновление от 2015-05-25:
Сравнивая управление на Свободном горизонте с мышки и получившуюся схему, понял в чем причина сложностей управления и прицеливания.
На максимальных углах отклонения рулей, мышеводы используют клавиатуру, а мышкой только доводят самолет к цели.
Отсюда, решил попробовать сделать так же и на виртуальном джойстике.
Теперь, отклонение мыши отклоняет виртуальный джойстик с одинаковым усилием на любом отклонении от центра экрана.
При достижении мышью 100% края экрана, джойстик отклоняется на 55% от максимального значения.
Клавиатура WSADQERF забита на резкие маневры.
После 2х дневного тестирования, могу заявить, что данная схема мало чем уступает мышке по точности наведения.
Авасаки, спасибо огромное за этот вариант.
надо будет попробовать
Есть фан (веселье), а есть удовольствие. Продажный зритель продажных стримеров, ибо полетать никак не получается из-за управления
Это как фастфуд и домашняя еда.
Вот думал чем себя развлечь на выходные а вот опять что то новое.
Без ТУ почти научился летать ( ну правда до 5 лвл)
PS Верните мышку 0,3,5 (полноценную)
В танках так и не научился летать.
Надо петицию писать. или как-то иначе показать, что есть достаточно заинтересованных в нормальной векторной мыши.
Вот, например, тема с хорошим описанием проблем векторки и с голосованием. Но. проголосовал только 31 человек, и из них только 18 по делу.
Вот, например, тема с хорошим описанием проблем векторки и с голосованием. Но. проголосовал только 31 человек, и из них только 18 по делу.
Грейест, ту темку я создавал считай что полгода назад, и разрабы её просто не заметили. Писал в отзыве на какой-то патч и также не заметили.
ГрейвДиггер, я пришел в игру за год до релиза. Тогда было управление 0.3.2 или 0.3.5. Научился летать на ней мгновенно, я просто не помню чтобы у меня возникало ощущение неудобного управления. Старички, конечно, и в ту пору вайнили про «верните 0.2.3 или 0.2.4». Так что описание хорошей векторной мышки действительно звучит как «верните 0.3.5». Надо добавить настройки для возможности настройки векторки от текущей реализации вплоть до жесткого мышеджоя.
В той темке я просто пытался обосновать недостатки текущей реализации.
А выпилили то управление из-за дурацкого стремления унификации. Чью то умную голову посетила мысль, что векторку можно заменить надстройкой над их супер-пупер танкомышью и не париться с этим управлением больше. Из-за того же стремления мы сейчас смотрим на новый сайт нашей игры.
Есть фан (веселье), а есть удовольствие. Продажный зритель продажных стримеров, ибо полетать никак не получается из-за управления
Это как фастфуд и домашняя еда.
Старички, конечно, и в ту пору вайнили про «верните 0.2.3 или 0.2.4».
Последующие «модификации» управления можно назвать лишь возбудителем вайна игроков. Многие старички ( активные форумчане и очень результативные игроки) просто покинули игру и, не в последнюю очередь, именно из-за управления. А неофиты,как мы видим, онлайна в игре не сделали.
Рысканье на клаве. Ну не знаю насколько это удобно.
И я правильно понимаю что это уже будет не сопля, поэтому придется постоянно перекладывать мышку?
По сравнению с джоем или даже геймпадом, сомневаюсь.
Нагибал на HG II до того как это стало мейнстримом.
По сравнению с джоем или даже геймпадом, сомневаюсь.
Джойпад тяжело контролирует самолет, если его настраивать через схему «джойстик».
На джойстике же проще убрать контроль скольжения и выбрать такую траекторию, чтобы самолет противника сам вошел в прицел.
Можно временно показывать курсор мыши, нажимая Control. То есть вызывая функцию «Показать курсор мыши».
В целом, там требуется привычка, так как тут надо привыкнуть к тому, что от мышка работает «как джойстик».
Управлять чувствительностью можно через кривые, главное привыкнуть к тому, как именно самолет реагирует на движения мыши и тогда курсор будет даже не нужен.
Freepie скрипт для vjoy
My friend was raving about not having mouse support about the game. So I decided to try and implement a little mouse emulation.
I did it in the first version which rebinds the keyboard to the mouse.
Here is the first version:
Additionally, if you’re following the game, please disregard of what keyboard controls you are going to remap, since it only relies on the Controller buttons.
But be sure to set the Camera and Target Camera settings, which I will be explaining at the next sections.
vJoy virtual controller device can interfere with games!
As the device itself may bug out and causes one of its buttons and/or joystick to be held down, and games that supports controller will detect it.
However, once you are not using the mouse emulation script for Toukiden Kiwami, open up Configure vJoy (vJoyConf.exe within the vJoy install directory), and untick «Enable vJoy», If enabled, the [1] tab will appear as green.
That will disable the virtual controller device, and games will not detect the virtual controller anymore.
WARNING! Make sure you’ve closed any application that has detected the virtual controller, or you won’t able to disable it!
To use it, just tick again the «Enable vJoy».
To begin, five (5) files are required.
Here are the steps to make the mouse emulation work.
‘xinput1_3.dll’ was not found.
This file is required for emulator to function properly.
Do you want to create this file?
New device with unique instance id was detected. How do you want to search for settings?
If this did not came up, please make sure that you’ve installed vJoy 2.1.6 correctly.
Now, don’t touch anything, just. click Next. It will search for best settings from the internet. Hopefully.
Allowing Steam Overlay, Alt+Tabbing, and prevent Alt+Tab when mouse clicking
The keybinding toggle for autohotkey window_borderless_toggle.exe is Windows Key + B, press it in-game to toggle it as soon as you launched the game to make it borderless, so that alt+tab and mouse clicks will not interfere within each other.
Mouse camera emulation, and mouse buttons for attacks
The keybinding toggle for FreePie freepie-mouse-to-vjoy script is Equals (=) key, use it to toggle the mouse camera movement and mouse clicks LButton, RButton, and MButton which is binded to Attack1, Attack2, and Attack3 respectively.
Warning! When the mouse camera is enabled, your mouse will be kept centered to the screen for detection purposes. FreePie came with mouse.DeltaX and mouse.DeltaY, but I find them unreliable.
WARNING! Make sure all values are type float, FreePie uses Python 2.7.5, which means the division is *not* a true division, true multiplication, or something. There will be errors. However, the script has been programmed to ensure that the variables will not be accidentally assigned as anything else beside floating point values.
Well yes, freepie is capable of emulating both ways, Still, Toukiden already works with Joystick, why would you want to emulate Joystick with mouse? Unless you’re intended to use it somewhere else outside the game, then that’s up to you to program it, perhaps you can find samples around on the internet.
On the other hand, no, I don’t have a gyroscope joystick or whatever that is. So I’m sorry, I cannot help you other than what the guide has already been explicably attempted to explain with my best effort.
I’ve never encountered crash so I don’t know how to reproduce that and fix anything without the problem at hand.
Freepie скрипт для vjoy
Some people (including me) have asked about creating virtual controllers and programming some unusual controller behavior here. I’ve been using vJoy and FreePIE recently and the solution is quite convenient. You can quickly script on a virtual controller to convert keyborad/mouse/whatever input, remap axes, do conditional logic or make other fancy stuff.
vJoy is a PPJoy-like driver that can create virtual game controllers. This driver is signed, so unlike PPJoy you can install it on 64bit Win7/8 without using test mode. It does not have any input generation function, so you’ll need a «feeder» program do make it functional. This is where FreePIE comes in. The FreePIE Programmable Input Emulator is something that allows you to emulate different kinds of inputs with Python scripts. It supports vJoy natively. Just install both, create at least one virtual controller in vJoy and fire up FreePIE. The documentation is lacking tbh but it’s still easy to get started.
This is what I use on my laptop for driving games that do not support mouse control. It also gives me independent steering sensitivity setting in LFS.
from System import Int16
if keyboard.getKeyDown(Key.LeftControl) and mouse.middleButton: # steering centering
x = 0
if (x > max):
x = max
elif (x max):
y = max
elif (y max):
z = max
elif (z max):
rx = max
elif (rx max):
ry = max
elif (ry
This one is for tristancliffe who asked for Sequential AND paddle shift script over one year ago. I know it’s way too late, but it’s still good as a demonstration.
# Using x axis on vJoy device 0 as desired throttle input.
# The real wheel is joystick 0 and throttle input is y axis. Ignition cut is button 10.
from System import Int16
if joystick[0].getPressed(10):
vJoy[0].x = min # ignition cut
else:
vJoy[0].x = joystick[0].y # normal throttle
If you’re still on 32bit/XP and PPJoy does work without test mode, GlovePIE (more mature, but no vJoy support) will work in a similar fashion as FreePIE. You can also ignore FreePIE/GlovePIE and code your own vJoy/PPJoy feeder application if you like.
FFB can not pass through such a setup so don’t do it on your wheel steering axis.
I use GlovePIE + PPJoy to create a virtual combined axis from my T500 clutch/gas pedals for flight sims. Brake pedal is acting as a secondary axis, haven’t thought of any use for it in flying though.
Here’s the GlovePIE script if anyone is after something like this:
///T500 RS clutch/accelerator combined axis for rudder use
///This presumes T500 is the #3 device from top in Game Controllers
///Clutch (Slider0) and accelerator (Rotation RZ) as Analog0 (X)
///Brake pedal (Rotation Y) as Analog1 (Z)
Well, if we’re comparing PIE scripts.. I use this for AC. Some variations on steering linearity at the bottom.
Quote : // Binds
var.throttle = keyboard.A
var.brake = keyboard.Z
var.clutch = keyboard.X
var.handbrake = keyboard.Q
var.steering = mouse.x
var.shiftup = mouse.LeftButton
var.shiftdown = mouse.RightButton
// Shift down
ppjoy.Digital1 = var.shiftdown
var.foo = (mouse.x*2-1)*(mouse.x*2-1)
if mouse.x 0.5 then var.foo = MapRange(var.foo, 0, 1, 0, exp(var.foo, 0.5))/2.72
if mouse.x
Here’s my FreePIE + vJoy script for mouse steering. It was initially made to mimic the LFS style of mouse steering in other racing games, and the axes are therefor mapped to the axes which the default G27 profile had in the games I tested.
It isn’t very elegant because I ran into scoping problems as soon as I tried to solve this using functions and classes/objects.
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 5
def set_button(button, key):
if keyboard.getKeyDown(key):
v.setButton(button, True)
else:
v.setButton(button, False)
def calculate_rate(max, time):
if time > 0:
return max / (time / system.threadExecutionInterval)
else:
return max
v = vJoy[0]
v.x, v.y, v.z, v.rx, v.ry, v.rz, v.slider, v.dial = (int32_min,) * 8
global ignition_cut, ignition_cut_released
# Init values, do not change
ignition_cut = False
ignition_cut_released = True
# In milliseconds
throttle_increase_time = 100
throttle_increase_time_after_ignition_cut = 0
throttle_increase_time_blip = 50
throttle_decrease_time = 100
global throttle, throttle_max, throttle_min
# Init values, do not change
throttle_max = int32_max * throttle_inversion
throttle_min = int32_min * throttle_inversion
throttle = throttle_min
global braking, braking_max, braking_min
# Init values, do not change
braking_max = int32_max * braking_inversion
braking_min = int32_min * braking_inversion
braking = braking_min
global clutch, clutch_max, clutch_min
# Init values, do not change
clutch_max = int32_max * clutch_inversion
clutch_min = int32_min * clutch_inversion
clutch = clutch_min
global shift_up_key, shift_up_button
shift_up_key = Key.W
shift_up_button = 1
global shift_down_key, shift_down_button
shift_down_key = Key.S
shift_down_button = 2
global look_left_key, look_left_button
look_left_key = Key.A
look_left_button = 3
global look_right_key, look_right_button
look_right_key = Key.D
look_right_button = 4
global look_back_key, look_back_button
look_back_key = Key.X
look_back_button = 5
global change_view_key, change_view_button
change_view_key = Key.V
change_view_button = 6
global indicator_left_key, indicator_left_button
indicator_left_key = Key.Q
indicator_left_button = 7
global indicator_right_key, indicator_right_button
indicator_right_key = Key.E
indicator_right_button = 8
if ignition_cut_enabled and ignition_cut and ignition_cut_elapsed_time >= ignition_cut_time:
ignition_cut = False
ignition_cut_elapsed_time = 0
if throttle > throttle_max * throttle_inversion:
throttle = throttle_max * throttle_inversion
elif throttle braking_max * braking_inversion:
braking = braking_max * braking_inversion
elif braking
Anyone got this strange error?
Quote : Axis HID_USAGE_Z not enabled, enabled it from VJoy config
I suddenly got this (without changing VJoy nor FreePIE) on all the axises but X/Y on vJoy[0] and everything on vJoy[1]. Only X/Y are useable now.
All the axises are enabled in VJoy config and the feeder demo program works just fine.
For now, just comment out all the output lines but vJoy[0].x and you should be set.
Hey, thanks for replying Kelling. I’m having difficulty understanding how both tools work, actually. I installed vJoy (204_10_80714) and FreePie (1.5.475.0).
Let’s say that I’ll be using Slagen’s code above. What do I do first? With PPJoy it was simple, configure PPJoy, calibrate joystick with PPJoyMouse open, and I’d see the mouse x input on the calibration.
I’ve got vJoy feeder open, game controller open, vJoy monitor open and the FreePie script program open (with slagen’s code pasted and run). The calibration window doesn’t seem to read and calibration input.
rFactor’s also running; doesn’t detect mouse movements or buttons.
Quote from hereticlohani : I’ve got vJoy feeder open, game controller open, vJoy monitor open and the FreePie script program open (with slagen’s code pasted and run). The calibration window doesn’t seem to read and calibration input.
rFactor’s also running; doesn’t detect mouse movements or buttons.
Which «feeder»? If you mean the demo program you should turn it off. You can only control each vJoy controller with one program at a time. Using multiple would mess up the input.
If you have no error after running the script it should work.
Quote from Keling : Which «feeder»? If you mean the demo program you should turn it off. You can only control each vJoy controller with one program at a time. Using multiple would mess up the input.
If you have no error after running the script it should work.
Hey, thanks again. I got it figured out. I’m using a simple script from the internet for mouse steering (below). It’s working better than PPJoy on rFactor (I’m very happy . Can you please tell me what to add to get the mouse right and middle button also assigned?
from System import Int16
if starting:
x = 0
sensibilidadX = 50
x += mouse.deltaX * sensibilidadX
if (x > Int16.MaxValue):
x = Int16.MaxValue
elif (x
I figured that FreePIE can receive OutGauge and OutSim packets, so you can read realtime data about the car and the game into your PIE scripts. Really cool.
Simple example to monitor the car speed and gear with a none-blocking socket. Note the exception handling when there was no UDP packet available for the given loop iteration.
Another thing to note is that to my knowledge, FreePIE does not have a «stopping» bool like the «starting» bool, so you cannot properly close the socket when you stop the script. To re-run it, you need to restart FreePIE in order to free up the socket.
It can be used, for instance, to reduce the max braking power when the speed goes below a threshold to help prevent flatspotting. Or if you’re really pro, you can make your PIE script be aware of oversteer and understeer in realtime. Lots of ideas springs to mind.
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 5
import socket
import struct
global sock, outgauge
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the socket to be none-blocking, otherwise the
# loop will have to wait for each UDP packet to be received
sock.setblocking(0)
sock.bind((‘127.0.0.1’, 30000))
outgauge = None
global car_speed_unit, car_speed, car_gear
# 1 = m/s, 3.6 = km/h
car_speed_unit = 3.6
car_speed = 0
car_gear = 0
global shift_up_key, shift_down_key
shift_up_key = Key.W
shift_down_key = Key.S
Quote from Wenom : Does this mean that anyone could actually make an «anti-fry-front-wheels system» for xbox 360 pad? Much like Forza on the xbox; it prevents you from turning your wheels too much while racing and doesn’t cause unnecessary heat and wear to the tires.
And yes I might aswell say this: to me analogue steering smooth inside LFS is CRAP so nobody thinks that fiddling with that setting solves anything.
Yes. And it’s not very difficult. Will try. You can already do that in KB mode though.
Unfortunately we can’t get FFB info or kinematics of each wheel from OutSim/Gauge.
Speaking of controllers, can anyone recommend a controller for PC (preferably wireless) that has nice linearity, small/no deadzone (at both center and edge), good amount of analog travel and reasonably heavy springs? I’ve tried some controllers at my console-oriented friends’ and always find the small travel and light springs very different to control.
Isn’t socket.close() sufficient for freeing the socket? I tried this
Quote from Wenom : Quote from Skagen : Or if you’re really pro, you can make your PIE script be aware of oversteer and understeer in realtime. Lots of ideas springs to mind.
Does this mean that anyone could actually make an «anti-fry-front-wheels system» for xbox 360 pad? Much like Forza on the xbox; it prevents you from turning your wheels too much while racing and doesn’t cause unnecessary heat and wear to the tires.
And yes I might aswell say this: to me analogue steering smooth inside LFS is CRAP so nobody thinks that fiddling with that setting solves anything.
Got a prototype running.
LFS only sends out OutSim packages when driver view or custom view is used, so you have to use one of the two for the script to work. With other views it would fall back to normal behavior.
I don’t have a controller for testing, therefore I added an extra axis (vJoy[1].x) to simulate the input with keyboard. To test the script with real hardware, remove the two «REMOVE THIS FOR REAL CONTROLLER» blocks and edit the «EDIT THIS FOR REAL CONTROLLER» line so it points to your real input. OutSim port is set as 30000.
Edit the «EDIT BELOW/ABOVE» block to suit your preference (see the comments). Make sure ‘steerLock’ value is correct. You can leave the rest as defaults.
The script monitors the direction of movement and restricts your steering angle accordingly so the slip angle on the front won’t get too high. This is effective regardless of car body’s orientation as long as it’s not hitting steering lock, so when you’re over steering heavily it basically does the counter steering for you. Maybe I’ve gone a bit too far?
«Absolute positioning» version behaves in a way similar to Forza’s assist function, with the steering input mapped 1:1 to the output, but then restricted for controlling slip angle. «Relative positioning» version maps your input onto the allowed steering angle range, so the center is zero lateral slip, left lock is maximum lateral slip to the left and vice versa. This is similar to stabilized keyboard mode but with analog control. It should provide significantly higher precision, but may feel awkward at first, and very unstable near the center if your input is not smooth. (Some more fancy PID design or stuff could handle this.) The steering behavior will fall back to normal if car is too slow or going in reverse.
Code is too long to post directly. See attachment.