SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
83 stars 17 forks source link

Empty Magazines Unable to be Used in Blueprints #4448

Closed lucas4114 closed 2 weeks ago

lucas4114 commented 2 weeks ago

Magazine items are unable to be used in blueprints if their (ammo) amount is 0/1, despite the item(s) being present in the inventory.

What I did to produce this issue:

I changed Swissgewehr_20.dat to:

GUID 41bd2b68446e497caed8954aba3b8f9c
Type Magazine
Rarity Rare
ID 1490

Size_X 1
Size_Y 2
Size_Z 0.3

Amount 20
Count_Min 5
Count_Max 15

Calibers 1
Caliber_0 1

Tracer 48

Blueprints 5
Blueprint_0_Type Ammo
Blueprint_0_Supplies 1
Blueprint_0_Supply_0_ID 43
Blueprint_0_Build 30
Blueprint_1_Type Ammo
Blueprint_1_Supplies 1
Blueprint_1_Supply_0_ID 6
Blueprint_1_Build 30
Blueprint_2_Type Ammo
Blueprint_2_Supplies 1
Blueprint_2_Supply_0_ID 17
Blueprint_2_Build 30
Blueprint_3_Type Ammo
Blueprint_3_Supplies 1
Blueprint_3_Supply_0_ID 1490
Blueprint_3_Build 30

//Scrap
Blueprint_4_Type Gear
Blueprint_4_Supplies 1
Blueprint_4_Supply_0_ID 1490
Blueprint_4_Product 67
Blueprint_4_Products 1
Blueprint_4_Level 2
Blueprint_4_Skill Craft
Blueprint_4_Build 30

Paintable

Screenshots demonstrating the issue:

I maxed out my "Crafting" skill (just showing this step to confirm that I did it):

Img12

With empty magazines present in the inventory, the blueprint is unavailable:

Img1

Img2

Img3

If a magazine is full, then the blueprint works correctly for that item only:

Img4

Img5

If a magazine is partially full (ammo amount is > 0), then it also works normally for that item only:

Img7

Img6

...

Some things I tried to fix this:

  1. I tried changing Blueprint_#_Type Gear to Blueprint_#_Type Ammo
GUID 41bd2b68446e497caed8954aba3b8f9c
Type Magazine
Rarity Rare
ID 1490

Size_X 1
Size_Y 2
Size_Z 0.3

Amount 20
Count_Min 5
Count_Max 15

Calibers 1
Caliber_0 1

Tracer 48

Blueprints 5
Blueprint_0_Type Ammo
Blueprint_0_Supplies 1
Blueprint_0_Supply_0_ID 43
Blueprint_0_Build 30
Blueprint_1_Type Ammo
Blueprint_1_Supplies 1
Blueprint_1_Supply_0_ID 6
Blueprint_1_Build 30
Blueprint_2_Type Ammo
Blueprint_2_Supplies 1
Blueprint_2_Supply_0_ID 17
Blueprint_2_Build 30
Blueprint_3_Type Ammo
Blueprint_3_Supplies 1
Blueprint_3_Supply_0_ID 1490
Blueprint_3_Build 30

//Scrap
Blueprint_4_Type Ammo
Blueprint_4_Supplies 1
Blueprint_4_Supply_0_ID 1490
Blueprint_4_Product 67
Blueprint_4_Products 1
Blueprint_4_Level 2
Blueprint_4_Skill Craft
Blueprint_4_Build 30

Paintable

Result:

With only empty magazines in the inventory, the blueprint was unavailable.

Img8

With a magazine with > 0 ammo present in the inventory, the blueprint was available but didn't do anything when clicked (broken).

Img9

Img10

  1. I tried changing Blueprint_#_Type Gear to Blueprint_#_Type Tool
GUID 41bd2b68446e497caed8954aba3b8f9c
Type Magazine
Rarity Rare
ID 1490

Size_X 1
Size_Y 2
Size_Z 0.3

Amount 20
Count_Min 5
Count_Max 15

Calibers 1
Caliber_0 1

Tracer 48

Blueprints 5
Blueprint_0_Type Ammo
Blueprint_0_Supplies 1
Blueprint_0_Supply_0_ID 43
Blueprint_0_Build 30
Blueprint_1_Type Ammo
Blueprint_1_Supplies 1
Blueprint_1_Supply_0_ID 6
Blueprint_1_Build 30
Blueprint_2_Type Ammo
Blueprint_2_Supplies 1
Blueprint_2_Supply_0_ID 17
Blueprint_2_Build 30
Blueprint_3_Type Ammo
Blueprint_3_Supplies 1
Blueprint_3_Supply_0_ID 1490
Blueprint_3_Build 30

