Jump to content
The Dark Mod Forums

Any way to change leaning to hold (instead of toggle)?


Recommended Posts

Right now leaning is a toggle, left, right, and forward all stick in the lean. Is this in purpose? I definitely don't like it and want to just lean while holding the key. Is this something we can choose or change in an ini? I couldn't find anything about it

shadowdark50.gif keep50.gif
Link to comment
Share on other sites

Ah. Could you point out (approximately) where it is in the code? I can probably fix it myself, although there may be some problems getting the lean-code to handle non-ASCII inputs.

I should point out that the supposed problem here is entirely dependent on not being able to read Doom 3's impulses--which is exactly what ButtonState() does. Please forgive me for my momentary lapse in intelligence. I bloody well should have remembered that, considering all the pain I went through to figure out what ButtonState() and KeyState() do. <_<

Link to comment
Share on other sites

Ah. Could you point out (approximately) where it is in the code? I can probably fix it myself, although there may be some problems getting the lean-code to handle non-ASCII inputs.

I don't know much about it myself, but it looks like a ButtonStateTracker class was added, /src/Darkmod/ButtonStateTracker. It seems to call PerformKeyRelease(impulse, holdTime), when a key is released.

 

It looks like we just have to add handling of the lean impulses to idPlayer::PerformKeyRelease. (This is in /src/game/player.cpp). So look for the lean impulses in the ::PerformImpulse part of idPlayer, note the impulse number and which direction they lean in (the argument of ToggleLean). Then go into ::PerformKeyRelease, add cases fro the same impulses and call ToggleLean again with the same argument, to lean back when the key is released.

 

Seems pretty straightforward, and hopefully the lean physics code should handle it because it used to do this when we had the old keyhandler. Btw, if an admin can move this to bug reports or programming or something, that would be appreciated. :)

Link to comment
Share on other sites

I've uploaded a new pk4 to svn. Lean is now a hold, rather than a toggle. Still a bit buggy, though, if you quickly press and release the button.

Cool!

 

Some of the bugginess might be due to the lean physics itself, it doesn't like it when you try to toggle and then toggle back or toggle another way too soon. It probably needs an overhaul with better support of interruptions, and also making you wait until you've leaned all the way back when switching from side/side lean to forward/back lean and vice versa (that causes a different bug).

Link to comment
Share on other sites

I hacked in a simple fix to keep players from being able to toggle lean on (with pm_lean_toggle set to 0) by leaning then double-tapping the same lean key, but I haven't committed it yet. It forces the player to wait a lot longer than I'm comfortable with. I would say that the overhaul needs to support going back into a lean before finishing the return to vertical. That is, do like in Thief, where you release the button, and then press it again before you finish returning to vertical, you immediately start moving to the (potentially new) lean direction.

 

Wow, I really wish I could explain that better. -_- Perhaps I should add it to my to-do (eventually) list?

 

Edit: Oh, my current version also fixes the typo I made with pm_lean_toggle. (pm_lean_togggle? Oh no!) I should probably upload it already.

Link to comment
Share on other sites

That's actually two separate issues. Leaning left, then letting go too soon or leaning right again too soon cause some unresponsiveness problems. Leaning left, then leaning forward is a separate problem stemming from starting a forward lean while you are in the left lean state, it doesn't matter how long you wait between doing those two things.

Link to comment
Share on other sites

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...