Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

"key is pressed(76)" bug

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Mon Dec 17, 2007 2:44 pm    Post subject: "key is pressed(76)" bug Reply with quote

I am having an extremely odd problem with plotscripting.

The "key is pressed" command does not respond to key #76 -- numpad 5. Toggling numlock makes no difference, and the key works in my word processor.

Code:
if(key is pressed(76)) then (
   clear string(TEMP_MESSAGE)
   append number(TEMP_MESSAGE, 76)
   insert new message(TEMP_MESSAGE)
)


This is only one test I made for this. Key 76 is just one in a number of keys I want to monitor, and I have a script that returned the key # of whichever key is being pressed. I originally had the program display the # of whichever key was being pressed, but key #76 was the only one that was having problems.

I am uncertain as to which OHR version I am using (don't have it installed on the library computer). It is no later than the last official release, and no earlier than this August.

I will download the latest and see if it works.[/code]
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Dec 18, 2007 4:10 pm    Post subject: Reply with quote

So all other keys work with similar code?

Also, the OHR has no respect for numlock. :(
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Thu Dec 20, 2007 12:58 pm    Post subject: Reply with quote

I used last Monday's nightly and the problem persisted.

Yeah; I haven't had this problem with any other key -- certainly not any of the other numpad keys.

I will start a new project and see if the problem happens with that. Otherwise...
Back to top
View user's profile Send private message
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Thu Dec 20, 2007 4:08 pm    Post subject: Reply with quote

Okay: I ran a test and this is what I got.

Code:

include, plotscr.hsd

define script, begin
   1, test, 0
end

script, test, begin
   while(true) do (
      wait(1)

      if(key is pressed(76)) then ( game over )
      if(key is pressed(72)) then ( game over )

   )
end


Using a new file (with Monday's nightly) I used the above code as the "new game script". Pressing key 72 (numpad 8 ) caused the game to end. Pressing key 76 did nothing.[/code]
Back to top
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Dec 22, 2007 6:52 pm    Post subject: Reply with quote

Numpad 5 works for me on this computer, as well as every other key (except those which are broken - I have 5+ spare PS/2 keyboards and should be using one of those instead). The OHR doesn't perform any mapping or anything between the FB scancode checking functions. Try out the gfx_sdl backend and see if that works. It uses totally different scancodes, which are mapped to the OHR native ones.

Code:
include, plotscr.hsd
include, scancode.hsi

plotscript, main, begin
  showstringat (30, 0, 190)
  while (1) do (
    variable (i)
    for (i, 0, 93) do (
      if (keyval(i)) then ($30="", appendnumber(30,i), appendascii(30,32), append number (30, keyval(i)))
    )
    wait
  )
end

_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group