Jump to content

Automatic Inventory Organization Mod


Guest Goon303

Recommended Posts

Guest Goon303

This is my first time posting here, but I've been playing this series of games as well as NWN, IWD 1 and 2 and the original BG etc for a long time. I started playing BG2 again recently and have been enjoying the experience as usual, and I'd like to say cudos to the guys who made all those great tweak packs and mods which fix many of the problems with the game.

 

But the one thing that still annoys me with these games and has always annoyed me was the tedious act of picking up items after killing lots of enemies. You know how when you kill a group of bad guys, all of their stuff end ups in little piles on top of their dead bodies. In NWN, this isn't so much of a problem because dead enemies don't drop so much stuff. But this is especially a problem in Throne of Bhaal where many battles leave dozens and sometimes even hundreds of dead bodies all over the place (Sendai's battle with the slaves, if you don't walk through there quickly, you can just sit there fighting wave after wave of bad guys racking up the experience, I love to do that) with their weapons and armor just laying there.

 

And the crazy thing is, that sometimes you know that in that pile of bodies somewhere was the leader of the pack who's probably carrying some better weapons and armor or possibly some important items, so you have to set about sifting through all the stuff to find it. This is mind numbingly boring work... and I say work, because it sure doesn't feel like a game. hehe :) Each bad guy had the same stuff... the only reason I want to pick it up is to sell it and to find the really good items.

 

I find this very tedious and to be a huge waste of time.

 

So what I'm wondering is, has anyone yet developed a script or mod that automatically has your main character pick items up? The idea here, would be to have your main character pick up items automatically, and place them into the various bags in your inventory per the type of item. Scrolls in the scroll case, potions in the potions bag, ammo in the ammo belt and so on. Or, just throw it all in a bag of holding. Better yet, instead of stuff being dropped on the ground, couldn't it just appear IN your bag of holding automatically? Example. You kill an enemy guard, and his armor and sword don't get dropped on the ground, they just appear in your bag of holding.

 

I mean, I can't be the only person who's tired of clicking on each pile of stuff on the ground to pick it up. It's already tedious enough having to click on chests and traps etc.... I actually find that I spend more time picking things up after a battle, than I do in the actual battle itself.

 

Anyway, I'm guessing this mod must already exist somewhere, and if so, does anyone know what it's called and where to download it?

 

and if there is no such mod, is there some kind of reason there isn't? programming/scripting limitations etc?

 

Another suggestion to fix this problem would be to have enemies just drop money or nothing at all. The only stuff I want is the important items anyway, or powerful weapons etc. Like in the battle against the mercenaries in Amkathren, they all drop weapons and armor etc, and the battle with Sendai's slaves, same thing. Why not just have them drop money, or nothing. hehe. The only reason it's annoying is because sometimes it's hard to know in those battles if something important was dropped, so I usually go through everything regardless. :party: I don't find that fun or entertaining in any way whatsoever. I do like how the important bad guys drop things and then I get to pick up my treasure afterwards, that's no big deal... but with little mindless grunts that have no importance to the story... and everyone one of them drops a pile of junk for me to pick up... eesh... I'm guessing a lot of the vet players out there have memorized the contents of each bad guy's belongings and just avoid picking anything up that isn't important, but I haven't played the game enough times to have memorized which things to pickup... hehe I would just be much happier if there was a mod that fixes this. :D

 

Anyway, if anyone shares my feelings, or knows a solution to this problem, please let me know. Thank you. :laugh:

Link to comment
Guest Goon303
Well it is easy to script something that allows to stack anything.

 

Then the game would order it all into piles for you anyway. :party:

 

Icen

 

hehe, yes, true I suppose, but I haven't been able to find a script that does that either. It would make things somewhat easier if I could stack armor in the inventory. It gets stacked in the bag of holding, so why not in the inventory as well right? I understand what the developers were trying to do, they were trying to make the inventory a little more realistic by limiting the amount of things a person can carry, but with bags of holding that have no bottoms, the inventory realism thing goes out the window, so we might as well take the next step and make the inventory even more easier to use. That's my thinking. :) But yes, stacking items in general, not just ammo, potions and scrolls etc, would make the game much easier to manage. If I could pick up like 50 armors and 50 swords etc, and then when the weight allowance gets too high for me to carry the stuff, and then just move it into the bag of holding myself, that's a lot better than having to just pick up 15 or 14 items, and then have to individually move each one into the bag of holding, and then go back to picking up more items... too much work to do that. :D

Link to comment

BACKUP ~Mod/Backup~
AUTHOR ~Icendoan, so it is buggy as hell~

BEGIN ~Unlimited Stacking Tweak~
COPY_EXISTING_REGEXP GLOB ~.*.itm~
PATCH_IF SOURCE_SIZE > 0x71 BEGIN
 WRITE_SHORT 0x38 9999
END

BUT_ONLY_IF_IT_CHANGES

 

Ought to do it.

 

Icen

Link to comment

Getting ready to test... final script code looks good and should be workable. But who knows.

It'll be a killer on the baldur.bcs file, but you could use a party ai script if you want. Just have to move the script into the override, do all the work there and then move the script back into the scripts directory for use by your party.

 

