Multiple INVBARs

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

Multiple INVBARs

Postby Mush256 » Sat Jun 18, 2022 5:31 pm

Hey, I'm pretty new to Decorate and just wanted to ask, is it possible to have more INVENTORY.INVBAR shown at the same time? I have two types of pickups in my mod but only the first one that is picked up shows up. I would like to have both of them on the screen at the same time, as shown on the image below.
You do not have the required permissions to view the files attached to this post.
User avatar
Mush256
 
Joined: 31 May 2022
Discord: Mush²#1447
Operating System: Windows 11
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Multiple INVBARs

Postby Jarewill » Sun Jun 19, 2022 9:58 am

There's no way to make a second inventory bar.
However you can create a custom status bar that will display both items separately.

There's two ways to do this:
1) Using SBARINFO you can modify the default status bar to add another number display using DrawNumber. (Due to limitations, DrawNumber can only display Ammo-based items)
2) The better option is to use ZScript to modify the default status bar (found in gzdoom.pk3:zscript/ui/statusbar/doom_sbar.zs) using FindInventory and DrawString, for example:
Code: Select allExpand view
let itm = CPlayer.mo.FindInventory("ItemToDisplay");
If(
itm){
    DrawImage("SPRITE", (X, Y));
    DrawString(mSmallFont, FormatNumber(itm.Amount, 1, 3), (X, Y));
}
//Example code, will need tweaking  
Jarewill
 
Joined: 21 Jul 2019

Re: Multiple INVBARs

Postby Mush256 » Tue Jun 21, 2022 3:29 pm

Okay, thank you!
User avatar
Mush256
 
Joined: 31 May 2022
Discord: Mush²#1447
Operating System: Windows 11
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: ATI/AMD with Vulkan Support


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest