INVENTORY.AUTOSELECT

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Zan
Posts: 338
Joined: Sat Oct 22, 2016 12:43 pm
Location: The depths of Hedon.
Contact:

INVENTORY.AUTOSELECT

Post by Zan »

Hello, I'd like to suggest an inventory flag that allows certain items to be auto selected in the inventory bar when picked up. I think this is feasible, right?

Thanks!
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: INVENTORY.AUTOSELECT

Post by Gez »

The issue here is that the gamesim has absolutely no awareness of the UI, and "selected inventory item" is a purely UI-side concept.

When you use an item, the UI doesn't tell the gamesim "player used selected item", it tells it "player used item X", and there's no difference whether it's by selecting the item and hitting the use key, or it's by a command for directly using that item, like the backspace key for using a tome of power in Heretic.
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

Re: INVENTORY.AUTOSELECT

Post by Cherno »

Could be done in zScript directly in the relevant function that checks if an item is picked up and added to the actor. Simply check for the flag, and if the new owner is a PlayerBase, and set InvSel (or whatever the var is called) to the item if it's not already in the inventory.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: INVENTORY.AUTOSELECT

Post by Matt »

Cherno wrote:Could be done in zScript directly in the relevant function that checks if an item is picked up and added to the actor. Simply check for the flag, and if the new owner is a PlayerBase, and set InvSel (or whatever the var is called) to the item if it's not already in the inventory.
Sounds about right, but how likely is this to desync something? It looks like there should be no reason why it would desync but I figured I'd ask anyway since I'm in the middle of yet another unsolvable-looks-perfectly-deterministic-but-desyncs-anyway impasse elsehwere.
User avatar
phantombeta
Posts: 2188
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: INVENTORY.AUTOSELECT

Post by phantombeta »

Should this be closed?
Post Reply

Return to “Feature Suggestions [GZDoom]”