Previous Thread
Next Thread
Print Thread
Joined: Mar 2004
Posts: 114
bobz Offline OP
Senior Member
OP Offline
Senior Member
Joined: Mar 2004
Posts: 114
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: 872
Likes: 6
C
Senior Member
Online Content
Senior Member
C
Joined: Jan 2012
Posts: 872
Likes: 6
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: 114
bobz Offline OP
Senior Member
OP Offline
Senior Member
Joined: Mar 2004
Posts: 114
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 (MAMEBase, Bletch, 1 invisible), 34 guests, and 4 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,974
Posts117,891
Members5,001
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com