How to get position and heading of equipped weapon?

Post » Wed Dec 30, 2009 10:49 am

I recently released a flashlight mod, but now I'm thinking about some possibilities for a flashlight weapon mod, or weapons with a built-in flashlight. The method I used requires the position and heading of the light's origin. It was easy enough to make the light beam follow the player's field of vision, but I am pretty stumped on how to do it with an equipped weapon.

Right now the only thing I could think of is to record the position and heading of the weapon during the appropriate animations, and then move the beam of light to match them, but I foresee some problems with this:
- not sure if I can keep the the beam movements synced with the animations
- the light beam would not match with any alternative animations that the player uses
- the light beam would not match if the player goes ragdoll

Any ideas?
User avatar
Nitol Ahmed
 
Posts: 3321
Joined: Thu May 03, 2007 7:35 am

Post » Wed Dec 30, 2009 10:46 am

You said it yourself, mate. It would be cool if someone built a 1:1 replica of Angkor Wat with toothpicks, or if someone translated the entire game into one of the languages from the Voynich Manuscript, but it would take years. Since you can't get the heading of the weapon with a script command, you'd have to write down the angle of the weapon in every frame in every animation, which would net you thousands of variables. How about simply turning the flashlight off when the player reloads or goes ragdoll?
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Wed Dec 30, 2009 4:19 am

You might be able to get the NVSE people to create a script command that'd get you the weapon's current position/heading, but I'm not positive that they'd be able to. It's possible, though, so you should ask in the NVSE thread in the mod forum.
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm


Return to Fallout: New Vegas