Item slots


Questions, Explanations, Howtos

Temple Termagant

Posts: 5

Joined: Sunday, 30th October 2011, 19:10

Post Saturday, 19th November 2011, 12:37

Item slots

I am extremaly irritated with such low number of item slots(50). It forces lots of "bureaucracy" and stashing items back and forth after obtaining lots of scrolls/potions/other stuff.

Do smart changing only
  Code:
char index_to_letter(int the_index)
int letter_to_index(int the_letter)

from stuff.cc should extend available slots to any ASCII other than numbers, so about 90?

AtT

Blades Runner

Posts: 567

Joined: Saturday, 10th September 2011, 14:40

Post Monday, 21st November 2011, 03:23

Re: Item slots

If you are consistently pushing the item slot limit you are very likely carrying way too much junk to begin with. Unless you are a Nemelex worshiper, I don't see the item slot limit being a reasonable strain on any character.

Temple Termagant

Posts: 5

Joined: Sunday, 30th October 2011, 19:10

Post Monday, 8th July 2013, 21:47

Re: Item slots

When I returned to Crawl after long break I encountered the same problem, so I "fixed" the code by myself:
Spoiler: show
  Code:
diff -u stone_soup-0.12.2/source/defines.h stone_soup-0.12.2_mod/source/defines.h
--- stone_soup-0.12.2/source/defines.h   2013-06-01 04:52:08.000000000 +0200
+++ stone_soup-0.12.2_mod/source/defines.h   2013-07-12 20:45:46.446580170 +0200
@@ -46,7 +46,8 @@
 #define ZOTDEF_RUNE_FREQ 7
 
 // max size of inventory array {dlb}:
-#define ENDOFPACK 52
+#define CROMAT_PLUS_ITEMS 127
+#define ENDOFPACK 52+CROMAT_PLUS_ITEMS
 
 // Max ghosts on a level.
 const int MAX_GHOSTS = 10;
diff -u stone_soup-0.12.2/source/libutil.h stone_soup-0.12.2_mod/source/libutil.h
--- stone_soup-0.12.2/source/libutil.h   2013-06-01 04:52:08.000000000 +0200
+++ stone_soup-0.12.2_mod/source/libutil.h   2013-07-12 21:33:05.546459869 +0200
@@ -57,12 +57,12 @@
 
 static inline bool isaalpha(int c)
 {
-    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c<-1||c>127;
 }
 
 static inline bool isaalnum(int c)
 {
-    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
+    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| c<-1||c>127;
 }
 
 static inline ucs_t toalower(ucs_t c)
diff -u stone_soup-0.12.2/source/stuff.cc stone_soup-0.12.2_mod/source/stuff.cc
--- stone_soup-0.12.2/source/stuff.cc   2013-06-01 04:52:10.000000000 +0200
+++ stone_soup-0.12.2_mod/source/stuff.cc   2013-07-12 21:43:16.418433985 +0200
@@ -757,7 +757,13 @@
 char index_to_letter(int the_index)
 {
     ASSERT(the_index >= 0 && the_index < ENDOFPACK);
-    return (the_index + ((the_index < 26) ? 'a' : ('A' - 26)));
+    if (the_index<26)
+        return the_index+'a';
+    else if (the_index<52)
+        return the_index + ('A' - ('z'-'a'+1));
+    else
+        return the_index-52+128+1;
+    //return (the_index + ((the_index < 26) ? 'a' : ('A' - 26)));
 }
 
 int letter_to_index(int the_letter)
@@ -766,7 +772,10 @@
         return (the_letter - 'a'); // returns range [0-25] {dlb}
     else if (the_letter >= 'A' && the_letter <= 'Z')
         return (the_letter - 'A' + 26); // returns range [26-51] {dlb}
-
+    else if (the_letter <-1)
+        return (the_letter+128+('Z'-'A'+'z'-'a'+1)); // returns range [26-51] {dlb}
+    else if (the_letter <-1||the_letter>127)
+        return (the_letter-128+('Z'-'A'+'z'-'a'+1)); // returns range [26-51] {dlb}
     die("slot not a letter: %s (%d)", the_letter ?
         stringize_glyph(the_letter).c_str() : "null", the_letter);
 }
