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]

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]

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
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
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]

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.

