Frame challenge.
You won't.
A weapon is a tool. But a military weapon is a tool that must meet a bunch of criteria based on context.
For example biggest trigger guards to accommodate winter gloves in certain rifles because the country is mostly snow.
Another one is a certain paint color that reduces the heating of the metal of the gun so that accuracy is not affected. I'm not sure about the actual technical terms but you get the image.
However if you remember than scene in the Dark Knight where Fox is telling Bruce Wayne that the government did not want to spend thousands of dollars on a single soldier's armor.
Well. This is another big consideration that you have to think of.
The fact that adding even a forward assist on a gun increases cost. And when you are making 12 million copies the budget, oh the dreaded budget, is blown away.
So adding the simplest mechanical thing increases budget.
Not to mention the cost to actual benefits.
Say rifle A costs 1000 dollars and have an overall score of 131 points.
Rifle B costs 800 dollars and have an overall score of 125 points.
Well. Guess which rifled is going to be picked by every single nation?
The points here is like an arbitrary measure of all major consideration for a rifle and not a real thing. Just to demonstrate my point.
Anyway now that the budget part is over her is another consideration.
Weapons are tools. You want the simplest and easiest and most functional one possible.
If you know or read about soldiers then... Let's just say that complication and warfare don't go hand in hand.
The great Moltke said something to the effect of "no plan survives contact with the enemy"
And Sun Tzu before him does even like complicated operation and theory while Clausewitz likes to ground war in reality and throws the abstract out the window.
This is theory of war true. Not addressing the issue?
But it does. If even the theory stresses throwing abstraction out the window then won't the actual tools reflect that?
Basically you want your weapons to be as simple as hammer.
Simplicity = efficiency.
Time and time again Occam's razor proves to be useful in all fields.
Now this is a lot of rhetoric and sorry.
Just trying to paint the whole picture.
So the actual weapons should work 100% of the time in the hand of 100% of your soldiers with as few problems and complications as possible.
Think of the times in history where they armed civilians, slaves, freedmen, women, and even children.
Do you want a gun that asks 13 questions before it fires?
All this just makes the idea of guns having anything complicated stupid.
That's why to this day you don't see a lot of "smart" safety on guns.
This is a huge contradiction to the very idea of weapons.
Not to mention a host of complications in the actual world.
- Ammo and ammo types?
- What if my squad mate died and I ran out of ammo? Do I have to go through a test to fire at the enemy?
- What if the soldier in question has PTSD?
- What if a soldier character changes?
- What if a soldier expresses an idea against the sentient's philosophy?
- What if a soldier jokes about something.
- What if I'm bluffing on murdering a civilian, or whatever?
- What if I'm in the middle of a firefight and aim at a civilian?
- What if I have to kill a civilian?
- What if the firearm changes ideologies or have a change of heart?
- What about hacking?
- What about mood swings or just that gun waking up feeling like hell?
- What of corruption?
There is actually that sentient sword from Dave the Barbarian and it actually works against him sometimes.
Honestly I can think of nothing but complications for creating anything like that.
Like it is a really bad idea to do so.
But.
You can overcome most of this by doing something similar to Mjolnir.
This is the only logical way I can think of.
Creating artifacts of such immense power that a single person can cause so much trouble that the original creator thought that they must find a way to only give it to those who are worthy.
The reasoning for the creation of the weapons can be frost gains or dragons or evil cheese wheels for all it matters.
So the only time it makes sense if it the magical equivalent to nuclear football, case which the US president can use to launch nukes, and so the creators had to include purity checks or whatever you want.
Warhammer 40K has good examples of both actually. The grounded realistic war of attrition that the guards fight or the high power high artifacts style of warfare that certain factions fight.
For example a super advanced robot wielding melee weapons exist while gun lines and trenches exist.
But Warhammer 40K got insane technology and a lot of magic. Take the magic away and you just have the same ideas, most of the time.
However. In a science fiction setting or any setting where magic does not exist and combat is similar to ours.
it makes 0 sense and will never be used by any reasonable faction.