Open happppp opened 8 years ago
Currently lua can send events via ioports but can't receive them. I'm not sure how to do it but it would probably make people who use cheats happy to be able to bind buttons to enable and disable cheats.
Board game pieces don't need to be able to receive ioport events, unless we're going to plan moving them automatically. What I have in mind is a sprite layer where pieces can be drag-dropped with the mouse manually. A piece may have a weight or id so when placed above a button in the layout, it would auto-press down.
Or imagine a chess game where the king piece cheeks blush with bright LEDs when he's in check by the opposite queen. Would that be a (very silly) example of what you meant by receiving ioport events? Are outputs(eg. output_set_led_xx) supported by lua?
On Sun, Apr 10, 2016 at 9:55 PM, cracyc notifications@github.com wrote:
Currently lua can send events via ioports but can't receive them. I'm not sure how to do it but it would probably make people who use cheats happy to be able to bind buttons to enable and disable cheats.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/mamedev/mame/issues/798#issuecomment-208052489
You want the events, mouse movements or keypresses, to be fed to a Lua script and transformed in some way and passed on to the driver, right? If so than what I meant is that luaengine can't receive any input currently. There does appear to be some interface for outputs but I haven't tried it.
Ah, access to OS input devices(via MAME), not emulated input devices. Yes, that's a necessity.
On Mon, Apr 11, 2016 at 12:44 AM, cracyc notifications@github.com wrote:
You want the events, mouse movements or keypresses, to be fed to a Lua script and transformed in some way and passed on to the driver, right? If so than what I meant is that luaengine can't receive any input currently. There does appear to be some interface for outputs but I haven't tried it.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/mamedev/mame/issues/798#issuecomment-208086660
One could argue that, in principle, the Lua engine shouldn't have direct access to OS input. But, in practice, a lot of drivers are abusing the input module for debugging hacks, and I don't see why the Lua engine shouldn't be able to do likewise.
However, I think that board layouts with movable pieces really deserve a core implementation of a drag-and-drop interface, as a complement to clickable artwork. Ideally, the variously defined pieces ought to be able to snap into close-enough holes which fit their bases in a manner similar to MacOS 7.5's Jigsaw Puzzle (which, by the way, is still not working in MAME if MT 05411 is to be believed).
Jigsaw works fine in the IIci driver.
One could argue that, in principle, the Lua engine shouldn't have direct access to OS input.
For this it might not be needed depending on how it's done but if we want to bring back cheat hotkeys there would have to be a way for scripts to receive input.
This seems to be a bit related to the 3D artwork system proposals at #388
Electronic boardgames are currently difficult to use in MAME. There are 2 categories: 1: one where the computer is part of the board, via buttons or magnet sensors. 2: where the computer is separate from the playing board. Examples:
1: mdndclab: Mattel Dungeons & Dragons Computer Labyrinth Game amaztron: Coleco Amaze A Tron fscc12: Fidelity Sensory Chess Challenger 12-B
2: mbdtower: MB Dark Tower lostreas: Parker Bros Lost Treasure vcc: Fidelity Voice Chess Challenger
Most emulated chesscomputers are practically unplayable without a simulated board. For the Mephisto chess games we used to have a fake emulation device "mboard", but it had to be taken out due to unresolved licensing. However, even if it made those games usable in MAME, it was not the proper solution. The emulated machine shouldn't be aware of the game pieces.
What we need is a way to represent game board and game pieces, but not as part of the emulation. I'm not experienced with scripting, but have a hunch we can use .lua scripts for this, which in combination with .lay files could work. A way to drag & drop sprites across the layout with no interaction necessary with the emulation yet, would get us a far way already. One step further would be to have 'weighed' game pieces, for example in order to simulate magnet sensors when the piece is above a 'button'.