Use To Pickup

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Use To Pickup

Post by argv »

Like the name suggests, this mod changes how players pick up items. Instead of picking them up by touching them, one must aim at the item and press the Use button to pick it up. Now you won't accidentally pick up that blue armor when yours is only down to 198%!

Also, this mod shows neat-looking brackets around the item, and its name.

Check it out on GitHub and download the latest pk3. (GitHub zips are directly loadable by GZDoom.)
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Use To Pickup

Post by StroggVorbis »

Just a minor cosmetic bug: dropping a weapon and looking at it will not fully display the "Pick Up" prompt, only "Pick" or "Pick U".

Instantly put this in my autoload and bound a key to "toggle usetopickup_enabled" :p

I'd like to suggest the option to mark/flag the item you're currently looking at for picking it up always or not, basically a selective usetopickup, for example in Golden Souls if you don't wanna waste ammo but also don't want to pick up all the coins one at a time :)

Edit: Also the option to "remove/activate" the thing you're looking at, for example in maps where a script is tied to an item, but you can't pick it up because you already have the maximum amount or you're not the corresponding class.

And an option to display how much health/armor/ammo this item grants or if like in the above examples any scripts or specials are tied to it.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

DabbingSquidward wrote:Just a minor cosmetic bug: dropping a weapon and looking at it will not fully display the "Pick Up" prompt, only "Pick" or "Pick U".
Fixed.
Instantly put this in my autoload and bound a key to "toggle usetopickup_enabled" :p
Added that to the menus.
I'd like to suggest the option to mark/flag the item you're currently looking at for picking it up always or not, basically a selective usetopickup, for example in Golden Souls if you don't wanna waste ammo but also don't want to pick up all the coins one at a time :)
Done. You can now place that information into a file “UseToPickup.ini”, load it into the engine (by loading the folder it's in, or wrapping it in a pk3), and U2P will use it. See documentation.
Edit: Also the option to "remove/activate" the thing you're looking at, for example in maps where a script is tied to an item, but you can't pick it up because you already have the maximum amount or you're not the corresponding class.
Fixing bugs in other people's maps is kind of out of scope for this mod. :P
And an option to display how much health/armor/ammo this item grants
Hmm… That can be done for simple cases, but it'll be wrong if the item has any sort of special behavior, such as health items that give you full health no matter what your max health is, or ammo items that only give you as much ammo as you can carry and leave the rest on the floor.
or if like in the above examples any scripts or specials are tied to it.
I guess I could have it show that there is a map special attached, but there's no way to tell if any event listeners will react to picking it up, what exactly will happen, etc.
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Use To Pickup

Post by StroggVorbis »

Just tried the latest version with AlwaysTouchPickup, had to rename Coin to Coin_Pickup though. While it does work, the pick up distance is shorter than with the mod disabled, e.g. less distance between you and the item in question is required to grab it. In fact, if I run fast enough, I can move over it without getting it.

Edit: Don't know if it's because I played on an older savegame which had the previous version, but some ammo pickups now give double the amounts :-?
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

You don't have to change the original INI! Make a new folder, put a file in it named “UseToPickup.ini”, and write this into it:

Code: Select all

[Coin_Pickup+]
AlwaysTouchPickup=yes
Then load that folder into GZDoom, along with the rest of the mods.

If you want that to not apply to subclasses of Coin_Pickup, write this instead:

Code: Select all

[Coin_Pickup]
AlwaysTouchPickup=yes
Notice no + after the class name. You can also put a - after the class name to make settings apply to all superclasses.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

I don't touch the items' amounts. I just activate their on-touch behavior when you pick them up. Not my fault! :D
User avatar
Ghost Prototype
Posts: 185
Joined: Sun May 19, 2013 12:22 pm
Location: Philadelphia

Re: Use To Pickup

Post by Ghost Prototype »

This is amazing! May I include this in my mod? Credits and special thanks would be given to you 100%
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

Yes, yes you may!
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Use To Pickup

Post by StroggVorbis »

I haven't found a way to reliably trigger it, seems to happen at random, but as mentioned earlier sometimes pickups are worth double. Probably the item in question isn't always removed after getting its contents so they are given again.
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

Well, one possibility came to mind: the on-touch behavior isn't supposed to trigger if the item is not marked as being pick-up-able (the SPECIAL flag), and my code wasn't always checking that before calling the touch routine again.

I just pushed out a change such that the code will check that flag first. This may or may not fix the double ammo issue. Give it a try, and let me know if it happens again. :)

In other news: you can now customize the color and opacity of the brackets and labels.
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Use To Pickup

Post by StroggVorbis »

When traveling between levels in a hub I get the error "multiple u2p_playerstate instances for player number 0! Deleting one of them."
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

DabbingSquidward wrote:When traveling between levels in a hub I get the error "multiple u2p_playerstate instances for player number 0! Deleting one of them."
Fixed!
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Use To Pickup

Post by ramon.dexter »

Hi, it still ignores one-sided lindefs. I can still pick up items through wall.
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Use To Pickup

Post by StroggVorbis »

Could you remove the "on-touch pickup" delay for items with AlwaysTouchPickup?
argv
Posts: 184
Joined: Tue Aug 30, 2016 4:47 pm

Re: Use To Pickup

Post by argv »

ramon.dexter wrote:Hi, it still ignores one-sided lindefs. I can still pick up items through wall.
I forgot to check if a line in the way is one-sided! Whoops. Pushed out a fix.
DabbingSquidward wrote:Could you remove the "on-touch pickup" delay for items with AlwaysTouchPickup?
The pickup delay doesn't apply to AlwaysTouchPickup items. The delay, rather, was the result of the mod only scanning for items to pick up (by touch or otherwise) once every 4 tics.

I've changed this to be configurable. By default, it now scans (and picks up AlwaysTouchPickup items) on every tic, rather than every 4 tics. This imposes a performance hit, though, especially in multiplayer, so there is now an option in the menu to change that.

Return to “Gameplay Mods”