Results 1 to 2 of 2

Thread: need help understanding how to create gun parts for a gun mod

  1. #1
    Refugee
    Join Date
    Oct 2019
    Posts
    5
    Rep Power
    0

    Question need help understanding how to create gun parts for a gun mod

    hey everyone i been trying to get into modding so i decided to start by working upon some existing mod and using it as basis just so i can get the basics as a beginner while having something that is already functional its easier to mess around i think rather than building one completely from scratch without any knowledge. For that reason the mod is for private for education purpose and use and i dont plan to release it publicly or do anything like that without the original creator's consent

    The mod which im referring to in particular is "Harry's M4A1" from the author BobbyLee298
    he managed to implement in the game the "Tier 3 Assault Rifle" Joel teased a while ago but didnt make it into the A18 despite already having the models in the game and being partially functional already in vanilla A18.

    I think BobbyLee298 did an amazing job into making this gun functional but i wanted to make some adjustments and improvments to it to mess around with modding as a noob myself. Right now the weapon has 2 problems which are:

    -No reloading sound: i tried to use the reloading sounds of multiple weapons but for some reason the sound simply wont play no matter what..i thought it could be related to some other settings like reloading speed but after messing around with that i think it might be something more complicated than xml edits.

    -The gun uses other gun's parts to build and break into: This is my main problem right now. i wanted to make the gun use its own gun parts so i tried to study how the game's XML files work relating to gun parts and kinda reverse engineer it to create a new gun part for this mod but ofcourse as simple as it seemed it is not working for me.

    Heres what i done to try to implement the gun parts: on the mod's items.xml originially there were entries for 2 new items one being the weapon itself and the other being the schematic.I also looked into the vanilla items.xml and saw what gun part codes are like and tried to implement them in similar structure in the mod's items.xml like this (in between the original mod append code ofcourse since there was 2 separated items already under the same append code i just jumped a line to create a new entry in the same way its done originally)

    Code:
    <item name="M4 Parts">
    	<property name="Extends" value="gunAk47Parts"/>
    	<property name="Material" value="gunAk47Parts"/>
    	<property name="EconomicValue" value="800"/>
    	<property name="CustomIcon" value="M4PartsIcon"/> (custom icon placeholder i created and put in the same folder as the weapon's custom icon that the mod uses for the weapon itself)
    </item>
    i tried to look into everything related to gun parts in vanilla and saw that they are apparently not craftable and have no materials or anything they simply exist just by themselves and i think that is the part where i might be messing up something by trying to add a new modded gun part and i cant figure out what could be missing

    other modifications related this new gun part im trying to implement are in the recipes.xml to add the weapon parts to the weapon

    Code:
    <recipe name="M4 Rifle" count="1" craft_area="workbench" tags="learnable,workbenchCrafting,workbenchCrafting">
    	<ingredient name="M4 Parts" count="3"/>
    	<ingredient name="resourceForgedSteel" count="9"/>
    	<ingredient name="resourceMilitaryFiber" count="6"/>
    	<ingredient name="resourceScrapPolymers" count="4"/>
    	<ingredient name="resourceSpring" count="2"/>
    	<ingredient name="resourceDuctTape" count="3"/>
    	<ingredient name="resourceMechanicalParts" count="4"/>
    	<ingredient name="resourceMetalPipe" count="1"/>
    	<ingredient name="medicalBandage" count="2"/>
    	<effect_group>
    		<passive_effect name="CraftingIngredientCount" level="1,6" operation="perc_add" value="0,5" tags="M4 Parts,resourceForgedSteel,resourceScrapPolymers,resourceSpring,resourceDuctTape,resourceMechanicalParts,resourceMetalPipe,medicalBandage"/>
    	</effect_group>
    </recipe>
    i also replaced in the items.xml the materials that the weapon broke into ..it used to break into machine gun parts i changed to "M4 Parts" which is the name of the parts im trying to create

    im sure im missing something on how to create a gun part mod does anyone have some thoughts or clue about what i might be missing or doing wrong ?
    Last edited by Oni.; 3 Weeks Ago at 11:32 PM.

  2. #2
    Refugee
    Join Date
    Oct 2019
    Posts
    5
    Rep Power
    0
    update i noticed that i forgot to create a materials xml on the mod specifying the gun parts. i just tried that and for my surprised it worked flawlessly!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •