Previous Thread
Next Thread
Print Thread
Joined: Mar 2004
Posts: 121
bobz Offline OP
Senior Member
OP Offline
Senior Member
Joined: Mar 2004
Posts: 121
Hello,

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
end
end
button["Paddle"]:set_value(1000000)

Joined: Jan 2012
Posts: 883
Likes: 12
C
Senior Member
Offline
Senior Member
C
Joined: Jan 2012
Posts: 883
Likes: 12
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.

Joined: Mar 2004
Posts: 121
bobz Offline OP
Senior Member
OP Offline
Senior Member
Joined: Mar 2004
Posts: 121
I am now rewriting every frame and it works. Thank you very much !

Last edited by bobz; 10/10/21 07:47 PM.

Link Copied to Clipboard
Who's Online Now
3 members (simzy39, 2 invisible), 21 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,158
Posts119,936
Members5,034
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com