Expanding the Inventory - A Joint Venture

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Expanding the Inventory - A Joint Venture

Post by CorinthMaxwell »

All right......Considering that this is "user-created code", I would post this in the topic I created earlier. However, since it is not only incomplete, but also "not yet properly working" code, I think that it warrants its own topic.

Here's the situation. Back at DXEditing, a user named Temorzerella was working on modifying the in-game inventory so that it would have a 6 x 6 grid, as opposed to a 5 x 6 grid. He hit a few snags, and I decided to continue the experiment in his stead. After a bit of work, and a lot of Photoshopping, I was able to modify the original inventory textures so that they could properly display a 6 x 6 grid, and combined that as best I could with the code he supplied, which is shown below.

Now, at the time, I was testing the code in a Shifter-variant mod. I don't know if there was anything wrong with the provided code, or if it was trying to use it in Shifter, but every time I finally managed to compile a DeusEx.u file, the game crashed immediately upon testing the finished product with a new game.

That was (as far as I remember) the last issue I brought up at DXE before the crash. Perhaps someone here can finish the work that was started there, and actually get it TO work.

For now, here's the code.
Temorzerella - DX Editing wrote:Ok, the bad news about this is you pretty much have to edit the DeusEx.u package, but if your cool with redistributing the modified version with your mod, here's how to do it (note then that this mod may interfere with other mods). Also, backup your deusex.u before attempting modifications.

There are three variables in the deus ex player that control the inventory. Add the () expression after these three variables so that you can edit them in the def props.

var travel byte invSlots[30]; // 5x6 grid of inventory slots
var int maxInvRows; // Maximum number of inventory rows
var int maxInvCols; // Maximum number of inventory columns

Change these so they read

var() travel byte invSlots[36]; // 6x6 grid of inventory slots
var() int maxInvRows; // Maximum number of inventory rows
var() int maxInvCols; // Maximum number of inventory columns


Also, you have to overwrite a function. Change the RepairInventory() function to the following.

Code: Select all

function RepairInventory()
{
   local byte				LocalInvSlots[36];		// 6x6 grid of inventory slots
   local int i;
	local int slotsCol;
	local int slotsRow;
   local Inventory curInv;

   if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory))
      return;

   //clean out our temp inventory.
   for (i = 0; i < 36; i++)
      LocalInvSlots[i] = 0;

   // go through our inventory and fill localinvslots
   if (Inventory != None)
   {
      for (curInv = Inventory; curInv != None; curInv = curInv.Inventory)
      {
         // Make sure this item is located in a valid position
         if (( curInv.invPosX != -1 ) && ( curInv.invPosY != -1 ))
         {
            // fill inventory slots
            for( slotsRow=0; slotsRow < curInv.invSlotsY; slotsRow++ )
               for ( slotsCol=0; slotsCol < curInv.invSlotsX; slotsCol++ )
                  LocalInvSlots[((slotsRow + curInv.invPosY) * maxInvCols) + (slotscol + curInv.invPosX)] = 1;
         }
      }
   }

   // verify that the 2 inventory grids match
   for (i = 0; i < 36; i++)
      if (LocalInvSlots[i] < invSlots[i]) //don't stuff slots, that can get handled elsewhere, just clear ones that need it
      {
         log("ERROR!!! Slot "$i$" should be "$LocalInvSlots[i]$", but isn't!!!!, repairing");
         invSlots[i] = LocalInvSlots[i];
      }

}
Now that will give you a 36 space inventory, but it doesn't register yet. Now the maxInvRows and maxInvCols should be editable in your player class def props under the heading DeusExPlayer. Change the columns to 6 and leave the rows at 6. This will create a 36 space inventory, but it will cut off the last row (note that you can place items there though, try this in game by dragging a large item over and seeing it disappears off the right side into an additional column).

Now for the UI editing (no fun here). We have to make the UI somehow display that last row. Find the PersonaScreenInventory class under ExtensionObject.Window.TabGroupWindow.DeusExBaseWi ndow.PersonaScreenBaseWindow

Now the obvious first solution to this problem is to change the window size for the inventory grid. The function in this class that draws the inventory grid is CreateItemsWindow(). The default grid is 266 by 319 pixels. Increase the 266 by 53 to 319, which gives you a 6x6 grid.

This is where I gave up on trying to change the background to match, but this will create a 6x6 36space inventory. If any of you can finish the work, I welcome your solutions and would like to congratulate you as well.
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Re: Expanding the Inventory - A Joint Venture

Post by CorinthMaxwell »

As I stated in the previous post, my own contributions to the project were fairly simple. I figured that perhaps his idea didn't work because he hadn't modified the Inventory textures as well as the relevant code. Therefore, I exported the original inventory borders & backgrounds, and then created the following, in the hopes that this was all that was needed to get this particular project to work.

They're all separate images, so you can download them individually......but this is, more or less, how I expected the finished product to look. Sorry if it takes a while to load for some of you. :/

ImageImageImage
ImageImageImage

ImageImageImage
ImageImageImage
Last edited by CorinthMaxwell on Sat Oct 17, 2009 4:44 pm, edited 1 time in total.
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
User avatar
Jaedar
Illuminati
Posts: 3937
Joined: Fri Mar 20, 2009 3:01 pm
Location: Terra, Sweden, Uppsala.

Re: Expanding the Inventory - A Joint Venture

Post by Jaedar »

An expanded inventory would be very nice.
Best of luck to you.
"Delays are temporary; mediocrity is forever."
odio ergo sum
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Re: Expanding the Inventory - A Joint Venture

Post by CorinthMaxwell »

