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!
INVENTORY.AUTOSELECT
Moderator: GZDoom Developers
Re: INVENTORY.AUTOSELECT
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.
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.
Re: INVENTORY.AUTOSELECT
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.
- 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
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.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.
- 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
Should this be closed?