diff -u stone_soup-0.12.2/source/tags.cc stone_soup-0.12.2_mod/source/tags.cc
--- stone_soup-0.12.2/source/tags.cc   2013-06-01 04:52:10.000000000 +0200
+++ stone_soup-0.12.2_mod/source/tags.cc   2013-07-12 20:45:54.294579837 +0200
@@ -2377,7 +2377,7 @@
     int count, count2;
 
     // how many inventory slots?
-    count = unmarshallByte(th);
+    count = (unsigned char) unmarshallByte(th);
     ASSERT(count == ENDOFPACK); // not supposed to change
     for (i = 0; i < count; ++i)
         unmarshallItem(th, you.inv[i]);

It seems to work(add 127 additional slots) - do not crash on save/load while I have many items items(up to new limit)
As additional characters are "extended ASCII" and uninputable, the solution works only for tiles with mouse (console also works, but one cannot select them).

EDIT: meh, one can pick/drop them(multiselection), but interactions(wield, read,quaff ->single selection) do not work, I need to investigate further:/
EDIT2: FIXED, now works fine
Last edited by cromat on Friday, 12th July 2013, 19:49, edited 1 time in total.

Abyss Ambulator

Posts: 1217

Joined: Sunday, 14th April 2013, 04:01

Post Wednesday, 10th July 2013, 14:44

Re: Item slots

