Jump to content

Bags of Holding and Inventory Scripting


Zyjacya

Recommended Posts

Heya, so one of the cruxes of my gameplay is spending excessive amounts of time looking through my containers for scrolls/potions/items that i have saved up for certain situations. One of the things that I have always loved about Minecraft is the inventory sorting mod, and wanted to try and make something similar for BG. I have looked a little into modding tutorials (many of the links are broken from the collections i found), and also have some coding background to work with.

I have primarily only looked at scripting thus far, but it looks possible? There are a few things I was having trouble figuring out and wanted to ask directly.

1) Is there a way to access a player's inventory items, and their properties? I.e. I want to check if the user has any inventory items whose in-game name contain the string "holding", or for items with the item flag "short sword". This will be important for both checking what containers are in the inventory as well as whatever sorting algorithms I settle on using.

2) Is there a way to access a container in a player's inventory such that I can add or remove items directly to/from it? Relating to the sorting idea, I basically just want to save all the contents of my bags as a csv or something so i can then sort it with bubble or whatever and then put it back in in the new ordering.

3) Is there a better way to go about doing this? Scripting seems like the most viable avenue, but perhaps there's something that will be better to use than the DLTCEP script editor? Any recommendations in this area are appreciated.

And of course, it is possible that this already exists and I'm being a moron and am just not able to find it. In that case I would greatly appreciate direction towards it, though would also like answers to the questions above for my own curiosity and education.

 

Thanks!

Bard

Edited by Zyjacya
Link to comment
54 minutes ago, Zyjacya said:

1) Is there a way to access a player's inventory items, and their properties?

1. Yes, weidu.exe, the same thing that every mod uses to install itself into your game, the setup-modname.exe, can do this. But scripts can't do it in-game. So there goes that idea.

...2 . No. ... well technically you could ... but it's not very simple, and not recommended. Why, it's a billion tasks to do 1 ... as you would need to create your own tool to edit the savegame with your own script language, or rather use another programming language to do it. Really, "not very simple".

... easy escape, the packmule mod. In game mule as a extra party member that follows you in-game, that has multiple pockets in it's pack. Accessable via dialog, and so it's not actually in party inventory, which has a lot of bad programming that was the point to avoid it ...

Edited by Jarno Mikkola
Link to comment

Ah that is unfortunate, if the answer I expected. I would actually be plenty satisfied with an external tool, that I could just periodically run out-of-game, and it would just sort the bags it find in the save game, if that would make it any more possible. I don't really have the skills or motivation to reverse-engineer the raw memory, but if weidu can let me work at level of programming closer to the surface I'd be interested in learning more about it. I did take a look at weidu but didn't go too far since I'm not super experienced with command-line scripting, just conventional programming.

Thanks for the response, even if it's not what I was hoping to hear! The more I delve into the code of the game the more I feel like it could benefit from a complete re-working of the engine as a whole, made with good programming technique and some foresight. Probably never gonna happen, but a guy can dream.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...