Jump to content
The Dark Mod Forums

Recommended Posts

Posted
10 hours ago, Obsttorte said:

@OktokoloWhat would be the point then? You have two key to control speed now and you would have two keys to control speed then. The only addition might be to allow players to turn those keys into toggles.

The difference would be the additional speeds between the three currently available speeds - still controlled by only two remappable keys.

Posted
30 minutes ago, Oktokolo said:

The difference would be the additional speeds between the three currently available speeds - still controlled by only two remappable keys.

But there are none. Currently the script only allows switching between the three different speeds via mouse wheel, it doesn't add any new functionality. And afaik noise propagation is tied to this trinary system, so you can't simple change to a system with more than three speeds without having to alter sound related files, too.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Posted
15 minutes ago, AluminumHaste said:

You can alter the volume at which the sound plays though, which would be good enough.

Currently the game propagates one of six sounds per surface, depending on whether the player is crouched and at which of the three speeds he is moving. As far as I can see this is controlled by the SDK. So there is no straight forward way to alter the noise the player makes.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

  • 2 weeks later...
Posted (edited)

Here is version 6 of the script.

What's new in v6?

1) Mouse wheel sensitivity (number of steps up or down) is no longer a thing. Just move the mouse wheel up one or more steps in a row to accelerate. Move the mouse wheel down one or more steps in a row to decelerate.

2) You can again navigate the inventory, turn pages, numbered dials and move objects you are holding back and forth by using Parry/Manipulate plus the mouse wheel.

Please pay attention to the configuration.

------------------------------------

ADJUST PLAYER SPEED WITH THE MOUSE WHEEL v6.0

Installation and execution:

  • Download AutoHotkey, install it, open Notepad, paste the below script inside, save it as TDM.ahk and double click on the file you just saved. The script will run in the background.
  • To end the script, go to the Windows taskbar, look for a green icon with an "H", right click on it and select Exit.

Configuration:

  • Settings > Controls > Weapons: Remove mouse wheel bindings from Next Weapon and Previous Weapon (or from any other setting you may have set the mouse wheel to)
  • Settings > Controls > General: Make sure Toggle Crouch is enabled and Always Run is disabled
  • Settings > Controls > Movement: The Forward, Backwards, Left, Right, Run and Creep keys must match in both TDM and the script.
  • Settings > Controls > Actions: The Parry/Manipulate key must match in both TDM and the script.
  • Settings > Controls > Inventory: The Next Inv. Item and Prev Inv. Item must match in both TDM and the script.

Recommended controls:

  • Forward / Backward / Left / Right: W, S, A, D
  • Run: Z
  • Creep: C
  • Parry/Manipulate: Right Mouse Button
  • Next Inv. Item / Prev Inv. Item: Right Arrow, Left Arrow

Known limitations and workarounds:

  • You can move through the inventory, turn pages, numbered dials and move objects you are holding back and forth using Next / Prev Inv. Item or Parry/Manipulate + the mouse wheel.
  • To prepare for a long jump from idle, move the mouse wheel up before executing your move.
  • Remember the script will switch you automatically from running to walking after one second of inactivity.
  • You cannot lean forward and switch speeds at the same time, for some reason...

 

; =====================================
; Adjust player speed with mouse wheel
; -------------------------------------
; An AutoHotkey script for The Dark Mod
; version 6.0 by Obsttorte & snatcher
; =====================================

; -------------------------------------
; Configure your keys below
; -------------------------------------

; In-game movement keys
key_left = a
key_right = d
key_forward = w
key_backward = s

; In-game run and creep keys
key_run = z
key_creep = c

; In-game manipulate key (recommended right mouse button: RButton)
key_manipulate = RButton

; In-game Next/Prev inventory keys
key_next = Right
key_prev = Left

; -------------------------------------
; Do not edit anything past this point
; -------------------------------------

delay = 1000 ; delay in miliseconds between running > walking [default = 1000]
speed = 0 ; init speed (-1 = creep | 0 = walk [default] | 1 = run)
state = speed; counter for state switch

#IfWinActive ahk_exe TheDarkModx64.exe ; run only when TDM is focused

HotKey, *~%key_forward% up, keyForwardHandler
return

keyForwardHandler:
if (speed == 1) ; we are running
{
    sleep, delay
    if (!GetKeyState(key_forward) && !GetKeyState(key_backward) && !GetKeyState(key_right) && !GetKeyState(key_left))
    {
        speed = 0 ; walk
        Send {%key_run% up}
    }
}
return

*wheelup::
if (GetKeyState(key_manipulate))
{
    Send {%key_next%}
}
else
{
    state += 1
    if (speed == -1) ; we are creeping
    {
        speed = 0 ; walk
        Send {%key_creep% up}
    }
    else if (speed == 0) ; we are walking
    {
        speed = 1 ; run
        Send {%key_run% down}
    }
    state = 0
    Sleep, 300
}
return

*wheeldown::
if (GetKeyState(key_manipulate))
{
    Send {%key_prev%}
}
else
{
    state -= 1
    if (speed == 0) ; we are walking
    {
        speed = -1 ; creep
        Send {%key_creep% down}
    }
    else if (speed == 1) ; we are running
    {
        speed = 0 ; walk
        Send {%key_run% up}
    }
    state = 0
    Sleep, 300
}
return

Change-log:

  • v6.0: You can now use as many mouse wheel steps as you like to switch speeds. You can navigate the inventory, turn pages, numbered dials and move objects you are holding back and forth by using Parry/Manipulate plus the mouse wheel.
  • v5.0: To prevents sudden halts when running, a one-second delay has been added between the moment the player stops going forward and the script takes you automatically back to walking mode. To allow for a greater freedom of movement, the script requires to know now your backwards, right and left keys.
  • v4.0: Altered so that when player is running and stops, you are back to walking mode.
  • v3.0: The script only runs when TDM is in focus (tested in Win 10)
  • v2.0: Second version by Obsttorte
  • v1.0: First version by Obsttorte

Cheers!

Edited by snatcher

TDM_Modpack_Thumb.png

  • 1 year later...
Posted
1 hour ago, nbohr1more said:

@snatcher can you upload this to moddb ?

There is nothing to upload anywhere unless the ask is to create an AutoHotKey executable in which case false positives would easily become my new nightmare. Thanks but I'll pass!

This one truly is a proof of concept. I have been using this hack (with its shortcomings) since @Obsttorte and I first worked on it and I am convinced this could become a great project for an eager developer. Controlling the speed with the mouse-wheel not only feels natural but it would free us from the 3-speed limit and make some keys obsolete. An all-around improvement for those that may (optionally) use it.

TDM_Modpack_Thumb.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
×
×
  • Create New...