![]() |
#1 |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Problem with new Term_inkey()
I am working on getting the screensaver and borg running for 309, but I am running into a snag with the new version of the Term_inkey(). The older versions just used a simper char ch to queue up the keys. Now there is an event_type.
The problem is for some reason, after the borg completes a sale or purchase in the store, it will unhook because the term_inkey() has been altered somehow in the game code. This didn't happen in the old (306) code. The (char) ch changes from 0 (meaning, no keypressed) to a 16. Somehow this is happening in the game code. The borg is not pressing any keys to correspond. Surprisingly, if I convert the old (char) ch into a event_type ch_evt and monitor it, it will return a '2' on a keypress and stop the borg until that initial sale is completed. Once the sale is completed, the ch_evt is returning a 16 each round and the keyboard seems to be disconnected, I cant stop the borg and cannot change the inkey. Anyone know why this goofy thing is happening and what I might do to fix it? The borg code is in borg9.c in borg_inkey_hack() lines read: Code:
/* Check for key */ ch = borg_inkey(TRUE); /* Use the key */ if (ch) return (ch); /* Check for user abort */ (void)Term_inkey(&ch, FALSE, FALSE); /* User Abort */ if (ch != 0) { /* Oops */ borg_oops("user abort"); /* Hack -- Escape */ return (ESCAPE); } The 309 borg is not ready yet, but I am working on it. He now knows that he is in a store, reads the store inventory and price list. He can make purchases correctly. There are lots of little things to fix before it is ready to release. Andrew |
![]() |
![]() |
![]() |
#2 |
Veteran
Join Date: Apr 2007
Posts: 1,951
Donated: $40
![]() |
If you send it my way (to the address on the splashscreen) I'll have a go at figuring it out.
|
![]() |
![]() |
![]() |
#3 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
The borg would be happy using any sort of keypress monitor like inkey(). It does not have to be that particular function. I am not sure if inkey() is already in use in that line or not. Andrew |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|