//Scrap
Blueprint_4_Type Tool
Blueprint_4_Supplies 1
Blueprint_4_Supply_0_ID 1490
Blueprint_4_Product 67
Blueprint_4_Products 1
Blueprint_4_Level 2
Blueprint_4_Skill Craft
Blueprint_4_Build 30

Paintable

Result:

Changing Blueprint_#_Type Gear to Blueprint_#_Type Tool has the same behaviour as as Blueprint_#_Type Gear, except the blueprint appears in the "Tools" crafting tab.

Magazines with 0 ammo amount can't be used in the blueprint. Magazines with > 0 ammo amount can be used in the blueprint.

  1. I tried removing Blueprint_#_Supplies and Blueprint_#_Supply_#_ID lines in hopes that the blueprint system would automatically use its own item as the supply.
GUID 41bd2b68446e497caed8954aba3b8f9c
Type Magazine
Rarity Rare
ID 1490

Size_X 1
Size_Y 2
Size_Z 0.3

Amount 20
Count_Min 5
Count_Max 15

Calibers 1
Caliber_0 1

Tracer 48

Blueprints 5
Blueprint_0_Type Ammo
Blueprint_0_Supplies 1
Blueprint_0_Supply_0_ID 43
Blueprint_0_Build 30
Blueprint_1_Type Ammo
Blueprint_1_Supplies 1
Blueprint_1_Supply_0_ID 6
Blueprint_1_Build 30
Blueprint_2_Type Ammo
Blueprint_2_Supplies 1
Blueprint_2_Supply_0_ID 17
Blueprint_2_Build 30
Blueprint_3_Type Ammo
Blueprint_3_Supplies 1
Blueprint_3_Supply_0_ID 1490
Blueprint_3_Build 30

//Scrap
Blueprint_4_Type Gear
Blueprint_4_Product 67
Blueprint_4_Products 1
Blueprint_4_Level 2
Blueprint_4_Skill Craft
Blueprint_4_Build 30

Paintable

Result: the blueprint was not in the UI.

Img11

  1. I removed Blueprint_#_Supplies and Blueprint_#_Supply_#_ID lines again and changed the Blueprint_#_Type Gear line to Blueprint_#_Type Tool.
GUID 41bd2b68446e497caed8954aba3b8f9c
Type Magazine
Rarity Rare
ID 1490

Size_X 1
Size_Y 2
Size_Z 0.3

Amount 20
Count_Min 5
Count_Max 15

Calibers 1
Caliber_0 1

Tracer 48

Blueprints 5
Blueprint_0_Type Ammo
Blueprint_0_Supplies 1
Blueprint_0_Supply_0_ID 43
Blueprint_0_Build 30
Blueprint_1_Type Ammo
Blueprint_1_Supplies 1
Blueprint_1_Supply_0_ID 6
Blueprint_1_Build 30
Blueprint_2_Type Ammo
Blueprint_2_Supplies 1
Blueprint_2_Supply_0_ID 17
Blueprint_2_Build 30
Blueprint_3_Type Ammo
Blueprint_3_Supplies 1
Blueprint_3_Supply_0_ID 1490
Blueprint_3_Build 30

//Scrap
Blueprint_4_Type Tool
Blueprint_4_Product 67
Blueprint_4_Products 1
Blueprint_4_Level 2
Blueprint_4_Skill Craft
Blueprint_4_Build 30

Paintable

Result: the blueprint was not in the UI.

Basically, there is no workaround that I could think of yet...

Conclusion:

Empty magazines cannot be used in blueprints at all.

If empty magazines were able to be used in blueprints, then various mods become possible, such as: using magazines for crafting other (new) magazines (like a "double" magazine for example), using magazines to craft other items, and salvaging magazines into scrap metal (which was my intention).

SDGNelson commented 2 weeks ago

Sorry to say this is unlikely to change until after a crafting rewrite. Regular item crafting adds up the item "amount" to determine how many of an item you have, whereas ammo containers use amount to represent the number of contained bullets, so regular item crafting thinks you have zero magazines.