Theory is that when you press E

If your inventory is full and you have a bag of holding or other container the store interface comes up and you can empty your character of items.

If your inventory is not full your character will go around picking up ANY item that has all three ground, description, and inventory icons (that rules out a lot of items that players shouldn't/can't use).

 

That's the theory anyway. Time to go test... If it works, I'll post the code and you can decide if it's right for you....

Link to comment

This was a pretty cool exercise in coding. Hotkeys do not work within baldur.bcs They only work in party scripts. So I created a party script that all it does is

1) pick up one of each item. You character will go and pick up the items so you don't have to.

2) When inventory is full, if you have a container it's store will start up giving you the opportunity to free up your inventory.

3) Variables in place so that player1 does his container first followed by player2, etc... There is a timer in place so that your characters don't keep picking up items when you are trying to fight....

 

Down sides

1) over 2000 potential items to pick up. I weeded out any items that did not have ground, description or inventory icons. I also weeded out any items that were not movable or displayable in store.

The list could be narrowed further depending upon your wishes.

2) When picking up in this manner, items do not automatically stack in inventory unlike when picking up manually from ground.

3) You may have to press the hotkey again to get more stuff picked up.

 

Here is the dynamically created script's tp2 code... Enjoy :)

BACKUP ~ab_mods/Script_Test/backup~
AUTHOR ~plainab @ forums of G3, PocketPlane & TeamBG~

BEGIN ~Hotkey Ability to pickup stuff IF you have a container to put it in~
REQUIRE_PREDICATE !(GAME_IS ~bg1~) ~Script can not run on BG1 sorry. Skipping~
OUTER_INNER_PATCH ~12~ BEGIN
WRITE_BYTE 1 0x0a
READ_ASCII 1 lnl(1)
WRITE_BYTE 0 0x0d
READ_ASCII 0 mnl(1)
READ_ASCII 0 nl(2)
END
//use hotkey to start process
<<<<<<<< inlined/_start.baf
// 0 and slots full change to 1
IF
 Global("ab_invfull","LOCALS",0)
 HasItemSlot(Myself,SLOT_MISC3)
 HasItemSlot(Myself,SLOT_MISC4)
 HasItemSlot(Myself,SLOT_MISC5)
 HasItemSlot(Myself,SLOT_MISC6)
 HasItemSlot(Myself,SLOT_MISC7)
 HasItemSlot(Myself,SLOT_MISC8)
 HasItemSlot(Myself,SLOT_MISC9)
 HasItemSlot(Myself,SLOT_MISC10)
 HasItemSlot(Myself,SLOT_MISC11)
 HasItemSlot(Myself,SLOT_MISC12)
 HasItemSlot(Myself,SLOT_MISC13)
 HasItemSlot(Myself,SLOT_MISC14)
 HasItemSlot(Myself,SLOT_MISC15)
 HasItemSlot(Myself,SLOT_MISC16)
 HasItemSlot(Myself,SLOT_MISC17)
 HasItemSlot(Myself,SLOT_MISC18)
THEN
RESPONSE #100
 SetGlobal("ab_invfull","LOCALS",1)
 Continue()
END
// 1 and at least one slot empty change to 0
IF
 Global("ab_invfull","LOCALS",1)
 OR(16)
  !HasItemSlot(Myself,SLOT_MISC3)
  !HasItemSlot(Myself,SLOT_MISC4)
  !HasItemSlot(Myself,SLOT_MISC5)
  !HasItemSlot(Myself,SLOT_MISC6)
  !HasItemSlot(Myself,SLOT_MISC7)
  !HasItemSlot(Myself,SLOT_MISC8)
  !HasItemSlot(Myself,SLOT_MISC9)
  !HasItemSlot(Myself,SLOT_MISC10)
  !HasItemSlot(Myself,SLOT_MISC11)
  !HasItemSlot(Myself,SLOT_MISC12)
  !HasItemSlot(Myself,SLOT_MISC13)
  !HasItemSlot(Myself,SLOT_MISC14)
  !HasItemSlot(Myself,SLOT_MISC15)
  !HasItemSlot(Myself,SLOT_MISC16)
  !HasItemSlot(Myself,SLOT_MISC17)
  !HasItemSlot(Myself,SLOT_MISC18)
THEN
RESPONSE #100
 SetGlobal("ab_invfull","LOCALS",0)
 Continue()
END

IF
HotKey(%F1%)
THEN
RESPONSE #100
SetGlobalTimer("ab_stuff2store","LOCALS",60)
SetGlobal("ab_dostore","GLOBAL",1)
END
>>>>>>>>
// get hotkey default is E
PRINT ~Change Hotkey assignment? Default is E
[1]Change [2]Leave alone~
ACTION_READLN ~hk~
OUTER_WHILE ((%hk% != 1) AND (%hk% != 2)) BEGIN
PRINT ~Did not understand~
PRINT ~Change Hotkey assignment? Default is E
[1]Change [2]Leave alone~
ACTION_READLN ~hk~
END
OUTER_SPRINT ~F1~ ~E~
ACTION_IF (%hk% = 1) THEN BEGIN
PRINT ~What letter key do you want to use for your Hotkey?~
ACTION_READLN ~F1~
OUTER_WHILE !(~%F1%~ STRING_COMPARE_REGEXP ~[A-Z]~ =0) BEGIN
 PRINT ~Did not understand~
 PRINT ~What letter key do you want to use for your Hotkey?~
 ACTION_READLN ~F1~
