![]() |
#1 | |
Adept
Join Date: Aug 2010
Posts: 142
![]() |
Trying to make ego lights for Angband 2.9.3
I've been trying to make ego lights for Angband 2.9.3. It seems I got most of it right. The flags are set right when I inspect the items with the debug commands, and they work as expected.
But there is a strange side effect in inventory display. Quote:
Code:
N:103:of Brightness X:29:0:0 W:1:1:0:0 C:1:0:0:0 T:39:0:99 F:SEE_INVIS | EGO_LIGHT
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem ![]() |
|
![]() |
![]() |
![]() |
#2 | |
Prophet
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,096
![]() |
Quote:
I have no idea why it shows it as negative. Maybe just giving it a value as ego makes it possible to generate negative value too (flip value). That C: -line is max to_hit, not fixed value. Artifacts get fixed values. For egos there is some code for values. |
|
![]() |
![]() |
![]() |
#3 |
Adept
Join Date: Aug 2010
Posts: 142
![]() |
Must have been some kind of mishaps in early versions of my code I guess. Now I get only positive numbers. Thanks for clarifying the (..) vs [..] issue
![]() I saw that I must adapt the "I"nspect command though, it gives wrong radius information. Still kind a cool to have made my first sort of ego item ![]()
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem ![]() |
![]() |
![]() |
![]() |
#4 |
Adept
Join Date: Aug 2010
Posts: 142
![]() |
Seems to work fine now. Thanks again for the help, Timo! Was also good to learn about the differences in artifact and ego item configuration.
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem ![]() |
![]() |
![]() |
![]() |
#5 |
Prophet
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,096
![]() |
Actually now that I read my reply to you again I think vanilla has some "hackish" code somewhere for displaying to_hit and to_dam. Armors and rings in 2.9.3 show only one value if another is zero and none if both are zero, but weapons show both even if they are both zero. It shows that differently based on item type, and that must have some kind of definition somewhere when to use which way to show those values. Might be a bit more complicated than I thought.
|
![]() |
![]() |
![]() |
#6 |
Adept
Join Date: Aug 2010
Posts: 142
![]() |
I think I found the function. Looks a bit convoluted. Before hacking my way in the code I thought Angband would have much less special cases, but there are enough, still. On the other hand once one understood the logic it looks more reasonable. I'd assume that the code was state of the art when written, and it's just me who is not used to such code.
At the moment I think I do not need to adapt this place though. I have a slightly off topic question: The number of 127 ego items seems to be limited through the use of a byte variable in the object_type structure for the link into the ego-item-date table. If I change that I assume I must also adapt game saving and loading routines. And somewhere the allocation of the e_info ego-item-data table (should have a define, IIRC). Is there more to it? It's not urgent, I think I have 20 ego-data slots left but if I continue modding Angband I sure run out of these slots, and maybe I'd better make the move early, if it alters the savegame structure. On the other hand "unsigned char" seems to work reasonably well with gcc on all platforms that I know and it would already give a whopping 128 extra ego data slots, while keeping the save game format. A comment in types.h mentions that "unsigned char" is not properly supported on some platforms, but maybe this has improved in the past ten years?
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem ![]() |
![]() |
![]() |
![]() |
#7 | |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Quote:
Any C90 compliant compiler targeting a normal platform should be fine with unsigned char for that field.
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg. Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.) Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011 |
|
![]() |
![]() |
![]() |
#8 |
Adept
Join Date: Aug 2010
Posts: 142
![]() |
Good to know. I don't have much experience with compilers other than gcc, thus I was a bit uncertain.
Keeping the variable to a 8 bit quantity should make things easier.
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem ![]() |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
*** no rule to make target | JDTAY | Development | 9 | March 3, 2010 19:58 |
Ego weapons you always wanted to find... | Pete Mack | AAR | 5 | July 5, 2009 04:37 |
pricing on slay ego weapons | Malak Darkhunter | Vanilla | 2 | July 1, 2009 21:02 |
Ego-Item indexes in defines.h | PaulBlay | Development | 0 | April 17, 2009 09:21 |
Trying to make my own variant | bpleshek | Variants | 8 | September 15, 2008 20:42 |