Well, as I said somewhere previously, during reloading, everything seems fine ! Attachments are put where they should, and magazine isn't floating anymore ( well, that may due to the fact that i'm reloading it :D ). So if your unhidevalue is somewhat related to the reloading, or it doesn't apply only when reloading. This could be this. You should dig in about difference between reloading and not because something is clearly "changing" during this phase of the weapon. Very good luck mate !
EDIT : btw ! no offense taken ;) I can completely understand your frustration ^^
EDIT2 : Dude... I'm so lost. Started the game again, and right now the weapon shows perfectly fine. I didn't change any mod since. I'm using the mod with the -mod command in launching parameters. And I don't get at all why this is so random ...
EDIT3 : I may have a solid repro of the bug...
---------- Post added at 03:59 AM ---------- Previous post was at 03:24 AM ----------
Okay !! So... After almost an hour to try to find what's going wrong. I think I found something. Still it's weird :
If I try your weapon for the very first time ( at each launch of the game ), on a custom map with a crate that use the fillcrate script that can be found somewhere around here. Weapon goes nuts.
If I try your wepaon with only my custom initiliazed man, or with your colt crate. It works.
Now it gets more complicated...
Once I tried it the very first time under those "safe" conditions. I can load my custom map with the fillcrate script, launch the game, and everything works well.
My two cents ? I think this is something between the fillcrate script, and your texture cannot load error. Because this popup message only happen the very first time you try your weapon. So if you have a fix for this message, this could get rid of this.
Obviously, this is pure speculation and i'm absolutely not sure that this is the real issue. Will investigate a little more tomorrow.
EDIT 5 : hmmm seems even more complicated in fact ! This issue is not due to the fillcrate.sqf script. It seems to happen if you initialize your weapon with other custom made soldiers on the map. with custom attachments and all. As I stated earlier. If you start the very first time alone and let the error popup goes, everything seems to go smooth afterwards whereas.. In the inverse situation... If you intialize your weapon on a "bad" situation, it'll stay like this for all the game.
To conclude for real this time for tonight. I'd suggest you to make your player with your M4 by adding its equipement on the init line. AND, make other soldiers having others weapons and attachments ( maybe having the same attachment as yours is the issue ? ) and try it yourself. Note that you have to do this for the very first time you launch the game !!
On a positive note, if you have solved the error popup issue, I can gladly test if it automaticaly solves this issue with my mission that tends to make it easily reproducable :)