Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optics - Add scripted optics index config entry #1678

Closed

Conversation

johnb432
Copy link
Contributor

When merged this pull request will:

  • This allows one to set which optics index should be used for the scripted optic.
    I'm continuing the work on making ACE scopes use CBA optics (Optics - Convert Optics to use CBA Optics acemod/ACE3#7273), but came across the limitation that the scripted optic needed to be the first optics mode of the optic. This PR changes that so that you can specify which optics mode is the scripted one.
    E.g. you can now have the primary optics mode be a collimator and the secondary optics mode be the optics using CBA optics.
  • This PR assumes that you can't have more than 1 scripted optic mode per optic.
  • Documentation needs to be added.
  • Tested with samples from ACE (Optics - Convert Optics to use CBA Optics acemod/ACE3#7273), CUP, RKSL and BWMod scopes: it doesn't seem to affect existing scopes negatively.

Copy link
Contributor

@PabstMirror PabstMirror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to break restoring magnification on variable zoomed optics
e.g. player addPrimaryWeaponItem "CUP_optic_LeupoldMk4"
zoom a bit, unscope, rescope and it reset to lowest

@PabstMirror
Copy link
Contributor

it seems like restoring the addWeaponItem fixes.

_unit addWeaponItem [_weapon, _optic];
_unit setOpticsMode GVAR(scriptedOpticsIndex);

@johnb432
Copy link
Contributor Author

it seems like restoring the addWeaponItem fixes.

_unit addWeaponItem [_weapon, _optic];
_unit setOpticsMode GVAR(scriptedOpticsIndex);

I'll look into adding both addWeaponItem lines again.

@johnb432
Copy link
Contributor Author

_unit addWeaponItem [_weapon, _optic]; reverts the optics mode to the default one and _unit setOpticsMode GVAR(scriptedOpticsIndex); reverts the magnification of the scope.
I need to rethink how to go about this...

@johnb432
Copy link
Contributor Author

_unit addWeaponItem [_weapon, _optic]; reverts the optics mode to the default one and _unit setOpticsMode GVAR(scriptedOpticsIndex); reverts the magnification of the scope. I need to rethink how to go about this...

Because there is no way of setting FOV, it means that it's impossible to try to do what I'd like to do.

The second addWeaponItem is needed, so that you can use the +/- for zooming in (I really wish I knew why that's the case, doesn't make sense in the slighest - I guess it's some sort of reset).
setOpticsMode is too dumb to use the magnification level defined in the config.

So it's either we lose magnification restoration or we can add this - therefore I'm closing this.

@johnb432 johnb432 closed this Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants