Home Page
Posted By: bobz Analog control in LUA script - 10/09/21 09:36 PM

I am trying to write a LUA script for Virtua Racing in which I would like to control the Paddle device.
I did not manage to have a "constant" value for the Paddle's value. The best that I can do is briefly turn the wheels but they come back to center position almost immediately.
I guess that LUA set_value is superseeded by the mouse position, so I set the Paddle entry to None in the Tab menu's Input page. With this configuration, nothing happen any more.
I also tried different command line settings (-nomouse, -paddle_device none) without success.
Is there something you can suggest me ?

Here the code I use:

button = {}
for i, j in ipairs(manager.machine.ioport.ports) do
for field_name, field in pairs(j.fields) do
button[field_name] = field
Posted By: crazyc Re: Analog control in LUA script - 10/10/21 01:40 AM
I don't know why it doesn't work when the control is unmapped but otherwise it might be autocentering so you'd have to rewrite the value every frame.
Posted By: bobz Re: Analog control in LUA script - 10/10/21 07:47 PM
I am now rewriting every frame and it works. Thank you very much !
© Forums