Jump to content

Tinkering with the Sniper


XCOUNTRY

Recommended Posts

I edited the following lines for the sniper rifle and its sounds and ammo to make it a little more realis...interesting. I made it sound suppressed with with a borrowed idea from xXC.H.U.DXx :

 

<SoundDataNode name="suppressedsniper"> <AudioSource name="Sounds/AudioSource_Impact"/>

<Noise ID="1" range="4" volume="7" time="5" muffled_when_crouched="1"/>

<AudioClip ClipName="Sounds/ImpactSurface/bullethitcloth1"/>

<LocalCrouchVolumeScale name="1.0"/> <CrouchNoiseScale name="1"/> <NoiseScale name="1"/> <MaxVoices name="3"/> <MaxRepeatRate name="0.01"/> </SoundDataNode>

 

and increased the magazine capacity to make it more like a true DMR. Additionally, I changed it from a ranged weapon that shoots instantaneous rays to a launcher. This gives the shots a really nice feel and they are now affected by gravity, I made the bullet drop exaggerated, but that's just because the view distance is so short and I wanted to use the other lines in the scope. Unfortunately, making the sniper a launcher sorta breaks 7.62mmAmmo, the gun now launches the entire bullet, casing and all. At high speed this doesn't look bad traveling downrange, but you can see the three 762mm casing in your character model's hand poking through the sniper rifle magazine and it bugs out a little as this image gets attached to additional items once you've switched what's in your hand. Finally, brass impact sound particle effects don't exist in the game and I don't know how to make some, I wanted to just create a

 

<SoundDataNode name="bras♥♥♥♥wood"> <AudioSource name="Sounds/AudioSource_Impact"/>

<Noise ID="2" range="7" volume="11" time="4" muffled_when_crouched="1"/>

<AudioClip ClipName="Sounds/ImpactSurface/bullethitwood1"/>

 

and continue that line of thought or just make brass=metal or something, but I'm a total noob and can't even figure out how to open up the atlas in a readable format :sour:

 

<items>

 

<item id="51" name="gunSniperRifle">

<property name="Meshfile" value="Items/Weapons/Ranged/SniperRifle/sniperRiflePrefab"/>

<property name="Material" value="metal"/>

<property name="RepairTools" value="repairKit"/>

<property name="HoldType" value="11"/>

<property name="DegradationBreaksAfter" value="false"/>

<property name="SoundJammed" value="weapon_jam"/>

<property name="Attachments" value="flashlight02"/>

<property name="CrosshairOnAim" value="false"/> <!-- aimTest -->

<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->

<property class="Parts">

<property name="Stock" value="partsSniperRifle_stock"/>

<property name="Receiver" value="partsSniperRifle_receiver"/>

<property name="Pump" value="partsSniperRifle_parts"/>

<property name="Barrel" value="partsSniperRifle_barrel"/>

</property>

<property name="Sound_Sight_In" value="rifle_sight_in"/>

<property name="Sound_Sight_Out" value="rifle_sight_out"/>

<property class="Action0"> <!-- AttackAction -->

<property name="Class" value="Launcher"/>

<property name="Delay" value="0.2"/>

<property name="Crosshair_min_distance" value="45"/> <!-- 45 -->

<property name="Crosshair_max_distance" value="54"/> <!-- 54 -->

<property name="Magazine_size" value="15"/>

<property name="Magazine_items" value="762mmBullet"/>

<property name="Magazine_item_ray_counts" value="1"/>

<property name="Magazine_item_ray_spreads" value="0"/>

<property name="Reload_time" value="2.5"/>

<property name="Bullet_icon" value="uzi"/>

<property name="Sound_start" value="suppressedsniper"/>

<property name="Sound_repeat" value=""/>

<property name="Sound_end" value=""/>

<property name="Sound_empty" value="weapon_empty"/>

<property name="Sound_reload" value="sniperrifle_reload"/>

<property name="Particles_muzzle_fire" value="nozzleflashuzi"/>

<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>

<property name="DamageBonus.head" value="6"/>

<property name="DamageBonus.wood" value="3"/>

<property name="DamageBonus.earth" value="0.2"/>

<property name="DamageBonus.glass" value="1"/>

</property>

<property class="Action1"> <!-- UseAction -->

<property name="Class" value="Zoom"/>

<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay"/>

<property name="Zoom_max_out" value="40"/>

<property name="Zoom_max_in" value="15"/>

</property>

<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->

<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>

<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->

<property name="Group" value="Ammo/Weapons"/>

<property name="ActionSkillGroup" value="Rifles"/>

<property name="CraftingSkillGroup" value="craftSkillGuns"/>

<property name="RepairExpMultiplier" value="10.8"/>

<property name="LightValue" value="0.45"/>

</item>

 

<item id="153" name="762mmBullet">

