Jump to content
The Dark Mod Forums

Recommended Posts

Posted

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
Posted

Yeah, I mean KeyState. Before D3 patch 1.31, that didn't exist, so we were using our own keyboard hook. The hold-button-to-lean code was written for that old keyboard-hook, but never got updated when the patch came out and we got rid of it.

Posted
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. <_<

Posted
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. :)

Posted

Yes, I wrote the ButtonStateTracker to call the PerformKeyRelease() method on idPlayer. Just add your IMPULSE_YY to the switch and update the leaning.

Posted

Are we able to leave support for both as a player option? IIRC, after the first-generation button support was in place, toggle lean was sufficiently non-objectionable (to some) to actually warrant leaving it up to player preference.

Posted
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).

Posted

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.

Posted

Cool checking it out now... works gggreat!

 

And yeah there is definitely something funky about leaning too soon after leaning a different way. Try leaning all the way right, and then before you've re-centered, lean forward. :blink:

Posted

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.

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

      Happy Labour Day, my taffing taffers & hard working mapping friends!
      And remember the poor souls who, within the Inventors’ organization, labor under Jonus’s yoke to ensure the success of that very guild! Always remember the hard workers!
      · 1 reply
    • datiswous

      Is there a script command to make a screenshot?
      I just though it could be interesting to be able to create a screenshot at a certain point in time. Then use that screenshot possibly in a debrief.
      I guess the second question is: Can you use a (in-game made) screenshot in a (debrief) gui?
      · 1 reply
    • Bikerdude  »  Display Cement

      So what type, and what ratio of portland to sand 😏
      · 1 reply
    • JackFarmer

      Our esteemed professional mapping predecessors from 20 years ago faced the same challenges we do today!
      · 2 replies
    • snatcher

      TDM Modpack 5.1 is out!
      · 0 replies
×
×
  • Create New...