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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...