Skip to content

Add new function spawnVehicleFlyingComponent #3592

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

Merged

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented Jul 21, 2024

Closes #2121 and probably #2128

This PR adds a new function spawnVehicleFlyingComponent. With this function, we can spawn falling components along with their physics. This enables the creation of realistic scenarios such as car accidents on servers, advanced systems like potholes in roads, and more.
Example video: https://www.youtube.com/watch?t=71&v=B5relHf21lo&feature=youtu.be

Once the PR is merged, I will create full documentation on the wiki for various nodes for vehicle classes.

Syntax

bool spawnVehicleFlyingComponent(element vehicle, number nodeIndex [, number collisionType, number removalTime ] )
  • nodeIndex - Specifies the component to be created (ranging from 1 to 25). Depending on the vehicle, these can be different components such as wheels, fenders, bicycle handlebars, helicopter propellers, train carriages, and many more.
  • collisionType - Specifies the type of collision for the component, by default it is selected based on the nodeIndex.
0 - COL_BUMPER
1 - COL_WHEEL
2 - COL_DOOR
3 - COL_BONNET
4 - COL_BOOT
5 - COL_PANEL
  • removalTime - The time in milliseconds after which the created component will be removed (it must be removed as it is a temporary object).

The limit for temporary objects with this function is 150, and their default removal time depends on their quantity (unless we set our own via the removalTime parameter).

@tederis tederis added the enhancement New feature or request label Jul 22, 2024
@tederis
Copy link
Member

tederis commented Sep 12, 2024

@FileEX Please, resolve the conflicts.

@FileEX
Copy link
Contributor Author

FileEX commented Sep 12, 2024

@FileEX Please, resolve the conflicts.

Done

Copy link
Member

@tederis tederis 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

@TheNormalnij TheNormalnij merged commit 9f54cfc into multitheftauto:master Oct 8, 2024
6 checks passed
MTABot pushed a commit that referenced this pull request Oct 8, 2024
9f54cfc Add new function spawnVehicleFlyingComponent (#3592)
@FileEX FileEX deleted the feature/vehicle_flyingcomponents branch October 8, 2024 11:59
@FileEX FileEX restored the feature/vehicle_flyingcomponents branch October 12, 2024 22:22
Dutchman101 pushed a commit that referenced this pull request Oct 13, 2024
MTABot pushed a commit that referenced this pull request Oct 13, 2024
@TheNormalnij
Copy link
Member

TheNormalnij commented Oct 15, 2024

@FileEX documentation

@FileEX
Copy link
Contributor Author

FileEX commented Oct 15, 2024

@FileEX documentation

It's already done

@kxndrick0
Copy link

add wiki example

@TheNormalnij
Copy link
Member

It's already done

A link was missing in the template. I've added it

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.

Implement spawnFlyingComponent in a function, like makeVehicleComponentFly()
5 participants