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

Candles, lighters, and inhalers not spawning with random charges anymore. #44071

Closed
UndeadMoose opened this issue Sep 9, 2020 · 7 comments
Closed
Labels
<Bug> This needs to be fixed Spawn Creatures, items, vehicles, locations appearing on map
Milestone

Comments

@UndeadMoose
Copy link

Describe the solution you'd like

Having candles, lighters, inhalers, matchbooks, and other items have random charges again.

Describe alternatives you've considered

Leaving them how they are in a black and white phase of either having a full charge or no charge whatsoever.

Additional context

Seems odd that items are no longer spawning with random charges anymore. Wasn't sure if I should have put this as a bug report because I vaguely remember a PR getting merged (for lighters and candles) that made it so that items are either black and white with their charges (either 0/100 or 100/100). This also had the effect of making an asthmatic character slightly harder to play due to having full inhalers spawn at such a low rate. Seems weird from a realism perspective that there is no variation with charges on some of these items either.

@anothersimulacrum anothersimulacrum added the <Bug> This needs to be fixed label Sep 9, 2020
@anothersimulacrum anothersimulacrum added this to the 0.F milestone Sep 9, 2020
@Tamiore
Copy link
Contributor

Tamiore commented Sep 9, 2020

Somewhat related, it's probably important to make sure that the solution to this shouldn't effect player's starting inventory, or at least shouldn't effect it as strongly.
I.e. if you start with inhaler (as an asthmatic), you should never randomly start with zero (or next to zero) charges left.

@wapcaplet
Copy link
Contributor

wapcaplet commented Sep 10, 2020

Most items appear to be working correctly in 0.E-5845-g5247a5f3ee. Inhalers and lighters I am not sure about, but all the others you mention (and more) are spawning with random charges in my testing.

Visiting random house kitchens, I find candles, matchbooks, and markers are definitely getting random charges:
image
image

Batteries and electronic devices are as well:
image
image
image

All the lighters I have seen so far were either full or empty, and the same for inhalers (4 empty, 1 full). Possibly I have not looked hard enough yet.
image
image
image
image

@UndeadMoose
Copy link
Author

UndeadMoose commented Sep 11, 2020

I'm trying the most current build and it looks like like random charges started appearing again. I'm not sure if something changed but I'm even seeing candles, lighters, and inhalers with random charges again. In earlier builds most items would either be empty or full. The only exception were guns.

It still looks like lighters/refillable lighters namely that are zombie loot are still spawning with either 0/100 charge or 100/100 charges. Everything else looks to be fixed.

@UndeadMoose
Copy link
Author

I have also tried checking for items with charges that may do this.

  • Spray cans like lighters are either spawning with empty or full charges
  • Voltmeters are spawning with no batteries

Ill keep a lookout for anymore and add to the list.

@esotericist esotericist added the Spawn Creatures, items, vehicles, locations appearing on map label Oct 1, 2020
@cwilkinson6
Copy link

I think this is because of item group entries lacking both the "charges-min" and "charges-max" properties. I haven't managed to track down where in the C++ code this is handled, but it's pretty easily verifiable through inhalers. Every possible spawn for them where those properties are not defined results in empty inhalers, but the one spawn where those are defined (inside of house bathrooms) results in inhalers with proper amounts of albuterol. It looks like there are two solutions to this: add those properties to every single appropriate item spawn or adjust the code that checks for those properties.

@KorGgenT
Copy link
Member

KorGgenT commented Dec 4, 2020

according to the comment from undeadmoose on sept 10th, this issue is solved already. please let me know if i'm closing this in error.

@KorGgenT KorGgenT closed this as completed Dec 4, 2020
@casswedson
Copy link
Contributor

I was under the impression that this issue refers to most item spawn, items spawning with the same amount of charges or without charges or magazines etc thus my interest in adding more randomization to items/itemgroups, see #44713 #44654 #44629 #44592 #44554 there are still some places where items still spawn empty and/or full always, not sure if this is a good enough argument to keep this issue open but I wanted to finish this branch https://github.com/casswedson/Cataclysm-DDA/tree/more-rando basically the same as the other pull request I mentioned, but a bit bigger, that will fix some charge/magazine issues, npc inventories, and other misc things I felt this issue refers to, such as the warehouse at the military base always spawning tons of empty batteries.

milbase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

No branches or pull requests

8 participants