Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an AutoPickUpZone to the player #340

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

OvercastInteractive
Copy link
Collaborator

  • Allows you to automatically pick up select items for whatever reason (frustrating, tedious, required, or to speed up the pace of the game) and may provide a smoother experience than only using the default raycasting + input interaction for every pick up.
  • Adds a pick up delay to cogito projectiles, so they aren't automatically picked up the moment they're fired.
  • Added laser ammo and foam bullets to the auto pick up list for testing.
  • It's slightly counter to immersive sim in theory, however I feel like there are enough use cases that it could at least be optional.

- Allows you to automatically pick up select items for whatever reason (frustrating, tedious, required, or to speed up the pace of the game) and may provide a smoother experience than only using the default raycasting + input interaction for every pick up
- Adds a pick up delay to cogito projectiles, so they aren't automatically picked up the moment they're fired
- Just added ammo to the auto pick up list as a test
@Phazorknight
Copy link
Owner

Oooh, this is cool.
I would've probably tried to add this to the PickupComponent, but I think your implementation actually has some advantages (better control over pickup range + ability to deactivate it for certain moments like cutscenes etc).

I had a weird issue and also a crash when testing this:

  1. Add some projectile_pistol to the Laboratory Demo scene and start the game in it.
  2. When walking up to it, for some reason, the projectile_pistol doesn't get picked up by the auto pickup.
  3. When I then walk over to the pickup_laser_ammo on the counter, the game crashes with an error:
player_hud_manager.gd:
Line 180: if node.is_disabled:

Invalid access to property or key is_disabled on a base object of type previously freed.

Seems like there might be a bit of a race condition problem with freeing up these nodes at times.

I've also tried to remove and re-add the projectiles from the auto pickup, but still wasn't able to get them to get picked up by it.
Was able to add the batteries to it and they worked fine.

@Phazorknight Phazorknight added the enhancement New feature or request label Nov 28, 2024
@OvercastInteractive
Copy link
Collaborator Author

Thanks for testing this out a a bit more! I'll look into the issues you've had and see if I can safeguard the implementation against these kinds of errors. It may be a day or two before I can do a once over on this tho.

I must have accidentally reset the collision layer and mask, which was likely what caused the issues. The zone mask should only detect interactables and ignore all collision detection.

Everything works normally on my end, so please let me know if you come across any more issues.
Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, gave this another test. Seems to be much improved! I wasn't able to replicate the errors I previously flagged, so happy to merge this in!

@OvercastInteractive OvercastInteractive merged commit 4c1df66 into main Dec 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants