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

    • 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.
      · 3 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...