Jump to content
The Dark Mod Forums

Nyarlathotep's Application Thread


New Horizon

Recommended Posts

I've finally breached the secret of the commands! KeyState() pulls in ASCII characters (range: 9, 13, 27, 32, 39, 44-57, 59, 91-93, 96-122), but only lowercase ones (it gives lowercase values whether or not shift is held down).

 

That makes senser. After all, as far as the game is concerned, modifier keys like Shift and Ctrl, don't hold any special meaning, as they do with the regular OS. They are just some keys like all the others. If there is meaning to them, the game must implement it. Most games work like this, because usually it doesn't matter if you press 'a' or 'SHIFT-A' as shift can be an arbitrary function.

Gerhard

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

You can email one of us your test mod and we can put it up on the ftp.

 

That's great that you figured out how these work! That should help a lot.

 

Is there any way to detect whether a particular mouse button is held, even if it's bound to an arbitrary thing? For example, player binds _impulse42 to mouse 1. Later on, we want to check if the button bound to _impulse42 is being held (in this case it happens to be mouse 1 rather than a keyboard key). Could we do this with these functions?

 

[EDIT: Just read more carefully and it looks like you can look up the impulse with ButtonState? So if you bound mouse 1 to impulse 42, button state would tell you whether the mouse button was still being held down?]

 

It's kind've weird in that KeyState seems to check hardware keyboard keys indexed by ascii value, but ButtonState seems to check keys/buttons that are already bound, indexed by the function they are bound to? For our application, we may only need ButtonState, since it covers the impulses and everything.

Link to comment
Share on other sites

You can email one of us your test mod and we can put it up on the ftp.

In that case, you may want to check you inbox soon.

 

That's great that you figured out how these work! That should help a lot.

You're welcome. ^_^

 

Is there any way to detect whether a particular mouse button is held, even if it's bound to an arbitrary thing? For example, player binds _impulse42 to mouse 1. Later on, we want to check if the button bound to _impulse42 is being held (in this case it happens to be mouse 1 rather than a keyboard key). Could we do this with these functions?

 

[EDIT: Just read more carefully and it looks like you can look up the impulse with ButtonState? So if you bound mouse 1 to impulse 42, button state would tell you whether the mouse button was still being held down?]

Yes, it would. Perhaps you would like to test it yourself?

 

It's kind've weird in that KeyState seems to check hardware keyboard keys indexed by ascii value, but ButtonState seems to check keys/buttons that are already bound, indexed by the function they are bound to? For our application, we may only need ButtonState, since it covers the impulses and everything.

I've been trying to figure out why someone would actually need KeyState() as well as ButtonState(), and the only thing I could think of is if you somehow needed more than 88 keys assigned at a time.

Link to comment
Share on other sites

Nyarlathotep's test mod is on the FTP for us to try:

http://208.49.149.118/TheDarkMod/Miscellan...n/Nyar_Test.rar

 

See his post for instructions.

It shouldn't be too hard to figure out. There are two new console commands, keysFromBinding and BindingFromKey--pretty self-explanatory. There are also four new CVars; search for nyar. (key/button)Test is a boolean telling whether or not you want to test KeyState/ButtonState; (key/button)Range is an integer denoting the start of the range that you will see in the top right corner, displayed 16 at a time for your pleasure. I think that should cover everything. Questions? Comments?
Link to comment
Share on other sites

Excellent, welcome aboard. :)

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
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...