Editing snipers / sniper scopes

Lots of cool and useful tips to mod either serverside or clientside
Post Reply
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Editing snipers / sniper scopes

Post by Swaffy »

[Warning: I am not familiar with the terms "Server Side" or "Client Side" modding. I simply edit the RFA files in this tutorial.

This tutorial helps you:
- remove or edit scope sway as your character looks down the scope.
- remove or edit the shake when you fire while looking down a scope.
- add a scope to any handheld weapon model. [Not a sight, the actual scope object]

[If you would like me to add something else sniper rifle related, please ask.]

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

First, I will show you how to get rid of the scope sway [and] remove the scope shake when firing.

Step 1 - Start up your RFA explorer. Open up the "Animations.rfa" file of the mod you are editing.

Step 2 - What you will be editing will be located at one of these two locations:
Animations\AnimationStatesCameraShakes.con
Animations\AnimationStatesCameraShakesMod.con


As an example, I will open up AnimationStatesCameraShakes to edit the No4 Sniper. Scroll down until you find the No4Sniper section [shown in below image]

Image

Step 3 - This is for both the sway of the scope [camera] and the shake when the gun is fired. The first two segments are the fire shake. The last three are for the scope sway. If you are going to remove the shake and sway, you can either just delete the lines, "rem" them out, or edit the numbers so they all have 0 [shown in below image]

Image

Step 4 - There you have it. Save your ".con" file, then build [save] the RFA file and be sure to test your weapon in-game. It should have the newly edited shake and sway when using the gun.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Second, I will show you how to add a scope [object] to your weapon's model.

Step 1 - Before we do this, you need to make a mesh object and texture for your scope object. That, or you can simply use the scope used on the No4 Sniper and K98 Sniper. In this tutorial, we will use the already-made scope that the No4 and K98 snipers use. Crate a "Geometries.con" file for your weapon, if it doesn't already have one. Add this scripting to the file:

Code: Select all

GeometryTemplate.create StandardMesh WeaponScope
GeometryTemplate.file No4_Scope_m1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 3
GeometryTemplate.setLodDistance 2 10
GeometryTemplate.setLodDistance 3 20
GeometryTemplate.setLodDistance 4 30
GeometryTemplate.setLodDistance 5 100
You can name the scope anything you like instead of "WeaponScope," but I'm using it for tutorial purposes.
Save the file. [For Col. Cruachan's RFA Explorer, save the ".con" file then build the RFA before editing other ".con" files.]

Step 2 - Open up the "Objects.con" for your gun. Scroll to the bottom where the animation scripts are at. Add this at the bottom:

Code: Select all

ObjectTemplate.create SimpleObject WeaponScope
ObjectTemplate.geometry WeaponScope
As the scripting says, this is the SimpleObject for the scope. It uses the StandardMesh you created for your gun in your "Geometries.con" file [as done in step 1].

Step 3 - Now that you have created your scope, it's time to actually add it to your weapon. use these lines:

Code: Select all

ObjectTemplate.addTemplate WeaponScope
ObjectTemplate.setPosition 0.0/0.0/0.0]
Add it to your weapon's Complex "AnimatedBundle." Here's a picture of my GarandSniper, which is my sniper version of the M1 Garand:

Image

As you can see by referring to my [awesome MS Paint drawing skills] red markings, the scope has been added to the weapon [AnimatedBundle]. You can change the position of the scope on your gun by changing the numbers in this script:

ObjectTemplate.setPosition 0/0/0

You can also add this if you want to rotate the scope:

ObjectTemplate.setRotation 0/0/0

Step 4Save your ".con" file, then build [save] your RFA. Test the gun in-game to make sure the scope is present; you can mess with the positioning to make the scope look nice for your gun.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Again, if you have anything relating snipers and their scope that you want me to add to this tutorial, let me know.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I am sorry if the size is too large.
Image

Image
Last edited by Swaffy on Wed Jan 26, 2011 12:32 am, edited 2 times in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Editing snipers / sniper scopes

Post by fo0k »

Thanks Swaffy. Nice detail.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Editing snipers / sniper scopes

Post by Swaffy »

If you can inform me what SSM [Server Side Modding] and CSM [Client Side] are, it will help me greatly in future situations.

[Edit:] Adding two in-game snapshots of guns with scopes, my GarandSniper and my BARScout.
This will give a visual example of the outcome of the second part of this tutorial.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Editing snipers / sniper scopes

Post by fo0k »

Serverside mod would just be changes to the server files with a patch so no download required.
Clientside would be anything requiring the client to download something.
Take a look at the basic tutorials page here.. http://bfmods.com/tutorial.php ..Yet to be added as a link to front page.
Post Reply