Closed gromchek closed 1 year ago
Seeing as this also disables rendering for non-fire particles I wonder if renaming it do Disable FX
or similar might be a better idea instead?
That or only hooking the calls/jumps that are fire related
Seeing as this also disables rendering for non-fire particles I wonder if renaming it do
Disable FX
or similar might be a better idea instead?
Car's sparks are displayed, blood is displayed (when hit by a weapon), sparks are also displayed when the player shoots at a car or to the ground. So not all of the particles are disabled.
I checked FxManager_c::Render. This may disable all particle rendering (probably).
So not all of the particles are disabled.
Hmm but the spraycan isn't really fire, neither is the fire extinguisher... smoke on a rooftop and car's smoke I can still get behind but yeah
Alright, so checking where FxSystem_c::Play
is being called from brings up a bunch of locations.
Would you be fine with cherry-picking which ones we might need from those?
I notice the very first one is CRunningScript::ProcessCommands
which means it's an opcode - you can check on opcodes here:
https://library.sannybuilder.com/#/sa
I can also see 3 calls in CAutomobile::DoNitroEffect
- I'm not sure if we'd want those disabled since they might not be considered "fire"
Also: There's an IDA plugin called LazyIDA which allows you to click on a function call and press W to copy the address it's at into your clipboard. Makes copying addresses much easier
Now I did it in right way.
Deep inside in FxManager_c::CreateFxSystem
the game looks up the particle by hash (CKeyGen::GetUppercaseKey
).
I thought I could disable particle rendering if the hash matches and it worked.
These effects are disabled:
fire_bike 2287826537
fire_car 4166829922
overheat_car 445182679
overheat_car_electric 1046403207
https://gtamodding.ru/wiki/Визуальные_эффекты_в_скриптинге#San_Andreas here a list of special effects.
So if in the future we want to disable other particles, we should just calculate the hash.
auto hash = CKeyGen::GetUppercaseKey("fire_bike"); //2287826537
Could you maybe add a comment next to the hash in the invalidHashes
list so we know what effects those are?
Also same-line return for the if (hash == fx->m_nNameKey)
line
Also renaming the static Hook
method to something like... Hooked_FxManager__CreateFxSystem
or similar
Besides that it looks alright to me.
Is this effect working correctly for you?
Engine fires are working correctly, but other fires are still visible. Except for one time after playing for a while those fires were invisible too, even when the effect wasn't active.
This effect disable rendering motobike and car smoke/fire effect only. Plane's smoke/fire is still visible.
@Jersukai can you please write how to reproduce this:
Except for one time after playing for a while those fires were invisible too, even when the effect wasn't active.
It should disable fire on ground too, right?
I don't know, It happened only that one time.
@Jersukai sorry for late answer. The fire on the ground should work as usual.
This disables rendering most of game particles: smoke grenades, explosions, fire (car's fire, fire on ground, ped's, jetpack/hydra nozzle), spraycan, fire extinguisher, smoke on a rooftop (while Riot effect is enabled), car's smoke