Use To Pickup

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR 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.

Use To Pickup

Postby argv » Sat Jul 21, 2018 2:28 am

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.)
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby DabbingSquidward » Sat Jul 21, 2018 2:55 am

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.
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017
Location: Germany

Re: Use To Pickup

Postby argv » Sun Jul 22, 2018 3:15 am

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.
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby DabbingSquidward » Sun Jul 22, 2018 5:52 am

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 :-?
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017
Location: Germany

Re: Use To Pickup

Postby argv » Sun Jul 22, 2018 6:03 pm

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 allExpand view
[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 allExpand view
[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
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby argv » Sun Jul 22, 2018 6:06 pm

I don't touch the items' amounts. I just activate their on-touch behavior when you pick them up. Not my fault! :D
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby Ghost Prototype » Sun Jul 22, 2018 6:44 pm

This is amazing! May I include this in my mod? Credits and special thanks would be given to you 100%
User avatar
Ghost Prototype
Be the problems you want to see in the world
 
Joined: 19 May 2013
Location: Philadelphia

Re: Use To Pickup

Postby argv » Sun Jul 22, 2018 11:51 pm

Yes, yes you may!
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby DabbingSquidward » Fri Jul 27, 2018 4:21 pm

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.
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017
Location: Germany

Re: Use To Pickup

Postby argv » Fri Jul 27, 2018 8:56 pm

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.
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby DabbingSquidward » Sun Jul 29, 2018 1:16 am

When traveling between levels in a hub I get the error "multiple u2p_playerstate instances for player number 0! Deleting one of them."
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017
Location: Germany

Re: Use To Pickup

Postby argv » Mon Jul 30, 2018 2:49 pm

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!
argv
 
Joined: 30 Aug 2016

Re: Use To Pickup

Postby ramon.dexter » Tue Jul 31, 2018 7:53 am

Hi, it still ignores one-sided lindefs. I can still pick up items through wall.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Use To Pickup

Postby DabbingSquidward » Tue Jul 31, 2018 9:00 am

Could you remove the "on-touch pickup" delay for items with AlwaysTouchPickup?
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017
Location: Germany

Re: Use To Pickup

Postby argv » Wed Aug 01, 2018 2:12 am

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.
argv
 
Joined: 30 Aug 2016

Next

Return to Gameplay Mods

Who is online

Users browsing this forum: Ali, Cherno, MrRumbleRoses, Semrush [Bot], Simple Pie [RSS], Turin Turambar and 12 guests