Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Naru

#1
I've made a few weapons (Beretta 92FS, Rheinmetall MG3, HK G36, FN P90, Kar 98k) for the mod that I'm using in my own games.

I simply added them to the CE Guns submod. Really easy to do. Just create a new entry (copy from existing gun then modify) in the Weapons_CE_Guns file then create the textures and throw them in the texture folder. To create the texture just find an image of the gun you want, scale it down then create a black 1 pixel border around it (in photoshop this is done with a black glow under layer blending).

Here's the textures that I've made

Beretta 92FS


G36


P90


K98k


MG3 uses the MG60 texture.

And the code I use (make sure to name the textures properly corresponding to the code if you're going to use this)

     <!-- ==================== G36 ==================== -->
 
  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>CE_Gun_GThirtySix</defName>
    <label>G36</label>
    <description>Ancient military assault rifle.</description>
    <graphicData>
      <texPath>Things/Weapons/G36</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractRifle</soundInteract>
    <statBases>
      <WorkToMake>28000</WorkToMake>
      <SightsEfficiency>1</SightsEfficiency>
      <ShotSpread>0.07</ShotSpread>
      <SwayFactor>1.28</SwayFactor>
      <Bulk>7.00</Bulk>
      <Mass>3.50</Mass>
      <RangedWeapon_Cooldown>0.37</RangedWeapon_Cooldown>
    </statBases>
    <costList>
      <Steel>50</Steel>
      <Component>5</Component>
    </costList>
    <verbs>
      <li Class="CombatExtended.VerbPropertiesCE">
        <recoilAmount>1.27</recoilAmount>
        <verbClass>CombatExtended.Verb_ShootCE</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_556x45mmNATO_FMJ</defaultProjectile>
        <burstShotCount>6</burstShotCount>
        <ticksBetweenBurstShots>5</ticksBetweenBurstShots>
        <warmupTime>1.1</warmupTime>
        <range>50</range>
        <soundCast>ShotAssaultRifle</soundCast>
        <soundCastTail>GunTail_Medium</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
    <comps>
      <li Class="CombatExtended.CompProperties_AmmoUser">
        <magazineSize>30</magazineSize>
        <reloadTime>3.5</reloadTime>
        <ammoSet>AmmoSet_556x45mmNATO</ammoSet>
      </li>
      <li Class="CombatExtended.CompProperties_FireModes">
        <aiUseBurstMode>TRUE</aiUseBurstMode>
        <aiAimMode>AimedShot</aiAimMode>
        <aimedBurstShotCount>3</aimedBurstShotCount>
      </li>
    </comps>
    <recipeMaker>
      <researchPrerequisite>PrecisionRifling</researchPrerequisite>
    </recipeMaker>
      <tools>
        <li Class="CombatExtended.ToolCE">
          <label>stock</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>9</power>
          <cooldownTime>1.8</cooldownTime>
          <commonality>1.5</commonality>
          <armorPenetration>0.11</armorPenetration>
          <linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelblunt</id>
          <label>barrel</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.118</armorPenetration>
          <linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelpoke</id>
          <label>muzzle</label>
          <capacities>
            <li>Poke</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.086</armorPenetration>
          <linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
        </li>
      </tools>
  </ThingDef>
 
 
 
   <!-- ==================== MG3 machine gun ==================== -->

  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>CE_Gun_MGThree</defName>
    <label>MG3</label>
    <description>A belt-fed general-purpose machine gun. Lots of firepower but heavy and cumbersome to carry around. Commonly nicknamed "The Pig".</description>
    <graphicData>
      <texPath>Things/Weapons/M60</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractRifle</soundInteract>
    <statBases>
      <WorkToMake>40500</WorkToMake>
      <SightsEfficiency>1</SightsEfficiency>
      <ShotSpread>0.08</ShotSpread>
      <SwayFactor>1.51</SwayFactor>
      <Bulk>11.05</Bulk>
      <Mass>10.50</Mass>
      <RangedWeapon_Cooldown>0.56</RangedWeapon_Cooldown>
    </statBases>
    <costList>
      <Steel>85</Steel>
      <Component>6</Component>
      <Chemfuel>15</Chemfuel>
    </costList>
    <verbs>
      <li Class="CombatExtended.VerbPropertiesCE">
        <recoilAmount>1.3</recoilAmount>
        <verbClass>CombatExtended.Verb_ShootCE</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_762x51mmNATO_FMJ</defaultProjectile>
        <warmupTime>1.0</warmupTime>
        <range>75</range>
        <ticksBetweenBurstShots>3</ticksBetweenBurstShots>
        <burstShotCount>15</burstShotCount>
        <soundCast>ShotMinigun</soundCast>
        <soundCastTail>GunTail_Heavy</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
        <targetParams>
          <canTargetLocations>true</canTargetLocations>
        </targetParams>
        <recoilPattern>Mounted</recoilPattern>
      </li>
    </verbs>
    <comps>
      <li Class="CombatExtended.CompProperties_AmmoUser">
        <magazineSize>150</magazineSize>
        <reloadTime>9.0</reloadTime>
        <ammoSet>AmmoSet_762x51mmNATO</ammoSet>
      </li>
      <li Class="CombatExtended.CompProperties_FireModes">
        <aiUseBurstMode>FALSE</aiUseBurstMode>
        <aiAimMode>SuppressFire</aiAimMode>
        <aimedBurstShotCount>5</aimedBurstShotCount>
      </li>
    </comps>
    <weaponTags>
      <li>CE_MachineGun</li>
    </weaponTags>
    <recipeMaker>
      <researchPrerequisite>PrecisionRifling</researchPrerequisite>
    </recipeMaker>
      <tools>
        <li Class="CombatExtended.ToolCE">
          <label>stock</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>9</power>
          <cooldownTime>1.8</cooldownTime>
          <commonality>1.5</commonality>
          <armorPenetration>0.11</armorPenetration>
          <linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelblunt</id>
          <label>barrel</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.118</armorPenetration>
          <linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelpoke</id>
          <label>muzzle</label>
          <capacities>
            <li>Poke</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.086</armorPenetration>
          <linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
        </li>
      </tools>
  </ThingDef>
 
 
 
   <!-- ==================== 92 ==================== -->
  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>CE_Gun_B92FS</defName>
    <label>Beretta 92FS</label>
    <description>Ancient pistol design. Used to be popular with police forces due to its compact size.</description>
    <graphicData>
      <texPath>Things/Weapons/FS92</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractAutopistol</soundInteract>
    <statBases>
      <WorkToMake>7000</WorkToMake>
      <SightsEfficiency>0.7</SightsEfficiency>
      <ShotSpread>0.15</ShotSpread>
      <SwayFactor>0.87</SwayFactor>
      <Bulk>1.9</Bulk>
      <Mass>1.1</Mass>
      <RangedWeapon_Cooldown>0.38</RangedWeapon_Cooldown>
    </statBases>
    <costList>
      <Steel>25</Steel>
      <Component>3</Component>
    </costList>
    <verbs>
      <li Class="CombatExtended.VerbPropertiesCE">
        <verbClass>CombatExtended.Verb_ShootCE</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_9x19mmPara_FMJ</defaultProjectile>
        <warmupTime>0.6</warmupTime>
        <range>15</range>
        <soundCast>ShotAutopistol</soundCast>
        <soundCastTail>GunTail_Light</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
    <comps>
      <li Class="CombatExtended.CompProperties_AmmoUser">
        <magazineSize>17</magazineSize>
        <reloadTime>3</reloadTime>
        <ammoSet>AmmoSet_9x19mmPara</ammoSet>
      </li>
      <li Class="CombatExtended.CompProperties_FireModes" />
    </comps>
    <recipeMaker>
      <researchPrerequisite>BlowbackOperation</researchPrerequisite>
    </recipeMaker>
    <weaponTags>
      <li>CE_Sidearm</li>
      <li>CE_OneHandedWeapon</li>
    </weaponTags>
    <tools>
      <li Class="CombatExtended.ToolCE">
        <label>grip</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>8</power>
        <cooldownTime>1.6</cooldownTime>
        <commonality>1.5</commonality>
        <armorPenetration>0.102</armorPenetration>
        <linkedBodyPartsGroup>Grip</linkedBodyPartsGroup>
      </li>
      <li Class="CombatExtended.ToolCE">
        <id>barrelblunt</id>
        <label>barrel</label>
        <capacities>
          <li>Blunt</li>
        </capacities>
        <power>8</power>
        <cooldownTime>1.6</cooldownTime>
        <armorPenetration>0.102</armorPenetration>
        <linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
      </li>
      <li Class="CombatExtended.ToolCE">
        <id>barrelpoke</id>
        <label>muzzle</label>
        <capacities>
          <li>Poke</li>
        </capacities>
        <power>8</power>
        <cooldownTime>1.6</cooldownTime>
        <armorPenetration>0.075</armorPenetration>
        <linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
      </li>
    </tools>
  </ThingDef>
 
 
   <!-- ==================== P90 ==================== -->

  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>CE_Pninety</defName>
    <label>P90</label>
    <description>A uniquely shaped, lightweight carbine designed for close-quarters fighting.</description>
    <graphicData>
      <texPath>Things/Weapons/P90</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractRifle</soundInteract>
    <statBases>
      <WorkToMake>15500</WorkToMake>
      <SightsEfficiency>1</SightsEfficiency>
      <ShotSpread>0.05</ShotSpread>
      <SwayFactor>0.70</SwayFactor>
      <Bulk>2.50</Bulk>
      <Mass>2.70</Mass>
      <RangedWeapon_Cooldown>0.25</RangedWeapon_Cooldown>
    </statBases>
    <costList>
      <Steel>30</Steel>
      <Component>5</Component>
      <Chemfuel>10</Chemfuel>
    </costList>
    <verbs>
      <li Class="CombatExtended.VerbPropertiesCE">
        <recoilAmount>0.84</recoilAmount>
        <verbClass>CombatExtended.Verb_ShootCE</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_FN57x28mm_AP</defaultProjectile>
        <burstShotCount>8</burstShotCount>
        <ticksBetweenBurstShots>4</ticksBetweenBurstShots>
        <warmupTime>0.6</warmupTime>
        <range>38</range>
        <soundCast>ShotHeavySMG</soundCast>
        <soundCastTail>GunTail_Heavy</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
    <comps>
      <li Class="CombatExtended.CompProperties_AmmoUser">
        <magazineSize>50</magazineSize>
        <reloadTime>6</reloadTime>
        <ammoSet>AmmoSet_FN57x28mm</ammoSet>
      </li>
      <li Class="CombatExtended.CompProperties_FireModes">
        <aimedBurstShotCount>3</aimedBurstShotCount>
      </li>
    </comps>
    <recipeMaker>
      <researchPrerequisite>PrecisionRifling</researchPrerequisite>
    </recipeMaker>
      <tools>
        <li Class="CombatExtended.ToolCE">
          <label>stock</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>9</power>
          <cooldownTime>1.8</cooldownTime>
          <commonality>1.5</commonality>
          <armorPenetration>0.11</armorPenetration>
          <linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelblunt</id>
          <label>barrel</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.118</armorPenetration>
          <linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelpoke</id>
          <label>muzzle</label>
          <capacities>
            <li>Poke</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.086</armorPenetration>
          <linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
        </li>
      </tools>
  </ThingDef>
 

   <!-- ==================== Kar 98K ==================== -->

  <ThingDef ParentName="BaseHumanMakeableGun">
    <defName>kar98k</defName>
    <label>Kar 98K</label>
    <description>Ancient bolt-action rifle with a full rifle 8mm round.</description>
    <graphicData>
      <texPath>Things/Weapons/k98</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <soundInteract>InteractRifle</soundInteract>
    <statBases>
      <WorkToMake>12000</WorkToMake>
      <SightsEfficiency>1</SightsEfficiency>
      <ShotSpread>0.02</ShotSpread>
      <SwayFactor>1.64</SwayFactor>
      <Bulk>10.10</Bulk>
      <Mass>4.10</Mass>
      <RangedWeapon_Cooldown>1.10</RangedWeapon_Cooldown>
    </statBases>
    <costList>
    <Steel>55</Steel>
    <WoodLog>15</WoodLog>
    <Component>1</Component>
    </costList>
    <verbs>
      <li Class="CombatExtended.VerbPropertiesCE">
        <verbClass>CombatExtended.Verb_ShootCE</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_792x51mmMauser_FMJ</defaultProjectile>
        <warmupTime>1.4</warmupTime>
        <range>60</range>
        <soundCast>ShotSniperRifle</soundCast>
        <soundCastTail>GunTail_Heavy</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
    <comps>
      <li Class="CombatExtended.CompProperties_AmmoUser">
        <magazineSize>5</magazineSize>
        <reloadTime>4</reloadTime>
        <ammoSet>AmmoSet_792x51mmMauser</ammoSet>
      </li>
      <li Class="CombatExtended.CompProperties_FireModes">
        <aiUseBurstMode>FALSE</aiUseBurstMode>
        <aiAimMode>AimedShot</aiAimMode>
      </li>
    </comps>
    <weaponTags>
      <li>CE_AI_Rifle</li>
    </weaponTags>
    <recipeMaker>
      <researchPrerequisite>Gunsmithing</researchPrerequisite>
    </recipeMaker>
      <tools>
        <li Class="CombatExtended.ToolCE">
          <label>stock</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>9</power>
          <cooldownTime>1.8</cooldownTime>
          <commonality>1.5</commonality>
          <armorPenetration>0.11</armorPenetration>
          <linkedBodyPartsGroup>Stock</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelblunt</id>
          <label>barrel</label>
          <capacities>
            <li>Blunt</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.118</armorPenetration>
          <linkedBodyPartsGroup>Barrel</linkedBodyPartsGroup>
        </li>
        <li Class="CombatExtended.ToolCE">
        <id>barrelpoke</id>
          <label>muzzle</label>
          <capacities>
            <li>Poke</li>
          </capacities>
          <power>10</power>
          <cooldownTime>1.9</cooldownTime>
          <armorPenetration>0.086</armorPenetration>
          <linkedBodyPartsGroup>Muzzle</linkedBodyPartsGroup>
        </li>
      </tools>
  </ThingDef>


EDIT: Also, note that rate of fire is determined by ticksBetweenBurstShots variable and is logarithmic in scaling. Example of input and rounds per minute displayed in the game.

Example table:
1  3600
2  1800
3  1200
4  900
5  720
6  600
7  514
8  450
9  400

For the MG3 I use 3, which gives me 1200 RPM while for the G36 I use 5 which gives me 720 RPM.