END
END

EXTEND_BOTTOM_REGEXP ~party.bs~ ~inlined/_start.baf~
EVALUATE_BUFFER

PRINT ~Please be patient this may take some time.~
PRINT ~Building list dynamically with current base of game files.~

OUTER_SPRINT action1 ~END~
OUTER_SPRINT trigger1 ~THEN~
OUTER_SET y1 = 0

<<<<<<<< inlined/_clearinv.baf
IF
 !See([ENEMY])
 CombatCounter(0)
 ActionListEmpty()

GlobalTimerNotExpired("ab_stuff2store","LOCALS")
Global("ab_invfull","LOCALS",1)
Global("ab_dostore","GLOBAL",%z%)
HasItem("%sto_res%",Player%z%)
THEN
RESPONSE #100
SetGlobal("ab_dostore","GLOBAL",%zy%)
SetGlobal("ab_invfull","LOCALS",0)
StartStore("%sto_res%",Player%z%)
END
>>>>>>>>
COPY_EXISTING_REGEXP GLOB ~.*\.sto~ ~override~
PATCH_IF (%SOURCE_SIZE% >= 156) THEN BEGIN
SPRINT ~sto_res~ ~%SOURCE_RES%~
READ_LONG 0x8 ~store_type~
PATCH_IF (%store_type% = 5) BEGIN
 INNER_ACTION BEGIN
  ACTION_IF (FILE_EXISTS_IN_GAME ~%sto_res%.itm~) THEN BEGIN
COPY_EXISTING ~%sto_res%.itm~ ~override~
 PATCH_IF (%SOURCE_SIZE% >= 114) BEGIN
  READ_BYTE 0x18 ~flags~
  //only do those that are droppable
  PATCH_IF ((%flags% BAND "0b00000100") = "0b00000100")  // droppable
	   AND ((%flags% BAND "0b00001000") = "0b00001000") BEGIN // displayable in shop
   SET doit = 1
  END
 END
BUT_ONLY_IF_IT_CHANGES
ACTION_IF (%doit% = 1) THEN BEGIN
 OUTER_FOR (z=1;z<7;z+=1) BEGIN
  OUTER_SET zy = %z% + 1
  ACTION_IF (%zy% = 7) THEN BEGIN
   OUTER_SET %zy% = 0
  END
  EXTEND_BOTTOM_REGEXP ~party.bs~ ~inlined/_clearinv.baf~
   EVALUATE_BUFFER
 END
END
  END
 END
END
END
BUT_ONLY_IF_IT_CHANGES

<<<<<<<< inlined/_pickup1.baf
IF
 !See([ENEMY])
 CombatCounter(0)
 ActionListEmpty()
 GlobalTimerNotExpired("ab_stuff2store","LOCALS")
 Global("ab_invfull","LOCALS",0)
THEN
 RESPONSE #100
%action1%
>>>>>>>>
OUTER_SET num = 0
OUTER_SET num2 = 0
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
SET num = %num% + 1
PATCH_IF (%SOURCE_SIZE% >= 114) BEGIN
//  READ_ASCII offset variable  [ ELSE string  ]  [ ( value )  [ NULL  ]  ]
 READ_ASCII 0x003a ~invicon~ ELSE ~No File~  (8) NULL 	//8 (resref)	  Inventory icon
 READ_ASCII 0x0044 ~groundicon~ ELSE ~No File~(8) NULL	//8 (resref)	  Ground icon
 READ_ASCII 0x0058 ~descicon~ ELSE ~No File~  (8) NULL	//8 (resref)	  Description icon
 //following should weed out many player unusable items
 PATCH_IF ( (FILE_EXISTS_IN_GAME ~%invicon%.bam~)
	 AND (FILE_EXISTS_IN_GAME ~%groundicon%.bam~)
	 AND (FILE_EXISTS_IN_GAME ~%descicon%.bam~) ) BEGIN
  READ_BYTE 0x18 ~flags~
  //only do those that are droppable
  PATCH_IF ((%flags% BAND "0b00000100") = "0b00000100")  // droppable
	 AND ((%flags% BAND "0b00001000") = "0b00001000") BEGIN // displayable in shop
SET num2 = %num2% + 1
SPRINT action1 ~PickUpItem("%SOURCE_RES%")%nl%%action1%~
PATCH_PRINT ~Allowing pickup of %SOURCE_RES%  File #%num2% of %num% file(s) read.~
  END
 END
END
BUT_ONLY_IF_IT_CHANGES
EXTEND_BOTTOM_REGEXP ~party.bs~ ~inlined/_pickup1.baf~
EVALUATE_BUFFER

COPY ~override/party.bs~ ~scripts/party.bs~
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...