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

Add spawnFlyingComponent & breakGlass arguments for setVehiclePanelState #3572

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented Jul 15, 2024

This PR adds the spawnFlyingComponent argument (defaulting to true) to setVehiclePanelState, similar to what is available in setVehicleDoorState. Additionally, the PR introduces the feature to shatter the windscreen if windscreen_panel is set to 3; currently, the windscreen simply disappears.

Added breakGlass argument.

bool setVehiclePanelState(vehicle theVehicle, int panelID, int state [ , bool spawnFlyingComponent = true, bool breakGlass = false ] )

https://streamable.com/uxpph6

This PR helps avoid frustrating situations, such as when managing a garage of vehicles and changing their models.
image

Closes #2122

@Fernando-A-Rocha
Copy link
Contributor

Well done!

@tederis tederis added the enhancement New feature or request label Jul 17, 2024
@FileEX FileEX changed the title Add spawnFlyingComponent for setVehiclePanelState & add windscreen shatter Add spawnFlyingComponent & breakGlass arguments for setVehiclePanelState Jul 17, 2024
@FileEX
Copy link
Contributor Author

FileEX commented Jul 17, 2024

I added the breakGlass argument because the glass component does fall out (but it is poorly visible and falls underground). To maintain backward compatibility, the glass will fall out as before. If breakGlass is set to true, the glass will not fall out but will break as in the video.

Copy link
Contributor

@Proxy-99 Proxy-99 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Fernando-A-Rocha
Copy link
Contributor

#3592 already adds spawnVehicleFlyingComponent so i think this PR should only add breakGlass ?

@FileEX
Copy link
Contributor Author

FileEX commented Nov 6, 2024

#3592 already adds spawnVehicleFlyingComponent so i think this PR should only add breakGlass ?

The spawnVehicleFlyingComponent function allows you to create components, while the argument in the setVehiclePanelState function allows you to avoid creating them. By default, after calling the function, for example, the bumper is flying, which I showed in the screenshots and it can be annoying. It works exactly the same way as in the case of setVehicleDoorState. This argument is not intended to spawn components, but to not spawn them if someone does not want it, because they are spawned by default

@Fernando-A-Rocha
Copy link
Contributor

Sorry for the misunderstanding. You are right, this PR is ok

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

Successfully merging this pull request may close these issues.

Add spawnFlyingComponent for setVehiclePanelState
5 participants