Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old August 16, 2012, 01:48   #51
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,020
Derakon is on a distinguished road
Hm, that's odd. You must not be receiving keyboard events for some reason. Try opening up gui/wxPyrel/mainFrame.py and changing EVT_CHAR to EVT_KEY_DOWN. The problem with that is that you have to press the key once for every time you want to perform the action, which is annoying for movement.

Another thing to try is moving the binding from the MainPanel class to the MainFrame class. Move these two lines:
Code:
        self.Bind(wx.EVT_CHAR, self.onKeyDown)
        self.Bind(wx.EVT_PAINT, self.onPaint)
and of course change "self.onKeyDown" and "self.onPaint" to "self.panel.onKeyDown" and "self.panel.onPaint".

As for the drawing, clearly there's some platform-dependent variation on how characters are drawn...probably due to different fonts. I admit the current system was derived by tweaking values until they looked right to me; short of moving to a more sensible approach your best bet is to simply change the charWidth and charHeight values in gui/wxPyrel/artists/ascii.py.
Derakon is offline   Reply With Quote
Old August 16, 2012, 13:10   #52
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 34
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
Quote:
Originally Posted by Derakon
Hm, that's odd. You must not be receiving keyboard events for some reason. Try opening up gui/wxPyrel/mainFrame.py and changing EVT_CHAR to EVT_KEY_DOWN. The problem with that is that you have to press the key once for every time you want to perform the action, which is annoying for movement.
OK, now I can move, though it only works with the top number keys, not the numpad - regardless of if numlock is on or off!
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!
ekolis is offline   Reply With Quote
Old August 16, 2012, 13:21   #53
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 34
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
Quote:
Originally Posted by Derakon View Post
As for the drawing, clearly there's some platform-dependent variation on how characters are drawn...probably due to different fonts. I admit the current system was derived by tweaking values until they looked right to me; short of moving to a more sensible approach your best bet is to simply change the charWidth and charHeight values in gui/wxPyrel/artists/ascii.py.
Looking at the wxPython documention, you should be able to set the *pixel* size of the font by calling:

self.font.SetPixelSize((self.charWidth, self.charHeight))

in gui/wxPyrel/artists/ascii.py in the __init__ method after you've initialized self.font. (For some reason the Font constructor won't let you initialize a pixel size, only a point size!) This improved the appearance of the game for me, though it looks like a little was chopped off on the bottom of a few symbols, so you might want to leave some extra space regardless. Oh, and do note the double parentheses - for some reason SetPixelSize takes only a tuple or a Size object, not two integers!
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!
ekolis is offline   Reply With Quote
Old August 16, 2012, 16:08   #54
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,020
Derakon is on a distinguished road
I guess the next thing to work on after sorting out commands and macros is a little cross-platform compatibility.

Seriously, thanks for all your work on this.
Derakon is offline   Reply With Quote
Old August 16, 2012, 17:38   #55
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 34
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
Heh, no problem - all I did was test a few things and poke around in the code a tiny bit!
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!
ekolis is offline   Reply With Quote
Old August 17, 2012, 14:00   #56
LostTemplar
Knight
 
Join Date: Aug 2009
Posts: 670
LostTemplar is on a distinguished road
So, you basically copy an angband command processing method in your new variant.
However it is probably not the best method ever. You can split commands to avoid "prompts" completely, without even increasing number of key presses required, e.g. you can have "select target" "select item" and "fire" commands, this can, in general, make interface much more simple and fast (player does not have to use "select" commands too often).
LostTemplar is offline   Reply With Quote
Old August 17, 2012, 15:03   #57
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 34
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
LostTemplar, you mean so instead of choosing fire, then choosing some ammo, then choosing a target, the game could remember your last-used item and target (Angband already has an option for the latter, but the former sounds useful too!) and just let you press the fire key to fire? And then there would be separate commands for "choose target" and "choose ammo"? (Interestingly, Steamband, with its firearms, does something similar - you can't fire ammo that isn't loaded into your firearm, logically enough, so you have to wield the ammo into the ammo slot, similar to the quiver!)
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!
ekolis is offline   Reply With Quote
Old August 17, 2012, 16:21   #58
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,020
Derakon is on a distinguished road
Quote:
Originally Posted by LostTemplar View Post
So, you basically copy an angband command processing method in your new variant.
However it is probably not the best method ever. You can split commands to avoid "prompts" completely, without even increasing number of key presses required, e.g. you can have "select target" "select item" and "fire" commands, this can, in general, make interface much more simple and fast (player does not have to use "select" commands too often).
I'm not entirely clear on what you're talking about, but...

1) There's already a system in place whereby similar prompts use the same code, only differing by what message is displayed (e.g. "Examine which item" vs. "Fire which missile") and what callback function is used.

2) If you're talking about the "stuffing all the things needed to execute one command into a single Command object" bit, then the main issue there is ensuring that each Command has the appropriate context to execute itself. If you want to have separate "select item", "select target", and "fire" Commands, then the last one still needs to know which item to shoot and where to shoot it -- that context has to be made available to it somehow. Now, I will grant that every Creature has a "curTarget" field that marks the thing they're currently aiming at -- this is needed so you don't have to reselect a target every time you fire. But I don't want to go stuffing all that context into the Creature records, since said context is basically arbitrary (i.e. it depends on the verb used).

That said, of course to the extent that different Commands share the same code, they will re-use that code. I don't think this will be a problem.
Derakon is offline   Reply With Quote
Old August 17, 2012, 17:35   #59
LostTemplar
Knight
 
Join Date: Aug 2009
Posts: 670
LostTemplar is on a distinguished road
Quote:
(Interestingly, Steamband, with its firearms, does something similar - you can't fire ammo that isn't loaded into your firearm, logically enough, so you have to wield the ammo into the ammo slot, similar to the quiver!)
Probably 99% of games do it in somewhat similar way.

Yes I know, that angband remember target also, but it is ugly, it requires an extra keypress to target "last target".

I suppose, to implement it in such a way, that when 'f' is peressed arrow is fired without questions, if there is not enough information, defaults should be used, e.g. first ammo at nearest enemy. Current angband behaviour is that there is a special command 'h' to do this, but if I want e.g. fire that particular ammo to nearest enemy in one keypress, I should create a macro. It would be much better imho to be able to press something like
'i' 'g' 'fffff' to bring up inventory, select ammo in slot 'g' and fire it 5 times to nearest (or last if it was selected) target instead of "fg5fg5fg5fg5fg5".
LostTemplar is offline   Reply With Quote
Old August 17, 2012, 17:40   #60
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 34
Posts: 911
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
I wonder if something similar could be done for spells? Now obviously you'll want to cast different spells sometimes, but a lot of the time you'll just want to spam magic missile or fireball or whatever your default "kill stuff" spell is! Typing "maa" over and over again is rather annoying - maybe if there was a hotkey for "cast default spell" and another command to mark a spell as your default? (Not just for attack spells - priests could cast Bless if they want, too!)
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!
ekolis 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pyrel dev log Derakon Variants 64 June 8, 2012 11:58
Play FAangband part II Fendell Orcbane AAR 6 November 29, 2010 21:53
JBand progress log. PaulBlay Development 38 June 27, 2009 10:19
Quill, Part II Sirridan AAR 9 June 25, 2009 04:51
Angband/65 development log PaulBlay Development 0 April 16, 2009 19:55


All times are GMT +1. The time now is 18:44.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.