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

fix updating flashlight fx after attachment switch #1154

Merged
merged 3 commits into from
Jun 7, 2019

Conversation

tbeswick96
Copy link
Contributor

@tbeswick96 tbeswick96 commented Jun 2, 2019

When merged this pull request will:

  • Move adding of next attachment to next frame
  • Move switched localEvent to next frame (after add**Item)
  • Allows different flashlight modes to be used and update properly when switching
  • Currently switching from one flashlight to another in the same frame whilst the flashlight is on causes the light effect not to update to the new flashlight

- Moves adding of next attachment to next frame
- Allows different flashlight modes to be used and update properly when switching
- Currently switching from one flashlight to another in the same frame whilst the flashlight is on causes the light effect not to update to the new flashlight

Question: Would the localEvent need to be moved into the next frame as well?
@tbeswick96
Copy link
Contributor Author

Video to show:
https://www.youtube.com/watch?v=AgkcpN-At0Q

Shows normal flashlight on, switching to far causes no effect change.
Switching to far then off then on causes effect change.

ExecNextFrame forces the effect to refresh

@dedmen
Copy link
Contributor

dedmen commented Jun 4, 2019

switching from one flashlight to another in the same frame whilst the flashlight is on causes the light effect not to update to the new flashlight

ugh.. Arma.

Near/Far flashlight is a nice idea, is your mod for that public or do you play to propose that to ACE?

Copy link
Contributor

@dedmen dedmen left a comment

Choose a reason for hiding this comment

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

I don't like the use of # and the missing spacing around it, and the missing naming inside the piece of code.
But it's just a one liner and it's really obvious what's happening so it doesn't matter.

@tbeswick96
Copy link
Contributor Author

Wasn't planning on making the far flashlights part of ace, I lumped them onto a 3CB flashlight/ir combo

Any thoughts on the localEvent?

@dedmen
Copy link
Contributor

dedmen commented Jun 4, 2019

Any thoughts on the localEvent?

Oops missed that. I think it should. People may use it to re-replace the item or detach it or whatever. Would be weird if it's not there yet.

@tbeswick96
Copy link
Contributor Author

@dedmen Do you think this is ok? https://github.com/CBATeam/CBA_A3/pull/1154/files#diff-73655685f2cbb36065c6caf471ec6630R75
Should run after the adds as it's added after right?

@dedmen
Copy link
Contributor

dedmen commented Jun 4, 2019

Also the event says "switched" in past tense. So it has to fire after.
Yes, nextFrame EH's run in order they were added.

@commy2
Copy link
Contributor

commy2 commented Jun 4, 2019

Currently switching from one flashlight to another in the same frame whilst the flashlight is on causes the light effect not to update to the new flashlight

I don't get it. The same frame as what else exactly? The flashlight being on? Is the flashlight being turned off anywhere here?

@tbeswick96
Copy link
Contributor Author

tbeswick96 commented Jun 4, 2019

Switching in this context means removing one attachment and adding another. When both of the attachments are flashlights and the flashlight is on, the light effect of the new flashlight does not update unless you manually turn the light off and on after switching. This is because the remove and add are done in the same frame

@commy2 commy2 added this to the 3.12 milestone Jun 4, 2019
@commy2 commy2 added the Bug Fix label Jun 4, 2019
@commy2 commy2 changed the title Add next attachment in next frame fix updating flashlight fx after attachment switch Jun 4, 2019
@commy2
Copy link
Contributor

commy2 commented Jun 4, 2019

What happens if you hold down the key with this change? (switch attachment every frame. multiple times per frame)?

Should be possible I guess, because the current attachment is removed immediately, but would test anyway.

@tbeswick96
Copy link
Contributor Author

Holding the key down just switches once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants