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

    • 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
       
      · 5 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...