Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old August 13, 2007, 05:22   #1
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
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);
    }
so the borg will check for a user keypress (when ch != 0) and if so unhook. Problem is the ch is being altered to a 16 by the game code. If anyone needs the updated 309 borg to test this, let me know. I can post it on the borg page.

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
APWhite is offline   Reply With Quote
Old August 13, 2007, 13:00   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,951
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by APWhite View Post
so the borg will check for a user keypress (when ch != 0) and if so unhook. Problem is the ch is being altered to a 16 by the game code. If anyone needs the updated 309 borg to test this, let me know. I can post it on the borg page.
If you send it my way (to the address on the splashscreen) I'll have a go at figuring it out.
takkaria is offline   Reply With Quote
Old August 13, 2007, 19:23   #3
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
Quote:
Originally Posted by takkaria View Post
If you send it my way (to the address on the splashscreen) I'll have a go at figuring it out.
OK, I sent it.

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
APWhite is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.