3 weapons (main, secondary, ranged) + 1 ammo pile + 7 armor = 11 "almost always" used slots.
assuming 5x useful of each consumable and jewelry slot, which feels pretty reasonable to me = 36 total used slots.
that still gives 16 slots for wands, books, and misc. Am I forgetting anything?
Three wins: Gargoyle Earth Elementalist of Ash, Ogre Fighter of Ru, Deep Dwarf Fighter of Makhleb (0.16 bugbuild :( )

Halls Hopper

Posts: 60

Joined: Friday, 17th December 2010, 02:30

Post Wednesday, 10th July 2013, 15:55

Re: Item slots

..Potions & Scrolls aren't misc.

..enough space, given you are strong enough, you could carry some dragon-corpses with you,..
..52 slots, from A to z. What more stuff do [strike]you[/strike]one need?

//post scriptum,


wrong section, sry.
Even with TabO alone Tiles player get a feeling of Console.
There is no mouse in crawl;
Hit ?? ingame!

Temple Termagant

Posts: 5

Joined: Sunday, 30th October 2011, 19:10

Post Wednesday, 10th July 2013, 18:44

Re: Item slots

TeshiAlair wrote:3 weapons (main, secondary, ranged) + 1 ammo pile + 7 armor = 11 "almost always" used slots.
assuming 5x useful of each consumable and jewelry slot, which feels pretty reasonable to me = 36 total used slots.
that still gives 16 slots for wands, books, and misc. Am I forgetting anything?

More is not necessary, but game without a need to throw out not worthless items just becouse they are a "weekest link" is more fun for me.
Example: as a wizard of sif muna one can collect most of books, I like to be able to carry them instead of doing pilgrimages to stash for learning.
Maybe inventory management is an aspect of game, but it's much more irritating than challenging for me

Edit: while I understand that increasing 2*(a-z) limit is hard, while there are no containers in Crawl?
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 11th July 2013, 12:39

Re: Item slots

cromat wrote:Edit: while I understand that increasing 2*(a-z) limit is hard, while there are no containers in Crawl?

Because we think the 52 item limit is good for the game. Choose what you carry and use what you have instead of hoarding junk you never use. Containers? Have you ever played nethack? Managing containers is painful.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks: 2
gofftc, MIC132

Halls Hopper

Posts: 60

Joined: Friday, 17th December 2010, 02:30

Post Thursday, 11th July 2013, 13:01

Re: Item slots

if its only for itemslots- there are enough signs already.

[more invenory
.itemsaveing
..save the game
...savescum <- at least this people can do;
all items aviable all the time -> kill Nemelex
./s kill_go
..fork this

/sarcasm]
Even with TabO alone Tiles player get a feeling of Console.
There is no mouse in crawl;
Hit ?? ingame!

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Thursday, 11th July 2013, 14:27

Re: Item slots

Frankly, I always find that 52 is more than enough. From the point of view of how much effort it takes to think about, 40 or even 36 would be better.

Not that inventory management isn't a challenge sometimes, but I pretty much never have > 52 items that are not junk. Instead I have some items that are now useless but I haven't gotten rid of yet, perhaps in some vain hope they'll become useful again, some items I should stash but am still lugging around, and other items I haven't gotten around to deciding I will frequently use. Plus the things that actually are indispensible -- rarely more than 24 of them.

Having to stash and restash is NOT necessary, if you just follow crate's idea: (paraphrasing) 'the dungeon where I am right now is my stash. I just drop things in corners where I know monsters won't step.', and make proper (ie. liberal) use of Ctrl+F. DCSS > Micromanagement.

Temple Termagant

Posts: 5

Joined: Sunday, 30th October 2011, 19:10

Post Friday, 12th July 2013, 19:54

Re: Item slots

Well, it depends on how one defines "personal fun", I prefer to increase limit than waste time to drop/pick items and make pilgrimages via Ctrl+F...
For completness: I've updated patch in previous post, now it works as expected

gofftc: Really? There are plenty of easy ways to cheat if one wants, but what's the point if one can just turn wizard mode on?
Last edited by cromat on Friday, 12th July 2013, 20:01, edited 2 times in total.

Halls Hopper

Posts: 60

Joined: Friday, 17th December 2010, 02:30

Post Friday, 12th July 2013, 20:20

Re: Item slots

& your poit may be?
Even with TabO alone Tiles player get a feeling of Console.
There is no mouse in crawl;
Hit ?? ingame!

Temple Termagant

Posts: 5

Joined: Sunday, 30th October 2011, 19:10

Post Friday, 12th July 2013, 20:31

Re: Item slots

While is amount of slots sufficient can be discussed, saying that it makes savescumming easier is a bit ridiculous for me.
I see that I don't have Your understanding, so I'll just leave here this code, continue playing in a way I like best and hope that someday someone finds this code and it'll make his/her game more enjoyable:P

Halls Hopper

Posts: 60

Joined: Friday, 17th December 2010, 02:30

Post Friday, 12th July 2013, 21:09

Re: Item slots

I'am just tired of maybe starting a new 'There should be a savegame-function in the game!-discussion.
They come up once11 in a while.

But I'am not against modding the game, I appeciate it, in fact I would do it myselfe if I could.
Unluckily I don't have much timeto spare for a 'hobby'.
I also recognice to being much to rude, especially in this part of the Tavern.
Please ignore my writings if it pleases you.

On a personal note:
I dislike save scumming more than wizard mode,
but only testet savescumming for the testing reason, and wizmode is beyond my desires.
So for a player only I don't like the: give me unlimitet space - implemention for further versions,
But, who wanna try it out, be my guest.
Even with TabO alone Tiles player get a feeling of Console.
There is no mouse in crawl;
Hit ?? ingame!

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Saturday, 13th July 2013, 01:57

Re: Item slots

Personally, I'd like the ability to disable wizard mode, with no way of reenabling it, for the rest of the game. or hook the wizard key up to a custom menu implemented in lua, which would provide a very few, very specific functions. This would make it possible to trial different circumstances + character starts/setups that are currently out of the ordinary, without being constantly tempted with the ability to not die, create objects, etc. If you got the setup wrong you would need to restart the game and fix it, just as if it were a real character background.

It's possible this is already possible by using lua in the init.txt file; I'll look into that.

For this message the author savageorange has received thanks:
gofftc
User avatar

Vestibule Violator

Posts: 1509

Joined: Wednesday, 21st September 2011, 01:10

Location: St. John's, NL, Canada

Post Saturday, 13th July 2013, 03:32

Re: Item slots

savageorange, binding & to nothing should help. you'll still have to press Y to die, though.
Won all race/bg, unwon (online): Nem* Hep Uka
Favourites: 15-rune Trog, OgNe/OgIE/OgSu (usually Ash), Ds, Ru, SpEn, Ce of Chei, Qaz

For this message the author rchandra has received thanks:
savageorange

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Saturday, 13th July 2013, 08:06

Re: Item slots

Thanks! That's a good start.

For anyone else, you can do something like that by typing "~m&." followed by Enter. Then you only have two things to deal with :
answering no to "Die?" and the prompt, when you do die, asking you whether to save macros.

(I haven't figured out how to bind to literally no command yet; the above binds it to the wait command)

Return to Coding

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.