Author Topic: Gun theme  (Read 13026 times)

Turncoat

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Gun theme
« on: June 05, 2016, 03:35:13 PM »
Hey All!
First post, Glad I found this FE, looks like it will fill a gap that has existed for a while.

Anyway, I did a couple of searches and found nothing so far...
is there a gun/light gun controllable theme I haven't seen?
I'd like to try attract mode in a dedicated aimtrack gun cab :)

Thanks in advance for any pointers

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Gun theme
« Reply #1 on: June 05, 2016, 09:36:44 PM »
Isn't there a crosspad on aimtrack lightguns, is it?

So you can use a joystick-to-key-software (like xpadder, joytokey, VJoy-Virtual-Joystick, and so on).
Set crosspad-input as cursor-buttons. Now if you push the crosspad, you'll navigate through attractmode
« Last Edit: June 05, 2016, 11:07:05 PM by hermine.potter »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

Turncoat

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Gun theme
« Reply #2 on: June 06, 2016, 01:43:35 AM »
hi,
No, unfortunately its not a cheap light gun. this is an arcade machine :)
Happ/Namco guns have an extra button or footpedal at the most.
The aimtrack guns work like a mouse (HID) and the trigger is essentially a left click.

What's needed really is a mouse click 'target' type navigation structure, but maybe with a target curser or a gunshot sound?

is there a mouse based theme I could start with and have a go at modifying it maybe?

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Gun theme
« Reply #3 on: June 06, 2016, 06:19:49 AM »
You could try and create an autohotkey to do the following process:
  • if front most application is attractmode
  • when left click
  • find cursor position
  • determine if cursor position meets certain position credentials
  • send appropriate keypress

If you just want a simple left side = previous nav, center selects game, and right side = next nav… I could probably create it for you when I have time.

Turncoat

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Gun theme
« Reply #4 on: June 06, 2016, 10:44:00 AM »
I made a mockup image with some placeholders of what I think you meant...
Wouldn't know where to start but what you said sounds like it would work fine.

Ideally I would have a couple of sub categories but anything which I could put in my cab to avoid us seeing or having to use windows. It just ruins the illusion :)

can you have a visible menu cross-hair type curser?

Took a look at 'autohotkey' and it looks like a bit of a steep learning curve so I may need some hand holding :)

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Gun theme
« Reply #5 on: June 06, 2016, 10:55:14 PM »
there are two methods (if lightgun is detected as a mouse):

1) Set mouse-movement in AM-controls
Start AM > TAB > Controls > Add Input for 'Next Display' and 'Previous Display'
Set 'Mouse Left' and 'Mouse Right'

2) Use script. I prefer autoit
Code: [Select]
#include <Misc.au3>
#include <String.au3>

While 1
WaitForCorner()
WEnd

Func WaitForCorner()
    While 1
$MousePos = MouseGetPos()
$MousePos[0] ; Mouse X position
$MousePos[1] ; Mouse Y position

For $i = 0 To 255
If _IsPressed(Hex($i,2)) Then

if Hex($i,2) = 01 AND $MousePos[0] = 0 AND $MousePos[1] = 1199 THEN
;   msgbox(0, "", "LEFT")
   Send("{LEFT}")
   Sleep(500)

elseif Hex($i,2) = 01 AND $MousePos[0] = 1919 AND $MousePos[1] = 1199 THEN
;   msgbox(0, "", "RIGHT")
   Send("{RIGHT}")
   Sleep(500)

Else
EndIf

ExitLoop 2
EndIf
Next
Sleep(50)
WEnd
EndFunc
I've got a display with 1920 to 1200.
Position left lower corner (Left/Down) is 0 to 1199
Position right lower corner (Right/Down) is 1919 to 1199

If you're on this position and hits Mouse-Button Left, the script sends left or right (depending on corner).



>Mouse-Cursor in AM:
http://forum.attractmode.org/index.php?topic=97.0
It was a feature request, hide mouse pointer. I'm not sure about enable mouse cursor in AM again.
https://www.google.com/?gfe_rd=cr&ei=FWFWV4LwEqnS8Af9y6XYAg&gws_rd=ssl#q=cursor+crosshair+cur
You'll found something like this : http://www.rw-designer.com/cursor-detail/77406



>Check color of button and send button
I've seen your screenshot. So this enclosed graphic and script should works:
Code: [Select]
#include <Misc.au3>

;END-Button to exit script
HotKeySet("{END}", "_Quit")

$dll = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $dll) Then
        $avMousePos = MouseGetPos()
        $ClickedColor = PixelGetColor($avMousePos[0], $avMousePos[1])

;this shows the color code of current pixel
; msgbox(0, "", $ClickedColor)
; Color Code of red button is 13369395
; Color Code of green button is 11992832

;when red / left button
if $ClickedColor = 13369395 Then
;msgbox(0,"", "LEFT RED")
Send("{LEFT}")
Sleep(500)

;when green / right button
ElseIf $ClickedColor = 11992832 Then
;msgbox(0,"", "GREEN RIGHT")
Send("{RIGHT}")
Sleep(500)

EndIf

EndIf
WEnd

Func _Quit()
    DllClose($dll)

Exit
EndFunc



If you shoot to left / red button : it moves to left
If you shoot to right / green button : it moves to right

On Windows Desktop it works. I don't tested it in AM...
« Last Edit: June 07, 2016, 01:28:58 AM by hermine.potter »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM