Add setVehicleNitroColor, getVehicleNitroColor and resetVehicleNitroColor#4945
Open
TheCrazy17 wants to merge 4 commits into
Open
Add setVehicleNitroColor, getVehicleNitroColor and resetVehicleNitroColor#4945TheCrazy17 wants to merge 4 commits into
TheCrazy17 wants to merge 4 commits into
Conversation
Allows scripts to recolour a vehicle's nitro flames per-vehicle (client and server side, synced via a new element RPC). The shared "nitro" FX blueprint's colour keyframes are re-tinted just-in-time as each vehicle's particles are rendered, using the original keyframes as a brightness envelope so any colour (including white) fully replaces the default cyan hue. No colour set means the original effect colours are used.
- While a custom colour is applied, the nitro emitters switch from additive to standard alpha blending (restored on reset), so the requested colour renders exactly - dark colours and black included - instead of fading out as the additive contribution approaches zero. - setVehicleNitroColor now accepts an optional alpha (r, g, b [, a = 255]) that scales the effect's alpha keyframes, preserving the flame's fade animation; getVehicleNitroColor returns r, g, b, a. - The nitro colour is now included in the vehicle's entity-add data, so players who join (or stream the vehicle in) after the colour was set see it correctly instead of the default colours.
A vehicle's nitro FX systems are destroyed deferred by the game (they fade out first), so destroying a vehicle left its entries in the nitro system map pointing at a deleted CVehicleSA, and the render hook then called a virtual function on it (pure virtual call -> 0xC0000409). Unregister the vehicle's nitro systems in the CVehicleSA destructor, so entries are removed when either side is destroyed first.
Xenius97
suggested changes
Jun 11, 2026
Contributor
|
By the way, it looks good, but for the new features, the |
Converts setVehicleNitroColor, getVehicleNitroColor and resetVehicleNitroColor on both client and server from the legacy CScriptArgReader pattern to the new ArgumentParser, as requested in review.
Author
Thanks for pointing that out! All three functions now use ArgumentParser (client + server), done in 6b704a7. Good to know for future PRs! |
Contributor
|
It looks good to me, but I’m not going to accept it yet, let’s wait for the experts. Nice work! 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds per-vehicle nitro flame colour customization, available on both client and server and synced to all players:
OOP:
vehicle:setNitroColor(...),vehicle:getNitroColor(),vehicle:resetNitroColor().Video
Technical approach:
FxEmitterBP_c::Render). The original keyframes are cached and used as a brightness envelope, so the requested hue fully replaces the default cyan; vehicles without a custom colour keep the exact default look.Motivation
The nitro flame colour is hardcoded in the shared FX blueprint. The only workaround today is replacing the effect texture or using shaders, which affects every vehicle globally - there is no way to give each vehicle its own nitro colour. This is a frequently requested customization feature for tuning, race and DM servers.
Test plan
Tested with a resource that spawns 10 vehicles with random nitro colours (half of them also with random alpha), nitro added and activated:
resetVehicleNitroColorrestores the exact default look (original keyframes and additive blending).CVehicleSAdestructor.Checklist