<property name="Meshfile" value="Items/Weapons/Ranged/HuntingRifle/762mm_bulletPrefab"/>

<property name="Material" value="metal"/>

<property name="Stacknumber" value="500"/>

<property name="EconomicValue" value="19"/>

<property name="Group" value="Ammo/Weapons"/>

<property name="CraftingSkillGroup" value="craftSkillGuns"/>

<property class="Attributes">

<property name="GetQualityFromWeapon" value="true"/>

<property name="EntityDamage" value="6,10"/>

<property name="BlockDamage" value="5.4,13.5"/>

</property>

<property class="Action1">

<property name="Class" value="Projectile"/>

<property name="Velocity" value="170"/>

<property name="FlyTime" value="0"/>

<property name="Gravity" value="-4.0"/>

<property name="LifeTime" value="12"/>

<property name="DamageBonus.head" value="6"/>

<property name="DamageBonus.wood" value="2"/>

<property name="DamageBonus.earth" value="0.1"/>

<property name="DamageBonus.glass" value="1"/>

</property>

</item>

 

I created the following lines in the sounds config and copied and changed the name of bullethit"somematerial" to bras♥♥♥♥"somematerial" for when/if I figure out how to make brass items particle effects work and sound like the bullethit sounds.

 

<SoundDataNode name="bras♥♥♥♥wood"> <AudioSource name="Sounds/AudioSource_Impact"/>

<Noise ID="2" range="7" volume="11" time="4" muffled_when_crouched="1"/>

<AudioClip ClipName="Sounds/ImpactSurface/bullethitwood1"/>

<AudioClip ClipName="Sounds/ImpactSurface/bullethitwood2"/>

<AudioClip ClipName="Sounds/ImpactSurface/bullethitwood3"/>

<LocalCrouchVolumeScale name="1.0"/> <CrouchNoiseScale name="0.5"/> <NoiseScale name="1"/> <MaxVoices name="3"/> <MaxRepeatRate name="0.01"/> </SoundDataNode>

 

hopefully someone with more skill can improve on this idea? Adding true projectiles for the guns adds a really nice touch to the game. I like hearing the slight delay between shot and impact with a Zed

 

Video:

Link to comment
Share on other sites

This is what I use for my Anti Tank rifle and it shoots just fine <giving credit to the Starvation Mod for the model>

 

<item id="900" name="AntiTankRifle">

<property name="CustomIcon" value="50calRifle" />

<property name="Meshfile" value="#morteWeapons?Sniper50Prefab" />

<property name="Material" value="metal" />

<property name="RepairTools" value="repairKit" />

<property name="HoldType" value="11" />

<property name="DegradationBreaksAfter" value="false" />

<property name="SoundJammed" value="weapon_jam" />

<property name="Attachments" value="flashlight02" />

<property name="CrosshairOnAim" value="false"/> <!-- aimTest -->

<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->

<property class="Parts">

<property name="Stock" value="AntiTankRifle_Stock" />

<property name="Receiver" value="AntiTankRifle_Receiver" />

<property name="Barrel" value="AntiTankRifle_Barrel" />

<property name="Pump" value="AntiTankRifle_Parts" />

</property>

<property name="Sound_Sight_In" value="rifle_sight_in"/>

<property name="Sound_Sight_Out" value="rifle_sight_out"/>

<property class="Action0">

<property name="Class" value="Launcher" />

<property name="Delay" value="0.25" />

<property name="Crosshair_min_distance" value="30" />

<property name="Crosshair_max_distance" value="100" />

<property name="Magazine_size" value="10" />

<property name="Magazine_items" value="762mm_Explosive" />

<property name="Magazine_item_ray_counts" value="1, 1" />

<property name="Magazine_item_ray_spreads" value="0, 0" />

<property name="Reload_time" value="1.75" />

<property name="Bullet_icon" value="uzi" />

<property name="Sound_start" value="sniperrifle_fire" />

<property name="Sound_repeat" value="" />

<property name="Sound_end" value="" />

<property name="Sound_empty" value="weapon_empty" />

<property name="Sound_reload" value="sniperrifle_reload" />

<property name="Particles_muzzle_fire" value="nozzleflashuzi" />

<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi" />

<property name="DamageBonus.head" value="50" />

<property name="DamageBonus.wood" value="50" />

<property name="DamageBonus.earth" value="0.2" />

<property name="DamageBonus.glass" value="15" />

</property>

<property class="Action1">

<property name="Class" value="Zoom" />

<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay" />

<property name="Zoom_max_out" value="40" />

<property name="Zoom_max_in" value="15" />

</property>

<property name="LightSource" value="lightSource" />

<property name="ActivateObject" value="Attachments/flashlight/lightSource" />

<property name="AttachmentFlashlight" value="flashlight02" />

<property name="Group" value="Ammo/Weapons" />

