Hello there,
I'd love to be able to create hud icons for my weapon costumes but the problem we currently have with mods that alter existing bitmap sheets is that they aren't compatible with one another. On my quest to create a weapon mod that reaches DLC quality I put some thought into this issue.
Through experimenting, I think I now understand how the game handles weapon icons: First, it takes a bitmap sheet (e.g. ui_bms_store_weapon_costumes.cvbm_pc), separates it into several bitmaps in a way specified in the corresponding *.xtbl (e.g. ui_bms_store_weapon_costumes.xtbl) and loads them into some sort of a bitmap pool. For every weapon costume the game fishes two bitmaps out again - one for the icon displayed in your on-foot-inventory and one for the icon displayed in shops (which is kind of confusing since those two icons are exactly the same). The two bitmaps in question have to follow a naming convention: the bitmap loaded for the store icon has to be named just like the other one but with an extra "_c".
Let's say I have an items_inventory.xtbl like this:
SR IV will now scan its bitmap pool for the two bitmaps called ui_hud_inv_s_melee_skateboard and ui_hud_inv_s_melee_skateboard_c. But how do we get those two icons in there? That's where it's getting interesting.
I propose the mod parsing code to look for custom bitmap sheets. For example, the algorithm could scan modded packfiles for *.cvbm_pc/*.gvbm_pc files with names starting with something like "mod_bms_" and load them in in case there's an *.xtbl named the same way. This *.xtbl would then contain information on how to separate the bitmap sheet into several bitmaps.
For example, let's assume the contents of my mod packfile looked like this:
Mod_bms_skateboard.cvbm_pc and mod_bms_skateboard.gvbm_pc would contain a bitmap sheet containing several weapon icons. The items_inventory.xtbl would look like the one above and mod_bms_skateboard.xtbl would look like this:
This way modders could easily load new ui elements into the bitmap pool without experiencing any incompatibilities.
I hope this proposal was somewhat understandable. Don't hesitate to ask questions if something is unclear. Thanks for reading!
I'd love to be able to create hud icons for my weapon costumes but the problem we currently have with mods that alter existing bitmap sheets is that they aren't compatible with one another. On my quest to create a weapon mod that reaches DLC quality I put some thought into this issue.
Through experimenting, I think I now understand how the game handles weapon icons: First, it takes a bitmap sheet (e.g. ui_bms_store_weapon_costumes.cvbm_pc), separates it into several bitmaps in a way specified in the corresponding *.xtbl (e.g. ui_bms_store_weapon_costumes.xtbl) and loads them into some sort of a bitmap pool. For every weapon costume the game fishes two bitmaps out again - one for the icon displayed in your on-foot-inventory and one for the icon displayed in shops (which is kind of confusing since those two icons are exactly the same). The two bitmaps in question have to follow a naming convention: the bitmap loaded for the store icon has to be named just like the other one but with an extra "_c".
Let's say I have an items_inventory.xtbl like this:
Code:
<root>
<Table>
<Inventory_Item>
<Name>baseball_skateboard</Name>
...
<Bitmap>ui_hud_inv_s_melee_skateboard</Bitmap>
...
</Inventory_Item>
</Table>
</root>
I propose the mod parsing code to look for custom bitmap sheets. For example, the algorithm could scan modded packfiles for *.cvbm_pc/*.gvbm_pc files with names starting with something like "mod_bms_" and load them in in case there's an *.xtbl named the same way. This *.xtbl would then contain information on how to separate the bitmap sheet into several bitmaps.
For example, let's assume the contents of my mod packfile looked like this:
mod_bms_skateboard.cvbm_pc
mod_bms_skateboard.gvbm_pc
mod_bms_skateboard.xtbl
items_inventory.xtbl
mod_bms_skateboard.gvbm_pc
mod_bms_skateboard.xtbl
items_inventory.xtbl
Mod_bms_skateboard.cvbm_pc and mod_bms_skateboard.gvbm_pc would contain a bitmap sheet containing several weapon icons. The items_inventory.xtbl would look like the one above and mod_bms_skateboard.xtbl would look like this:
Code:
<root>
<Table>
<BitmapSheets>
<Name>mod_bms_skateboard</Name>
<Images>
<Properties>
<Name>ui_hud_inv_s_melee_skateboard</Name>
<StartX>0</StartX>
<StartY>0</StartY>
<ImageWidth>200</ImageWidth>
<ImageHeight>200</ImageHeight>
</Properties>
<Properties>
<Name>ui_hud_inv_s_melee_skateboard_c</Name>
<StartX>0</StartX>
<StartY>0</StartY>
<ImageWidth>200</ImageWidth>
<ImageHeight>200</ImageHeight>
</Properties>
...
</Images>
</BitmapSheets>
</Table>
</root>
This way modders could easily load new ui elements into the bitmap pool without experiencing any incompatibilities.
I hope this proposal was somewhat understandable. Don't hesitate to ask questions if something is unclear. Thanks for reading!