Skip to content

[Mod] Multi-portrait mod - BG - SoD - BG2 - IWD - WeiDU installation

BillyYankBillyYank Member Posts: 2,768
edited December 2017 in UI Modding
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 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


  • Mr2150Mr2150 Member Posts: 1,170
    It looks really good... I really like the portrait layout like that. It's nice and clean, but also familiar as an album of pictures.

    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 ?
  • moody_magemoody_mage Member Posts: 2,054
    Are you able to display the file name for each portrait (maybe on mouseover)?
  • BillyYankBillyYank Member Posts: 2,768
    edited May 2016
    @Mr2150 To page through, I'd have to get all the portraits into the array. When I tried that with 480 portraits, it took so long I thought I'd crashed the game. I might be able to put in a button that skips forward 5 pages. I'll have to test to see how much faster it is to increment without getting.
    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.
  • DeeDee Member Posts: 10,447
    @BillyYank if there's a way to do it in Lua, you can add the function to an M_*.lua file and reference it in I'm not a programmer myself so I couldn't tell you how, but anything you can do with Lua, you should be able to do here.
  • Mr2150Mr2150 Member Posts: 1,170
    @BillyYank for the filename I've been using the name in BGEE.lua with L added to the end.
  • BillyYankBillyYank Member Posts: 2,768
    @Dee , then who should I hint? I'm not shy. >:)
    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 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.
  • Mr2150Mr2150 Member Posts: 1,170
    I just sent you some code on how I've been doing it...

    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.
  • GynsburgheGynsburghe Member Posts: 60
    I look forward to this! The new portrait chooser is downright painful with 700... I pared it down to like a 100-150, but if your portrait is alphabetically in the middle...
  • BillyYankBillyYank Member Posts: 2,768
    edited May 2016
    @decado , @Mr2150 discovered that the GetCurrentPortrait function does return an object that contains the filename, so I will be putting the filenames with the pictures.

    @Zach_BD , how do I set up console output?
  • smeagolheartsmeagolheart Member Posts: 7,963
    BillyYank said:

    @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
    (based on this:

    and while the commands weren't rejected, they didn't seem to do anything - I could find no log.txt file...

  • AncientCowboyAncientCowboy Member Posts: 199
    @smeagolheart siegeofdragonsphere 2>log.txt from the command prompt will do the trick
  • Zach_BDZach_BD Member Posts: 9

    @smeagolheart siegeofdragonsphere 2>log.txt from the command prompt will do the trick

    This is correct. It outputs to stderr so you need to use 2> instead of >

    Also worth noting you might not see any output in your file until you exit the game.
  • BillyYankBillyYank Member Posts: 2,768
    Check the OP for the beta release of this mod. Please give it a try and let me know what you think.
  • smeagolheartsmeagolheart Member Posts: 7,963
    really easy to do, and don't have to mess with a extra lua file specifying all the files right? Seems great...

    I'd like there to show a full size of the current selected portrait somewhere, but it's okay as is for sure.

  • Mr2150Mr2150 Member Posts: 1,170
    @BillyYank - it looks great.

    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...!
  • PeccaPecca Member Posts: 2,030
    If you want, you can use the graphics from my mod for your name button. It's the "RGSTBT.BAM" and "MOS3005.PVRZ" files.

  • BillyYankBillyYank Member Posts: 2,768
    @smeagolheart - I thought about adding a full size preview, but decided it would take up too much real-estate.

    @Mr2150 - Thanks for your advice and for testing the unregistered portraits.

    @Pecca - Thank you, I'll try that out.
  • BillyYankBillyYank Member Posts: 2,768
    I just tested this in SOD 2.3, and it still works. The graphics for the BG II version are coming along, but I haven't had as much time to work on them as I would have liked.
  • BillyYankBillyYank Member Posts: 2,768
    Well, looky what I've got here:

    Check out the OP for download and install instructions.
  • BillyYankBillyYank Member Posts: 2,768
    I updated the BGII version so it's easier to install.
  • psycrospsycros Member Posts: 34
    I don't have an override folder..I assume if you've got a clean install of BGEE you need to create it. However, I also can't find UI.MENU anywhere in my BGEE folder tree. I've got v2.x, GoG version.
  • BillyYankBillyYank Member Posts: 2,768
    Download Near Infinity and extract the into your override folder.

    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 in the SOD DLC zip.
  • BillyYankBillyYank Member Posts: 2,768
    Coming soon.

    It's mostly done, I just need to get everything lined up. I'll probably release it tonight or tomorrow.
  • BillyYankBillyYank Member Posts: 2,768
    The BG version of this mod is done. See the OP for download and installation instructions.


  • AncientCowboyAncientCowboy Member Posts: 199
    @BillyYank - May I include this mod in EEUITweaks? Thanks.
  • BillyYankBillyYank Member Posts: 2,768
    Yes, that would be great.
  • AncientCowboyAncientCowboy Member Posts: 199
    Thanks! Planned for the next update.
Sign In or Register to comment.