Jaedar wrote:An expanded inventory would be very nice.
Best of luck to you.
<_< Uhh......no.

I posted this here so that someone else can work on it.
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
Morpheus
X-51
Posts: 967
Joined: Thu Jan 27, 2005 9:56 am
Location: A planet near mars

Re: Expanding the Inventory - A Joint Venture

Post by Morpheus »

I remember this on DXE before, but I can't exactly do this as I don't have enough experience making and modifying screens/windows yet, but couldn't you do something like this:
Inventory with two tabs
Inventory with two tabs
Instead of having more slots on one scree, you'd have a second tab for a second inventory screen, same as first, so you can hold twice as much inventory? It might be slightly easier than just making the screen have more slots.
My nature videos: http://www.youtube.com/user/DynamixWarePro
My whistle/flute videos (and some other videos): http://www.youtube.com/user/DXMorpheus
User avatar
PKodon
Thug
Posts: 32
Joined: Fri Dec 04, 2009 3:48 am
Location: Minnesota, USA
Contact:

Re: Expanding the Inventory - A Joint Venture

Post by PKodon »

I suggested a 3-tab inventory for TNM a couple days ago, since they had to do away with the ability to overlap inventory items. In Deus Ex, I had normally overlapped a ton of items, putting items I always left on the belt (or things like medkits and bioelectric cells, which are accessible elsewhere) behind other stuff; smaller weapons in front of larger weapons, leaving one square of the larger weapons open; stacked all the food/drink items in one square, etc. Even 3 tabs with no ability to overlap items would not accommodate all the inventory I used to carry around, but it would help.

BTW, just out of curiosity, where is the code that allows you to overlap inventory located?

PK
"I knew it, they finally managed to send me to FUBAR, where some idiot brought a spork to a gunfight." - Cutter Slade, stuck in TNM
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Re: Expanding the Inventory - A Joint Venture

Post by CorinthMaxwell »

PKodon wrote:BTW, just out of curiosity, where is the code that allows you to overlap inventory located?

PK
I really don't think that we can consider a glitch a "code". Coding error, perhaps, but not a "code".
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
User avatar
PKodon
Thug
Posts: 32
Joined: Fri Dec 04, 2009 3:48 am
Location: Minnesota, USA
Contact:

Re: Expanding the Inventory - A Joint Venture

Post by PKodon »

CorinthMaxwell wrote: I really don't think that we can consider a glitch a "code". Coding error, perhaps, but not a "code".
Okay, let me rephrase that - where is the messed up coding glitch located? I'd like to see what allowed it in the first place.

PK
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Re: Expanding the Inventory - A Joint Venture

Post by CorinthMaxwell »

PKodon wrote:
CorinthMaxwell wrote: I really don't think that we can consider a glitch a "code". Coding error, perhaps, but not a "code".
Okay, let me rephrase that - where is the messed up coding glitch located? I'd like to see what allowed it in the first place.

PK
That, I actually don't know. You'd have to ask someone with more experience in modding than me.

Also.......I'm bringing this back up because I'd like to find out if anyone has managed to make any sort of progress (or had anything to share) concerning the general idea in the topic. Anything to add, anything to share, just reply.
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
fantsu
UNATCO
Posts: 254
Joined: Thu Oct 29, 2009 11:51 pm

Re: Expanding the Inventory - A Joint Venture

Post by fantsu »

I would love to have smaller inventory...
JC can carry too much equipment, like 30 fire extinguishers...

:giggle:
Bravery is not a function of firepower.
My "Deus Ex - Conspiracy" run on emulator
Alex Jacobson: They'll have you killed. They won't even blink an eye.
JC Denton: Neither did I.
nerdenstein
Illuminati
Posts: 1591
Joined: Thu Apr 24, 2008 7:40 pm
Location: Leicester, England, UK.

Re: Expanding the Inventory - A Joint Venture

Post by nerdenstein »

You can never carry too many Fire Extinguishers.

This looks like a good little idea but I have only basic Coding Knowledge and the only game i've ever coded for is Wolfenstein 3D xD

I've looked into Deus Ex Coding, but with -BigAss Scary Exams- Coming up over the next 5/6 weeks I've put off doing anything at all that hasnt involved Studying/SchoolWork. :/

After exams I plan to go crazy, drink beer and replay Deus Ex/TNM so I'm sure coding and Editing will come into it somewhere :P

At anyrate, I've heard this sorta thing would be quite difficult to change.
I know Darma also wants a new HUD for his mod.
As great as this idea is, I think it would also take some of the 'Realism' Factor out of the inventory system.
Well.. As realistic as being able to carry 30 fire extinguishers around at once, can be. :P
The Deus Ex Hardcore mod, had a pretty good Inventory System that changed depending on the Difficulty level set.
At Easy, every object in the game took up 1 space in the inventory, e.g GepGuns took up one space, Sniper rifle took up one space ect.
Classic Mode Difficulty, Obvious.
Realistic Difficulty mode allowed you to only carry 9 objects. I haven't looked throughly into this difficulty so I can't remember how it worked completely but if i remember rightly, these nine objects did not include Lockpicks, Multitools (these were added to the Keyring..) Medkits and Biocells ect. I could be wrong but I kinda liked that system when I briefly looked at it.
Then the unrealistic mode of difficulty completely changed the HUD and allowed you to carry as much as you liked.
If you haven't tryed Hardcore Mod then I suggest you do so..

not just for all the various gameplay changes, but It also has Multiplayer Bots :D

http://www.moddb.com/mods/hardcore-dx
The real trouble with reality is that there's no background music.
Post Reply