[Mod] Multi-portrait mod - BG - SoD - BG2 - IWD - WeiDU installation
BillyYank
Member Posts: 2,768
This mod replaces the standard, one picture at a time, portrait chooser with a screen that shows 10 pictures at a time. The mod is also a part of AncientCowboy's EE UI Tweaks. I took AC's WeiDU code and edited it down to make a WeiDU script to install my mod as a standalone.
BG screenshot:
BGII screenshot:
SoD screenshot:
IWD screenshot:
Installation instructions:
Download the zip file attached to this post and unzip it into your game folder (the one with chitin.key in it).
If you don't have UI.menu in your override already, extract it with Near Infinity.
Run setup-BYMultiPort.exe and follow the instructions like any WeiDU mod.
Now, start the game and you have your new portrait chooser.
In the portrait screen, you can click on the portrait or the button underneath to choose the portrait. The smaller arrows move forward or backward one screen, while the big arrows move forward or back five screens (50 portraits). The portraits wrap around just like the standard chooser does.
This is fully functional and should be able to handle any number of portraits.
Comments and suggestions welcome.
BG screenshot:
BGII screenshot:
SoD screenshot:
IWD screenshot:
Installation instructions:
Download the zip file attached to this post and unzip it into your game folder (the one with chitin.key in it).
If you don't have UI.menu in your override already, extract it with Near Infinity.
Run setup-BYMultiPort.exe and follow the instructions like any WeiDU mod.
Now, start the game and you have your new portrait chooser.
In the portrait screen, you can click on the portrait or the button underneath to choose the portrait. The smaller arrows move forward or backward one screen, while the big arrows move forward or back five screens (50 portraits). The portraits wrap around just like the standard chooser does.
This is fully functional and should be able to handle any number of portraits.
Comments and suggestions welcome.
Post edited by BillyYank on
21
Comments
It looks great and I can't wait to give it a whirl.
A few comments:
- I'd be interested to learn your experience with the Inc/Dec/Get functions as they frustrated me - hence going for a different approach.
- Adding an 'enabled' line with conditions to the frames will make them only appear if a portrait is inside the frame.
- If someone has a lot of portraits, you might want to consider numbering each page, a jump to page X edit box + button, and first/last page buttons, as well, if possible. You know, something that looks like:
|< < [Page 7 of 22] > >|
- I saw from one of your other posts that you have been editing BGEE.lua to gender split the portraits, are you aware of the functionality that @Dee posted about here ?
At the moment, the portrait frames are part of the background. I plan to make a more dynamic version in the future that will display a different number of portraits based on screen size, but I thought I'd keep it simple for my first attempt. There won't be any empty frames, though. The increment and decrement functions wrap around when they reach the end of the list.
@decado Right now, I don't know of a way to get the file name of a portrait. If Beamdog publishes some documentation of what functions are available for UI modding ( @Dee hint, hint), then that's something I definitely want to add.
You see, it's not so much what I can do with Lua as what Beamdog's code has implemented and exposed. For example, we know that the functions IncCurrentPortrait(), DecCurrentPortrait() and GetCurrentPortrait() can be used, but are there other functions that exist, but haven't been used in UI.menu? Is there a GetPortraitList(), GetPortraitByIndex(index), GetPortraitCount()? I could imagine that these or similar functions do exist in the code, because they might be useful in implementing the three functions we know about. Also, we don't really know anything about even the functions we can see. We know the object returned from GetCurrentPortrait() can be used as a bitmap, but is that all there is to it? It might be an object that contains a bitmap (or two) and the filename, size, position in portrait list, etc. Most likely, this documentation already exists somewhere in your company, since it's the kind of information your programmers would need to refer to. Unfortunately, it's most likely in a "don't show this to outsiders" state, someone would have to put in the hours to get it ready for release to the modding public. So I don't expect to see it anytime soon.
@Mr2150 , but how do I know which entry in BGEE.lua corresponds to portrait I'm looking at right now? Also, my mod should work with portraits that are not registered in the BGEE.lua.
I grab all the default portraits and then grab all my custom portraits (by having them registered in another M_*.lua file) and then insert both sets into a new table which is what I use for display purposes.
Depending on how you're using the Inc/Dec/Get functions you might need to play with the code but it should give you a few pointers.
print_r(_G)
This will output the global lua state table to the console, including every lua function.
@Zach_BD , how do I set up console output?
I ran siege from the command prompt, and it outputs all sorts of stuff. I did the print_r(_G) command and I think it echos all sorts of lua stuff but I can't find a way to save that info.
i tried siegeofdragonspear > log.txt and it was empty....
I also tried
C:LogMessages(1)
and
C:LogSet("log.txt")
(based on this: http://www.gemrb.org/iesdp/appendices/clua/bgee.htm)
and while the commands weren't rejected, they didn't seem to do anything - I could find no log.txt file...
Also worth noting you might not see any output in your file until you exit the game.
I'd like there to show a full size of the current selected portrait somewhere, but it's okay as is for sure.
I tried it with my portrait list (around 200 portraits now) and it was fast with unregistered portraits. I think I figured out why the deselect isn't working for you.
Great job...!
@Mr2150 - Thanks for your advice and for testing the unregistered portraits.
@Pecca - Thank you, I'll try that out.
I'm calling this done for now. My next step will be to create the graphics for BG1 and BG2. I'm going to try to be a clever little monkey and make the graphic elements match up exactly, so I can reuse the GUI code.
I've already made the BAM for the half-sized arrow buttons. Now I just need to make the filename button and I can start lining things up.
Check out the OP for download and install instructions.
https://forums.beamdog.com/discussion/30593/new-versions-of-nearinfinity-available/p1
You need to create the override folder in the install folder for your game. That's the one with the chitin.key file in it.
Also, it's probably best to run Modmerge first, I don't know if there's a separate UI.menu in the SOD DLC zip.
https://forums.beamdog.com/discussion/50441/modmerge-merge-your-steam-gog-zip-based-dlc-into-something-weidu-nearinfinity-dltcep-can-use/p1
It's mostly done, I just need to get everything lined up. I'll probably release it tonight or tomorrow.
Screenshot: