Jump to content

R&D Inventory, Items & Weapons Overhaul


anUser

Recommended Posts

Fixed the wheel scrolling both lists. Just had to change the copied scrollbar string name and var for the inventory list to be different than the locker ones.

 

Edit:

My fix worked for my 10sec test but after playing some more the wheel is again scrolling both lists at once.

Link to comment
Share on other sites

  • Replies 129
  • Created
  • Last Reply

Top Posters In This Topic

I believe the root of the scrollbar/mouse wheel problem is a bug in vanilla that you can also see in the build item list and project list. They also both respond to the mouse wheel when a scrollbar visible.

 

I may go back to the grid view as with the weapon size reduced I was able to get the full 16 small item cap to show without needing to scroll.

Link to comment
Share on other sites

Trying to pick up an idea of XMarksTheSpot's from the Increase Squad Size thread at http://forums.nexusmods.com/index.php?/topic/804076-rd-to-increase-squad-size/?p=8722060

namely this

 

I haven't looked at it in detail, but I think the arrSmallItems array is initialized to hold up to 16 elements, so additional items beyond the standard two should be accessible in there. Even if the backpack label would be re-jiggered to be used as another item label this would still not be enough for mods introducing more than 3 small item slots.

What I'd propose is a different direction: I'd do away with the second item label, make the first one larger and able to auto-scroll vertically (perhaps sacrificing its horizontal auto-scrolling behavior in the process, but I'd call that acceptable). Instead of providing single strings to various variables the snippet above should then be re-coded to loop through the whole arrSmallItems array, concatenate all non-empty name strings with line breaks in-between and storing it all in item1.

How's that sound? :smile:

Does anyone smarter than me want to look into that? I've been unable to get even the simplest UPK changes to work.

Link to comment
Share on other sites

Trying to pick up an idea of XMarksTheSpot's from the Increase Squad Size thread at http://forums.nexusmods.com/index.php?/topic/804076-rd-to-increase-squad-size/?p=8722060

namely this

[snip my blathering]

Does anyone smarter than me want to look into that? I've been unable to get even the simplest UPK changes to work.

I've modified the XGChooseSquadUI.BuildLoadout() method, changing

// End:0x38F
if(kSoldier.m_kChar.kInventory.arrSmallItems[0] != 0)
{
	kLoadout.item1.StrValue = Item(kSoldier.m_kChar.kInventory.arrSmallItems[0]).strName;
}
// End:0x46F
if(kSoldier.m_kChar.kInventory.arrSmallItems[1] != 0)
{
	kLoadout.item2.StrValue = Item(kSoldier.m_kChar.kInventory.arrSmallItems[1]).strName;
}

to

strName = "";
iItems = 0;
J0x2C6:
// End:0x38C [Loop If]
if(iItems < 16)
{
	iItem = kSoldier.m_kChar.kInventory.arrSmallItems[iItems];
	// End:0x37E
	if(iItem != 0)
	{
		strName = strName $ (Item(iItem).strName $ "\\n");
	}
	++ iItems;
	// [Loop Continue]
	goto J0x2C6;
}
kLoadout.item1.StrValue = strName; 

Hex change for the whole method (1012 [0x3F4] bytes total) here:

replace
41 23 00 00 AB 1F 00 00 00 00 00 00 3D 23 00 00 00 00 00 00 00 00 00 00 41 23 00 00 00 00 00 00 90 01 00 00 F8 2B 00 00 BD 05 00 00 B5 03 00 00 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 10 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 A8 19 19 00 41 23 00 00 0A 00 9E 00 00 00 00 1B C8 27 00 00 00 00 00 00 16 2B 00 EC F9 FF FF 00 1B 12 10 00 00 00 00 00 00 19 00 41 23 00 00 0A 00 00 45 00 00 00 1B 10 10 00 00 00 00 00 00 16 27 4A 16 19 00 41 23 00 00 0C 00 84 45 00 00 00 1B A3 0F 00 00 00 00 00 00 24 01 16 16 0F 35 DF F9 FF FF 6D FA FF FF 00 00 35 0A 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 12 20 A4 FE FF FF 3B 00 2A FA FF FF 00 1B 23 0F 00 00 00 00 00 00 35 78 FB FF FF 74 FA FF FF 00 00 19 00 41 23 00 00 09 00 EC 44 00 00 00 01 EC 44 00 00 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0F 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 19 00 41 23 00 00 0B 00 F3 44 00 00 00 1B AC 0F 00 00 00 00 00 00 4A 16 0F 35 54 FB FF FF 66 FA FF FF 00 00 35 0F 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2C 09 0F 35 0D 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 38 3A 19 00 41 23 00 00 0A 00 91 45 00 00 00 1B B5 0E 00 00 00 00 00 00 16 07 40 02 9A 35 0D 17 00 00 11 17 00 00 00 00 00 3E 23 00 00 25 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0E 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 1F 00 06 AF 02 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0E 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 19 00 41 23 00 00 2A 00 64 00 00 00 00 1B 4C 10 00 00 00 00 00 00 19 00 41 23 00 00 0A 00 91 45 00 00 00 1B B5 0E 00 00 00 00 00 00 16 4A 16 07 8F 03 9B 1A 25 35 8D FB FF FF 77 FA FF FF 00 00 35 B6 F9 FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 25 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0C 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 35 C7 02 00 00 C8 02 00 00 01 00 1B 09 15 00 00 00 00 00 00 1A 25 35 8D FB FF FF 77 FA FF FF 00 00 35 B6 F9 FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 4A 16 07 6F 04 9B 1A 26 35 8D FB FF FF 77 FA FF FF 00 00 35 B6 F9 FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 25 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0B 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 35 C7 02 00 00 C8 02 00 00 01 00 1B 09 15 00 00 00 00 00 00 1A 26 35 8D FB FF FF 77 FA FF FF 00 00 35 B6 F9 FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 4A 16 0F 35 08 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 00 40 23 00 00 14 2D 35 07 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 84 19 00 41 23 00 00 0B 00 12 45 00 00 00 1B 05 11 00 00 00 00 00 00 4A 16 18 21 00 19 00 41 23 00 00 0B 00 12 45 00 00 00 1B 05 11 00 00 00 00 00 00 27 16 16 14 2D 35 06 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2D 35 4E FF FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 07 8A 05 2D 35 07 17 00 00 11 17 00 00 00 00 00 3E 23 00 00 0F 35 09 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2C 03 06 A8 05 0F 35 09 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 25 04 00 3E 23 00 00 04 3A 3F 23 00 00 53 00 00 00 02 00 82 00 74 04 00 00 00 00 00 00
with
41 23 00 00 AB 1F 00 00 00 00 00 00 3D 23 00 00 00 00 00 00 00 00 00 00 41 23 00 00 00 00 00 00 90 01 00 00 F8 2B 00 00 79 05 00 00 B5 03 00 00 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 10 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 A8 19 19 00 41 23 00 00 0A 00 9E 00 00 00 00 1B C8 27 00 00 00 00 00 00 16 2B 00 EC F9 FF FF 00 1B 12 10 00 00 00 00 00 00 19 00 41 23 00 00 0A 00 00 45 00 00 00 1B 10 10 00 00 00 00 00 00 16 27 4A 16 19 00 41 23 00 00 0C 00 84 45 00 00 00 1B A3 0F 00 00 00 00 00 00 24 01 16 16 0F 35 DF F9 FF FF 6D FA FF FF 00 00 35 0A 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 12 20 A4 FE FF FF 3B 00 2A FA FF FF 00 1B 23 0F 00 00 00 00 00 00 35 78 FB FF FF 74 FA FF FF 00 00 19 00 41 23 00 00 09 00 EC 44 00 00 00 01 EC 44 00 00 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0F 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 19 00 41 23 00 00 0B 00 F3 44 00 00 00 1B AC 0F 00 00 00 00 00 00 4A 16 0F 35 54 FB FF FF 66 FA FF FF 00 00 35 0F 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2C 09 0F 35 0D 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 38 3A 19 00 41 23 00 00 0A 00 91 45 00 00 00 1B B5 0E 00 00 00 00 00 00 16 07 40 02 9A 35 0D 17 00 00 11 17 00 00 00 00 00 3E 23 00 00 25 16 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0E 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 1F 00 06 AF 02 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0E 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 19 00 41 23 00 00 2A 00 64 00 00 00 00 1B 4C 10 00 00 00 00 00 00 19 00 41 23 00 00 0A 00 91 45 00 00 00 1B B5 0E 00 00 00 00 00 00 16 4A 16 0F 00 13 36 00 00 1F 00 0F 00 E7 45 00 00 25 07 8C 03 96 00 E7 45 00 00 2C 10 16 0F 00 B7 35 00 00 1A 00 E7 45 00 00 35 8D FB FF FF 77 FA FF FF 00 00 35 B6 F9 FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 07 7E 03 9B 00 B7 35 00 00 25 16 0F 00 13 36 00 00 70 00 13 36 00 00 70 35 C7 02 00 00 C8 02 00 00 01 00 1B 09 15 00 00 00 00 00 00 00 B7 35 00 00 4A 16 1F 0A 00 16 16 A3 00 E7 45 00 00 16 06 C6 02 0F 35 D8 F9 FF FF 66 FA FF FF 00 00 35 0C 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 00 13 36 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0F 35 08 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 00 40 23 00 00 14 2D 35 07 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 84 19 00 41 23 00 00 0B 00 12 45 00 00 00 1B 05 11 00 00 00 00 00 00 4A 16 18 21 00 19 00 41 23 00 00 0B 00 12 45 00 00 00 1B 05 11 00 00 00 00 00 00 27 16 16 14 2D 35 06 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2D 35 4E FF FF FF 7E FA FF FF 00 00 19 00 41 23 00 00 09 00 ED 44 00 00 00 01 ED 44 00 00 07 46 05 2D 35 07 17 00 00 11 17 00 00 00 00 00 3E 23 00 00 0F 35 09 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 2C 03 06 64 05 0F 35 09 17 00 00 11 17 00 00 00 01 00 3E 23 00 00 25 04 00 3E 23 00 00 04 3A 3F 23 00 00 53 00 00 00 02 00 82 00 74 04 00 00 00 00 00 00

The original code was pretty wasteful space-wise, so after re-writing there's still 102 bytes left for making adjustments, if needed.

Without any changes to the flash UI the result is a little unsightly, but on the UnrealScript side everything seems to work as intended:

http://i.imgur.com/MfMeHTE.jpg

So, things left to do:

properly mask textfield sprite so text doesn't extend beyond unit box,

decrease line spacing a bit and make text left-aligned to emulate vanilla look-and-feel,

implement vertical scrolling for if there's more than two lines of item labels

 

Edit: I've already modified the soldier loadout flash to enable more unit slots as part of the R&D to Increase Squad Size effort, divorcing pending backpack changes from that would be rather difficult and personally I'm not very interested in maintaining multiple versions of those flash classes :confused:

As a re-write of the soldier slot stuff was already on my to-do list I could re-factor it in a way that closely emulates the vanilla look-and-feel for the default 4+2 soldier slots setup. The corresponding UnrealScript changes for enabling more soldier slots would still be mandatory.

What's everybody's stance on this? Is it okay to force the ability to have more soldiers on mods that want only to increase the number of small items and vice versa?

Edited by XMarksTheSpot
Link to comment
Share on other sites

Yes, if someone wants only the increased number of items, they can keep SkyRanger capacity at 4.

Then the only difference they will notice is that the slots are scrollable... Possibly adding a separate fix to lock down the scrolling for those who do not want scrolling slots?

Edited by Bertilsson
Link to comment
Share on other sites

Then the only difference they will notice is that the slots are scrollable... Possibly adding a separate fix to lock down the scrolling for those who do not want scrolling slots?

Yeah, changing the scrolling behaviour to respect the number of visible slots is part of the re-write I had in mind. For the default 4+2 slots there shouldn't be any scrolling involved, I agree.

Link to comment
Share on other sites

  • 4 weeks later...

I've finished up an updated version of the grid-like small item layout - changes include better use of the padding parameter, a modified slot order (right-to-left, top-to-bottom), increased font size and proper placement of the selection indicator thingie (that one took a lot longer than anticipated, but that's what you get for being a stickler for such details :geek:).

Hex changes to the command1.upk file noted below:

I can't believe I didn't see this earlier. This is great. However, I am stuck at adding these changes to command1.upk. After decompressing the file, I tried to replace the hex blocks indicated by the offsets using a xvi32, but the game would CTD when I try to load a save game. I am clearly doing something wrong. Any ideas?

Link to comment
Share on other sites

Any ideas?

Does the game run correctly with an unmodified decompressed upk file inside the CookedPCConsole folder? Have you removed the corresponding file with the .uncompressed_size extension, if there is any?

Other than that, have you checked the file sizes before and after modification? You need to make sure to replace only the indicated number of bytes, the file size needs to stay the same.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...