AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Doom 95 in Vista with a pad

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
stonewall97
Guest





PostPosted: Sat Mar 22, 2008 7:27 am    Post subject: Doom 95 in Vista with a pad Reply with quote

I did all this work so I could play Doom 95 on Vista with a game pad. I was lucky to come across AutoHotKey. Since it took a while to do, I figured to share it.

Copy the following into a text document and rename it 'doom95pad.ahk'
Click on it to run it, and run it with AutoHotKey. Now when you play Doom95 the pad in question will work. (If you really want to, you can make it run when windows starts. I wouldn't recommend it though because it messes up your keyboard desktop control while running)
Code:

; A script for use with AutoHotKey
; Designed for the 1000_Games_in_1 joypad 'Eureka'
; With Doom 95 running on windows vista
; May work with other pads, I dunno.
;
; JoyPad
; 1= 1 / down (for use in menu)
; 2= 2 / space (open door)
; 3= 3 / shift (run)
; 4= 4 / ctrl (shoot)
; 5 = L1 / , (strafe left)
; 6 = R1 / . (strafe right)
; 7 = L2 / tab (map)
; 8 = R2 / f11 (gamma correction)
; select = 9 / esc (menu)
; start = 10 / enter (menu selection)
;
;Some advice while playing, because of the further trouble I found,
;Don't press too hard on the D-pad. Wierd things will happen otherwise.
;Be light on your finger tips for maximum effect.

; JOY UP_DOWN_LEFT_RIGHT
#Persistent   
SetTimer, WaitForJoyV, 30
SetTimer, WaitForJoyH, 30
return

WaitForJoyV:
GetKeyState joyY, joyY
if joyY < 30
{
    send {up down}
    return
}
if joyY > 70
{
    send {down down}
    return
}
if GetKeyState("up")
{
    send {up up}
    return
}
if GetKeyState("down")
{
    send {down up}
    return
}
return

WaitForJoyH:
GetKeyState joyX, joyX
if joyX < 30
{
    send {left down}
    return
}
if joyX > 70
{
    send {right down}
    return
}
if GetKeyState("left")
{
    send {left up}
    return
}
if GetKeyState("right")
{
    send {right up}
    return
}
return


; JOY 1-32 buttons

; JOY 1 // single step down on menu
Joy1::send {down}

; JOY 2 // Spacebar
Joy2::
Send {space down}   ; change 'space' to whatever to choose a new key
SetTimer, WaitForJoy2, 30
return

WaitForJoy2:
if not GetKeyState("Joy2")
{
    Send {space up}  ; change 'space' to whatever to choose a new key
    SetTimer, WaitForJoy2, off 
    return
}
Send {space down} ; change 'space' to whatever to choose a new key
return

; JOY 3
Joy3::
Send {shift down}   ; Press shift down.
SetTimer, WaitForJoy3, 30  ; Reduce the number 30 to 20 or 10 to send keys faster.

Increase it to send slower.
return

WaitForJoy3:
if not GetKeyState("Joy3")  ; The button has been released.
{
    Send {shift up}  ; Release shift.
    SetTimer, WaitForJoy3, off  ; Stop monitoring the button.
    return
}
; Since above didn't "return", the button is still being held down.
Send {shift down}  ; Send another shift keystroke.
return

; JOY 4
Joy4::
Send {ctrl down}   
SetTimer, WaitForJoy4, 30
return

WaitForJoy4:
if not GetKeyState("Joy4")
{
    Send {ctrl up} 
    SetTimer, WaitForJoy4, off 
    return
}
Send {ctrl down}
return

; JOY 5
Joy5::
Send {, down}   
SetTimer, WaitForJoy5, 30
return

WaitForJoy5:
if not GetKeyState("Joy5")
{
    Send {, up} 
    SetTimer, WaitForJoy5, off 
    return
}
Send {, down}
return

; JOY 6
Joy6::
Send {. down}   
SetTimer, WaitForJoy6, 30
return

WaitForJoy6:
if not GetKeyState("Joy6")
{
    Send {. up} 
    SetTimer, WaitForJoy6, off 
    return
}
Send {. down}
return

; JOY 7
Joy7::send {tab}

; JOY 8
Joy8::send {f11}

; JOY 9
Joy9::send {esc}


; JOY 10
Joy10::
Send {enter down}   
SetTimer, WaitForJoy10, 30
return

WaitForJoy10:
if not GetKeyState("Joy9")
{
    Send {enter up} 
    SetTimer, WaitForJoy10, off 
    return
}
Send {enter down}
return


: There you go, a set of controls to play doom 95 with.

[Moderator's note: added code tags.]
Back to top
stonewall97
Guest





PostPosted: Sat Mar 22, 2008 7:34 am    Post subject: warning Reply with quote

Don't include the last line in the text document.
Back to top
stonewall97
Guest





PostPosted: Sun Mar 23, 2008 1:38 am    Post subject: Edited Reply with quote

Seems the admin has fixed the problem. It should now work perfectly without change.
Back to top
stonewall97
Guest





PostPosted: Sun Mar 23, 2008 1:47 am    Post subject: Use this instead Reply with quote

Use this instead. The one at the start of the forum has a syntax error.

Code:
; A script for use with AutoHotKey
; Designed for the 1000_Games_in_1 joypad 'Eureka'
; With Doom 95 running on windows vista
; May work with other pads, I dunno.
;
; JoyPad
; 1= 1 / down (for use in menu)
; 2= 2 / space (open door)
; 3= 3 / shift (run)
; 4= 4 / ctrl (shoot)
; 5 = L1 / , (strafe left)
; 6 = R1 / . (strafe right)
; 7 = L2 / tab (map)
; 8 = R2 / f11 (gamma correction)
; select = 9 / esc (menu)
; start = 10 / enter (menu selection)
;
;Some advice while playing, because of the further trouble I found,
;Don't press too hard on the D-pad. It will lock up otherwise.
;Be light on your finger tips to avoid this problem.

; JOY UP_DOWN_LEFT_RIGHT
#Persistent   
SetTimer, WaitForJoyV, 30
SetTimer, WaitForJoyH, 30
return

WaitForJoyV:
GetKeyState joyY, joyY
if joyY < 30
{
    send {up down}
    return
}
if joyY > 70
{
    send {down down}
    return
}
if GetKeyState("up")
{
    send {up up}
    return
}
if GetKeyState("down")
{
    send {down up}
    return
}
return

WaitForJoyH:
GetKeyState joyX, joyX
if joyX < 30
{
    send {left down}
    return
}
if joyX > 70
{
    send {right down}
    return
}
if GetKeyState("left")
{
    send {left up}
    return
}
if GetKeyState("right")
{
    send {right up}
    return
}
return


; JOY 1-32 buttons

; JOY 1 // single step down on menu
Joy1::send {down}

; JOY 2 // Spacebar
Joy2::
Send {space down}   ; change 'space' to whatever to choose a new key
SetTimer, WaitForJoy2, 30
return

WaitForJoy2:
if not GetKeyState("Joy2")
{
    Send {space up}  ; change 'space' to whatever to choose a new key
    SetTimer, WaitForJoy2, off
    return
}
Send {space down} ; change 'space' to whatever to choose a new key
return

; JOY 3
Joy3::
Send {shift down}
SetTimer, WaitForJoy3, 30
return

WaitForJoy3:
if not GetKeyState("Joy3")
{
    Send {shift up}
    SetTimer, WaitForJoy3, off
    return
}
Send {shift down}
return

; JOY 4
Joy4::
Send {ctrl down}   
SetTimer, WaitForJoy4, 30
return

WaitForJoy4:
if not GetKeyState("Joy4")
{
    Send {ctrl up}
    SetTimer, WaitForJoy4, off
    return
}
Send {ctrl down}
return

; JOY 5
Joy5::
Send {, down}   
SetTimer, WaitForJoy5, 30
return

WaitForJoy5:
if not GetKeyState("Joy5")
{
    Send {, up}
    SetTimer, WaitForJoy5, off
    return
}
Send {, down}
return

; JOY 6
Joy6::
Send {. down}   
SetTimer, WaitForJoy6, 30
return

WaitForJoy6:
if not GetKeyState("Joy6")
{
    Send {. up}
    SetTimer, WaitForJoy6, off
    return
}
Send {. down}
return

; JOY 7
Joy7::send {tab}

; JOY 8
Joy8::send {f11}

; JOY 9
Joy9::send {esc}


; JOY 10
Joy10::
Send {enter down}   
SetTimer, WaitForJoy10, 30
return

WaitForJoy10:
if not GetKeyState("Joy9")
{
    Send {enter up}
    SetTimer, WaitForJoy10, off
    return
}
Send {enter down}
return
Back to top
rifth
Guest





PostPosted: Fri Apr 11, 2008 8:58 pm    Post subject: This script has one problem or so wiht my pc it does. Reply with quote

I modified it for my Nintendo 64 controller changing buttons around, using Vista, and Doom 2 to test. Came to one problem which I do not know how to fix.

I am using the joystick axis as opposed tot he pad and occasionally when I'm already moving in one direction and want to go right it simply ignores the command altogether.

Please help here is what I have so far. Ignore all the stuff at the bottom I didn't clean it up nicely.

    ; A script for use with AutoHotKey
    ; Designed for the 1000_Games_in_1 joypad 'Eureka'
    ; With Doom 95 running on windows vista
    ; May work with other pads, I dunno.
    ;
    ; JoyPad
    ; 1= 1 / down (for use in menu)
    ; 2= 2 / space (open door)
    ; 3= 3 / shift (run)
    ; 4= 4 / ctrl (shoot)
    ; 5 = L1 / , (strafe left)
    ; 6 = R1 / . (strafe right)
    ; 7 = L2 / tab (map)
    ; 8 = R2 / f11 (gamma correction)
    ; select = 9 / esc (menu)
    ; start = 10 / enter (menu selection)
    ;
    ;Some advice while playing, because of the further trouble I found,
    ;Don't press too hard on the D-pad. It will lock up otherwise.
    ;Be light on your finger tips to avoid this problem.

    ; JOY UP_DOWN_LEFT_RIGHT
    #Persistent
    SetTimer, WaitForJoyV, 30
    SetTimer, WaitForJoyH, 30
    return

    WaitForJoyV:
    GetKeyState joyY, joyY
    if joyY < 30
    {
    send {up down}
    return
    }
    if joyY > 70
    {
    send {down down}
    return
    }
    if GetKeyState("up")
    {
    send {up up}
    return
    }
    if GetKeyState("down")
    {
    send {down up}
    return
    }
    return

    WaitForJoyH:
    GetKeyState joyX, joyX
    if joyX < 30
    {
    send {left down}
    return
    }
    if joyX > 70
    {
    send {right down}
    return
    }
    if GetKeyState("left")
    {
    send {left up}
    return
    }
    if GetKeyState("right")
    {
    send {right up}
    return
    }
    return

    ; JOY 1-32 buttons

    ; JOY 1 // single step down on menu
    Joy1::send {up}

    ; JOY 6 // Spacebar
    Joy6::
    Send {space down} ; change 'space' to whatever to choose a new key
    SetTimer, WaitForJoy6, 30
    return

    WaitForJoy6:
    if not GetKeyState("Joy6")
    {
    Send {space up} ; change 'space' to whatever to choose a new key
    SetTimer, WaitForJoy6, off
    return
    }
    Send {space down} ; change 'space' to whatever to choose a new key
    return

    ; JOY 5
    Joy5::
    Send {shift down}
    SetTimer, WaitForJoy5, 30
    return

    WaitForJoy5:
    if not GetKeyState("Joy5")
    {
    Send {shift up}
    SetTimer, WaitForJoy5, off
    return
    }
    Send {shift down}
    return

    ; JOY 11
    Joy11::
    Send {ctrl down}
    SetTimer, WaitForJoy11, 30
    return

    WaitForJoy11:
    if not GetKeyState("Joy11")
    {
    Send {ctrl up}
    SetTimer, WaitForJoy11, off
    return
    }
    Send {ctrl down}
    return

    ; JOY 5
    ;Joy5::
    ;Send {, down}
    ;SetTimer, WaitForJoy5, 30
    ;return

    ;WaitForJoy5:
    ;if not GetKeyState("Joy5")
    ;{
    ; Send {, up}
    ; SetTimer, WaitForJoy5, off
    ; return
    ;}
    ;Send {, down}
    ;return

    ; JOY 6
    ;Joy6::
    ;Send {. down}
    ;SetTimer, WaitForJoy6, 30
    ;return

    ;WaitForJoy6:
    ;if not GetKeyState("Joy6")
    ;{
    ; Send {. up}
    ; SetTimer, WaitForJoy6, off
    ; return
    ;}
    ;Send {. down}
    ;return

    ; JOY 8
    Joy8::send {tab}

    ; JOY 8
    ;Joy8::send {f11}

    ; JOY 9
    ;Joy9::send {esc}


    ; JOY 10
    Joy10::
    Send {enter down}
    SetTimer, WaitForJoy10, 30
    return

    WaitForJoy10:
    if not GetKeyState("Joy9")
    {
    Send {enter up}
    SetTimer, WaitForJoy10, off
    return
    }
    Send {enter down}
    return
Back to top
rifth



Joined: 11 Apr 2008
Posts: 3

PostPosted: Fri Apr 11, 2008 9:15 pm    Post subject: Clarification Reply with quote

Let me clarify it a bit, if moving forward or backwards and going left then switching to RIGHT it will not make the turn to right.
Back to top
View user's profile Send private message
T800



Joined: 15 Oct 2006
Posts: 31
Location: Croatia

PostPosted: Sat Apr 12, 2008 10:05 pm    Post subject: Interesting! Reply with quote

I think I'll try this one if can only find where I've put my old Doom floppys. Cool
Back to top
View user's profile Send private message
stonewall97
Guest





PostPosted: Mon Apr 14, 2008 5:22 am    Post subject: Nessesary? Reply with quote

My guess is that the N64 D-pad is suited to this code. That is, the N64 D-pad cannot have 2 opposite buttons pressed simultaneously. The analoge stick works differently. Why you would want to wear out your fragile 64 joystick on a game without analogue sensitivity is beyond me... almost.

You could write code that detects if the joystick is slightly on, in which case the run key is seen as off. When the joystick is pushed further, the run key is turned on. That would be a good way to play doom95 - with a 2 stage sensitivity joystick.

If I had an analogue joystick I might look into it. You're in a better position to experiment, however.

How did you plug the N64 pad into a PC? Does it require software?
Back to top
rifth



Joined: 11 Apr 2008
Posts: 3

PostPosted: Tue Apr 22, 2008 11:04 pm    Post subject: N64 plugging into PC Reply with quote

Okay, well I enjoy using the joystick over teh pad because my fingers don't hurt so bad. Simple plus it's more fun and easy.

You can find a converter or even make one yourself, for N64 controller adapter to USB PC.

They're on amazon.com it's very generic and cheap looking but it gets the job done. And if your using aanything than original equipment controllers be cautious it seems to not work in these cases and even some OE old controllers it wont work well with.

But I played 3 player super mario kart last night 2 N64 controllers and one snes which I bought on an online store. It doesn't have an adapter it just goes straight to USB.

It's hellafun.
Dan
Back to top
View user's profile Send private message
stonewall97
Guest





PostPosted: Sun May 11, 2008 5:06 am    Post subject: Reply with quote

You'd be better off doing it yourself. I'm too busy.
Back to top
stonewall97
Guest





PostPosted: Sun May 11, 2008 5:07 am    Post subject: Reply with quote

But thanks for the info ^^ I hope to get around to it someday.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group