Fallout New Vegas

File information

Last updated

Original upload

Created by

Retral-RX

Uploaded by

RetralRX

Virus scan

Safe to use

Tags for this mod

About this mod

Make laser sight-equipped vanilla weapons' laser only visible when night vision is on. A tutorial on how to apply it to your custom weapon is included.

Requirements
Permissions and credits
This is a little bit of deviation from my main project. A simple quality of life plugin. The files that are provided work for vanilla weapons which are 10mm pistol and 12.7mm SMG.




Here is how to implement it to your custom weapon:

Before we begin this mod/tutorial requires JIP LN NVSE Plugin. Make sure you have that.


FOR NON MODDERS

  • Let's start with the basic method. If you are not a modder and you want your custom mod to use this feature,
  • Make sure the laser is not toggleable which means it uses script and may conflict with this one,
  • Open your mesh that is your weapon with laser in Nifscope,
  • You will see your mesh on the screen on the right. On left, you will find the list of nif blocks. Not sure which nif block is referring to laser, click on the weapon's laser, and it will be selected on the left,



5. Now in the block details (Bottom left), you will see the name, right-click on your laser's name and "Edit String Index"



6. A panel will pop up,


7. Enter either one of those without quotes "##LaserSightBeam:2" or "LaserSightBeamSMG:2". It is case sensitive make sure to type exactly the same.

8. Click Ok and then save your file.( CTRL + S) You are good to go.  This is a very simplified version of how to implement it. There may be a nif block controller involved which may cause a break or crash. If something like that occurs, simply renaming it to its original name will fix this.

FOR MODDERS

Instead of renaming blocks, adding your nif block's name into the script will make it much safer. Let's say you want your mod to benefit from Sam Fisher and Snake NVG plugin that I provided. (Or skip to the bottom section if you want to make a patch for other mods)
Open RXNVGsandLASERSFSNVPatchScript in script editor; or in GECK
The if line states that if the PC has an active spell or object effect(in this example it is NVGooggles), the script will turn the laser on.The lines contain setnifblockflag command has 3 digits at the end. The first number is the flag number which is "invisibility" for this tutorial. The second number states true or not(1 true(mesh is invisible in-game), 2 false(Mesh is visible in-game) and the third argument is first person(2) or the third person(1)



Simply copy one of the lines starting with player.setnifblockflag and paste it under both if and else block. Enter your laser's nif block name between the quotes. The lines end with "1" for third-person view and "2" for first-person view.  You have to do this for both perspectives. The engine does not update itself when you switch the camera. When done right, It should be looked like this:


Save your script and you should be good to go.

FOR THOSE WHO WANT TO MAKE A PATCH WITH THIS TEMPLATE

  • Create a new script,
  • Copy-paste Gamemode block into your new script.
  • The "NVGoggles" in the "If player.IsSpellTarget NVGoggles == 1" indicates which Actor effect/object effect should change the laser visibility. In this example, the script changes laser visibility depending on if the actor has NVGoggles object effect.
  • You must find the editor ID of what gives PC character a night vision in your mod you want to patch and change the NVGoggles with the editor ID you found.
  • After that, you must create a quest. You can copy the quest in my ESP.
  • Open your quest in the geck/ fnvedit.
  • Find your quest
  • Click on the script line and select the script you created. 
  • Save your esp.
  • Configurations, the mod you've patched has become 10 times more tactical thanks to you :)