INVENTORY.AUTOSELECT

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

Moderator: GZDoom Developers

INVENTORY.AUTOSELECT

Postby Zan » Thu Nov 07, 2019 2:16 pm

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!
User avatar
Zan
 
Joined: 22 Oct 2016
Location: The depths of Hedon.
Discord: Zan#0149

Re: INVENTORY.AUTOSELECT

Postby Gez » Thu Nov 07, 2019 4:37 pm

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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: INVENTORY.AUTOSELECT

Postby Cherno » Thu Nov 07, 2019 4:46 pm

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
Cherno
 
Joined: 06 Dec 2016

Re: INVENTORY.AUTOSELECT

Postby Matt » Thu Nov 07, 2019 8:26 pm

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
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest