Factorio-Access / FactorioAccess

An accessibility mod for the video game Factorio, making the game accessible to the blind and visually impaired.
Other
16 stars 8 forks source link

Insufficient reporting of equipped firearms #197

Open DoctorBoomstick opened 1 week ago

DoctorBoomstick commented 1 week ago

1. Describe the bug

|I’m unaware if this is a mod-specific bug, however, in some hours of searching I’ve found no where mentioning such an issue in vanilla Factorio. Essentially, when I first craft a weapon, in my case either the shotgun or submachine gun, either of these weapons fails to show up within the inventory at all. If I then craft multiples of these guns, for example, three submachine guns, I can see them in my inventory; however, taking them in my hand one at a time and pressing shift [ causes the gun to vanish into the shadow realm] and for nothing to be added to my equipment.

2. Steps to Reproduce

3. Expected correct behavior

I expect that guns do not blast off into space before I can build a rocket myself.

4. Mod version

0.12

5. Additional context

This might also be an issue with armour, however I have been unable to verify if this is the case.

LevFendi commented 1 week ago

Hello and thank you for this report. Unless something has changed, this issue stems from an information bug, and we should indeed take steps to improve things.

The character has 3 weapon slots and 3 ammo slots, with the pistol taking slot 1 by default. Weapons that you craft are automatically equipped into the empty slots. However, a weapon cannot be selected unless you have ammo for it equipped as well.

This is further mixed up by the SMG and pistol using the same ammo type.

Your best bet is to unequip all weapons to see if they pop up in the inventory. Then equip the weapon and ammo if your choice.

DoctorBoomstick commented 1 week ago

Thankyou for the swift follow up. Indeed, after crafting a shotgun and related shotgun shells, and equipping said shells, the weapon has appeared in the inventory. However, all firearm magazines stack with the pistol’s ammunition pool, which makes the submachine gun unable to be equipped. I suspect this would be resolved if I simply crafted enough firearm magazines to reach the limit of ammo reserves available for each weapon. I have not come across a way to unequip weapons, like the pistol.

LevFendi commented 1 week ago

You can open the inventory and unequip all weapons with CTRL + SHIFT + R.

More controls here:

https://github.com/Factorio-Access/FactorioAccess?tab=readme-ov-file#guns-and-armor-equipment

ahicks92 commented 1 week ago

Weapons shouldn't need ammo to be equippable, as far as I know.

The ammo stacking and the thing where ammo feeds directly into the guns when crafted are both vanilla, or so I have been told.

EphDoering commented 1 week ago

Just gonna describe vanilla behavior. Each character has weapon inventory slots. Each weapon inventory slot has a corresponding ammo inventory slot. Smart inserted Guns and ammo are automatically placed into the first compatible of those slots, or into your inventory if no compatible slots are available. For this purpose empty ammo slots are considered compatible with any gun, but empty gun slots are not considered compatible with any ammo (even if that ammo type is already there). The results of crafting are smart inserted, but so are things grabbed from chests etc. with control click, or, annoying, when shift clicking from your inventory when you have a turret open, it'll also put it into your character's ammo slot with priority,

The weapon that will fire if it has ammo is controlled by the selected gun index by the api. In the gui, the selected weapon and ammo are highlighted green if the weapon has ammo and red if no ammo. The only way to change the selected weapon in vanilla is with the tab key. When pressed, it will move to next weapon that has ammunition wrapping as appropriate. If there isn't one, then the selected gun index remains the same. If the selected weapon runs out of ammo, it will automatically attempt to restock itself with the same ammo from your inventory (I just learned this in my testing). If there is none, it will not change the selected index but will automatically switch to melee with your axe if you're "shooting enemies" as opposed to "shooting entities."

I think that about covers vanilla weapon inventory management.

In terms of api's me might be able to use to help with the confusion there's on_player_gun_inventory_changed and on_player_ammo_inventory changed, though the latter fires every time you finish a clip, so I'm not sure how to deal with that without being distracting in combat.

ahicks92 commented 6 days ago

We need to discuss earcons. I haven't yet open a ticket for it because we have way too much already. The idea is that for these cases where speech is obtrusive you play a sound, probably something quiet in this case, and then have a menu to let players learn them and toggle whether or not they also come with speech (we need them on e.g. terrain for similar but slightly different reasons).