Help w/ Modded Gun Calibers

So I’ve been learning how to make modded content in Unturned and so far I’ve got a gun and a magazine. The issue I’m having mainly pertains to the gun as it’s suppose to only accept it’s own magazine, nothing else, while also accepting military barrel attachments. I’ve looked into the .dat files to see what allows guns to take certain attachments and so far it seems like the barrels themselves have a preselected list of calibers that they work with, meaning the only way that I can get my desired results is by reusing a caliber already in use by another weapon, which will force my gun to use more than it’s intended magazine (ie Avenger mag, Cobra mag, etc)

Is there a way to allow my gun to use military barrels without reusing occupied calibers?

You should refer to our official documentation, linked to from in-game. Specifically, you’ll want to look at the Calibers section of ItemGunAssets.

The TL;DR is that there’s separate caliber properties for hook attachments and magazines attachments.

Depending on what you’re trying to do, you may also use Requires_NonZero_Attachment_Caliber. But I don’t believe you’re doing anything that would need this.

1 Like

I didn’t even know this existed, thank you this helps a ton.

Another issue I’m having is for some reason despite repositioning the Icon in Unity multiple times, altering the Size_Z in the .dat, and making sure that my changes are being saved and overriding the prefab, the icon for this magazine will not zoom out whatsoever. It’s been stuck in this exact position throughout all my changes, minus the ability to rotate it.

Double-check your camera’s settings in Unity. Make sure your collision box for the item is the correct/desired size (e.g., perhaps you have it much smaller than intended).

Aside from that, you can use Use_Auto_Icon_Measurements false. Some curated/modded content will set this to false so that they can show the icon at an angle. OR in the case of official content, some things don’t have a collision/clip for whatever reasoning, and so the automatic icon measurement doesn’t look right and it needs to be done manually.

1 Like

Use_Auto_Icon_Measurements false did the trick, thanks again.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.