Page MenuHomeFeedback Tracker

Add weapon animation sources for aiming and optics mode
New, NormalPublic

Description

This would be extremely nice to have as it would allow for animated alternative sights or changing the apperance of a sight when you are actually aiming down the sights.

New sources would be similar to current eventhandlers:
isADS - 0/1
opticsMode - index of current optics mode starting with 0.

These changes would be excellent for scopes/attachments too but I think that's a whole other can of worms.

Examples of usage:
Changing the apperance of an aperture sight when looking down it, while maintaing the correct physical side - ie. wider field of view, better representation of how the human eye sees through it. RHS does this already by having an optic attachment be added when aiming.
Alternative iron sights - Night sights, AA sights, a lot of weapons (particularly older ones) have different sights fit to the weapon. This can be handled with the 'zeroing' model source currently but not always fiting

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Modding

Event Timeline

KercKasha updated the task description. (Show Details)Sep 18 2023, 8:57 AM
POLPOX added a subscriber: POLPOX.Sep 18 2023, 11:10 AM
h- added a subscriber: h-.Sep 18 2023, 6:01 PM
dedmen set Ref Ticket to AIII-56008.Sep 27 2023, 5:35 PM
dedmen added a subscriber: dedmen.EditedApr 5 2024, 6:24 PM

That would be same spot as bipod_length, bipod, bipod_mounting, revolving, reloadmagazine sources.

opticsMode is -1 when not found (weapon not in hands of a unit)
otherwise its just its index.. which is per muzzle? How'd you know which muzzle is active? Do you care?

opticsMode is per muzzle index, so its opticsMode.0 and opticsMode.1 and such, I think thats how that works?

isADS would be https://community.bistudio.com/wiki/cameraView == "GUNNER"? If so then I don't think I can do that. That wouldn't work for AI's which don't have camera, and would also be a problem in MP.
That would always return the state of the players camera. I could check if the unit holding the weapon == cameraOn. In all other cases it would always be zero?
You'd have to combine it with isselected anim source, to make sure you don't animate when player is in ADS somewhere else.

I don't have a way to test this, either make a repro mod so I can test, or please test yourself next dev-branch.

Actually I could test it by just replacing reloading source with isADS. seems to work. Its not a smooth transition though, it flips once the animation into the scope is completed.
opticsMode seems to also work, a bit hard to test.

isADS would be https://community.bistudio.com/wiki/cameraView == "GUNNER"? If so then I don't think I can do that. That wouldn't work for AI's which don't have camera, and would also be a problem in MP.
That would always return the state of the players camera. I could check if the unit holding the weapon == cameraOn. In all other cases it would always be zero?
You'd have to combine it with isselected anim source, to make sure you don't animate when player is in ADS somewhere else.

I'm pretty sure that remote units camera state is broadcasted because it changes for you automatically when you watch remote players with _remotePlayer switchCamera "INTERNAL" it follows whatever camera view that player is having on their client.

"when you watch remote players" yeah you are moving your camera into them.
I assume local camera state will reflect theirs, and as I'm checking local camera state, it will probably also trigger isADS then. But only while spectating.

I changed isADS to be isAds.muzzleIndex just like opticsMode, next dev-branch

I thought it was in the original post but after re-reading it I seemed to have missed it.

I'm guessing this is a whole other can of worms to open but would it be possible to extend these animation sources to optic/attachment proxies?

Currently only bipods and magazine proxies support any sort of animation so so I have obviously no idea how much of a mess it would be to allow optics to be animated too

If they don't even support animation at all, then definitely not.