<property name="ActionSkillGroup" value="Rifles" />

<property name="CraftingSkillGroup" value="craftSkillGuns" />

<property name="RepairExpMultiplier" value="10.8"/>

<property name="LightValue" value="0.45"/>

<property name="PickupJournalEntry" value="alternateAmmoTip,gunAssemblyTip,augmentGunsTip" />

</item>

 

here is the bullets it shoots you might be able to edit it cant remember where I got the xml for them though

 

<item id="502" name="762mm_Explosive">

<property name="CustomIcon" value="762mmBullet" />

<property name="CustomIconTint" value="F5BB51" />

<property name="Meshfile" value="Items/Weapons/Ranged/HuntingRifle/762mm_bullet" />

<property name="Material" value="metal" />

<property name="HoldType" value="21" />

<property name="Stacknumber" value="1000" />

<property name="Weight" value="1" />

<property name="Group" value="Ammo/Weapons" />

<property class="Preview">

<property name="Zoom" value="18" />

<property name="Pos" value="0.1,0" />

<property name="Rot" value="10,-45,0" />

</property>

<property class="Action1">

<!-- UseAction -->

<property name="Class" value="Projectile" />

<property name="DamageEntity" value="100" />

<property name="DamageBlock" value="20" />

<property name="Explosion.ParticleIndex" value="6" /> <!-- can change value 1 for small particle and up for more visual-->

<!-- which prefab/particle is used -->

<property name="Explosion.RadiusBlocks" value="4" />

<!-- damage radius for blocks -->

<property name="Explosion.BlockDamage" value="0" />

<!-- damage for blocks in the center of the explosion -->

<property name="Explosion.RadiusEntities" value="4" />

<!-- damage radius for entities -->

<property name="Explosion.EntityDamage" value="200" />

<!-- damage for entities in the center of the explosion -->

<property name="Velocity" value="1000" />

<property name="FlyTime" value="1.2" />

<property name="LifeTime" value="8" />

</property>

<property class="Attributes">

<property name="GetQualityFromWeapon" value="true" />

<property name="EntityDamage" value="3000,5000" />

<property name="BlockDamage" value="0,0" />

</property>

</item>

Link to comment
Share on other sites

here is the bullets it shoots you might be able to edit it cant remember where I got the xml for them though

 

I put in the 762 explosive edited some of the values. Couldn't really figure out what makes this one work so well, is it the <property class="preview">? But it does exactly what I want it to do. Thank you! I will try to make all the guns shoot like this now. So much more fun.

Link to comment
Share on other sites

It's magic. Shhhh don't question it

 

You wouldn't happen to know how to make the explosive ammo craftable would you (I renamed it 762mm_Subsonic)? I Put in a recipe for it mimicking the 7.62 mm (Ammo) recipe, but it doesn't seem to work. I read somewhere that a block id or an item id has to exist for it to be craftable. I can see it in the CM and i used the item id=502, but it doesn't work. The recipe file works (i.e. its a working xml file), but anything after the recipe I put in hides all the recipes following it. To confirm, I then put the Subsonic recipe at the end and all the recipes work again except the one I created (by end I don't mean in the <!-- idea recipes --> section, I mean after the last legit recipe, but before the </recipes> part.

 

Ex:

 

<recipes>

 

<recipe name="762mmBullet" count="1" craft_area="workbench">

<ingredient name="bulletTip" count="1"/>

<ingredient name="gunPowder" count="3"/>

<ingredient name="bulletCasing" count="1"/>

</recipe>

 

<recipe name="762mm_Subsonic" count="1" craft_area="workbench">

<ingredient name="bullet tip" count="1"/>

<ingredient name="gunPowder" count="3"/>

<ingredient name="bulletCasing" count="1"/>

</recipe>

 

<recipe name="9mmBullet" count="1" craft_area="workbench">

<ingredient name="bulletTip" count="1"/>

<ingredient name="gunPowder" count="1"/>

<ingredient name="bulletCasing" count="1"/>

</recipe>

 

</recipes>

 

I'll see the recipe for 7.62MM (Ammo) in my UI, but won't see my subsonic round recipe or the 9mm (Ammo) (and anything that comes after it).

Link to comment
Share on other sites

If you ever get only a partial list of items in an xml, it's due to the xml crashing right before the list ends; checking the output log, it will often say what line number it crashed at. Pro-tip, it's the line BEFORE the one the log says. =)

 

Problem is, with so many xml's dependent on information from other xml's, you could fix one, to find another is broken, to fix it, to find another...

Link to comment
Share on other sites

Problem is, with so many xml's dependent on information from other xml's, you could fix one, to find another is broken, to fix it, to find another...

 

Ugh... Ok thank you all for your help. Finding this side of the game to be just as engaging as the actual game. Fun yet frustrating.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...