Some kind of second inventory, in a way?

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!)
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Some kind of second inventory, in a way?

Post by NeoTerraNova »

Greetings, all. I hope you're doing well this summer.

In my adventures with ZScript, I've managed to implement a lot of things I've wanted - new weapons, armor, and most especially, equipment. This is where I've hit a snag. I have multiple pieces of equipment available to the Player, including but not limited to three types of Tactical Vest, several types of weapon holsters for different parts of the body, and so on. When the number of "Slots" was just a couple, it wasn't an issue to simply assign a Drop command to a key press. Now that I'm up to four "Slots" of equipment, and looking at ending with 5 or 6, I would like something more efficient, so the Player doesn't have to map six keys to drop Equipment, and remember those on top of everything else.

Problem is, I have no idea where to begin.

What I would like to do is have some kind of "second inventory" (though I'm sure that's not the right term to use, here), where the Player can scroll through the available, discardable Gear they have equipped with a key press, select the one they want to drop, and press a key (or click on it or something) to discard it, so they can pick up something else they see, similar to how the native Inventory system works.

Barring that, I'm wondering if it's possible to make a full and complete "item screen" of sorts? Where all items, both "regular consumables," and equipment, would be listed, and can be individually selected, used on the spot, or discarded. Ideally, this "Item Screen" would pause the game when brought up. I've seen a Mod do something like this before, but I can't recall the name, and I have no idea how that might work.

I do already make use of the native Inventory system to allow the Player to carry some things like RadSuits, health items, and the like. This is already pretty crowded, so, I don't think adding more to it would work from a gameplay perspective.

Any assistance would be greatly appreciated, and I thank everyone that stops by to help.
User avatar
Enjay
 
 
Posts: 26403
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Some kind of second inventory, in a way?

Post by Enjay »

I wonder if, perhaps, you could somehow use some elements from the excellent Weapon Gearbox and hook them into specific inventory slots so that activating the inventory item brings up an appropriate gearbox?
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Some kind of second inventory, in a way?

Post by NeoTerraNova »

While that wasn't the Mod I was thinking of when I wrote my Post, that Mod looks interesting. I'll have to check it out. Thank you so much!

In the meantime, if anyone else has any ideas, I'm open to any suggestions. Thanks to everyone that stops by.

EDIT: PyWheel was the Mod I was thinking of in the first place, it turns out. Thanks again!

EDIT-EDIT: The "Weapon GearBox" code is WAY beyond my capability of understanding. I sat a bit and tried to comb through it.. and I realized how little I actually know about ZScript. Major props to 'm8f' - that's a whopper of a code chunk. And it's pretty neat, too. Still, thank you for the suggestion.

Return to “Scripting”