Version: 1.37.2.0
Frequency: Consistently
Severity: Blocker
Context: checking if an effect is playing on a non-ego aircraft (ai)
Bug description: Testing the effect with fsVfxIsInstancePlaying
always returns false even if the effect is currently playing. Additional testing reveals that none of the other functions work for effects attached to non-ego simobjects. It’s not possible to move or despawn the effect either.
Repro steps:
- Inject an effect on a non-ego SimObject
- Run fsVfxIsInstancePlaying with the ID returned from the creation of the effect.
Hello @runshotgun
When you say the effect “is currently playing”, you mean the ai is in visual range and you see the effect?
Regards,
Sylvain
Yes it was in visual range and the particles are emitting (camera was right next to it)
1 Like
Hello @runshotgun
We are not able to replicate this issue yet.
Here’s a modified version of the Spawn.cpp file from the VFXAircraft sample.
Spawn.cpp (15.2 KB)
It adds a button to spawn effects on nearby AIs. fsVfxIsInstancePlaying and fsVfxSetOffset are called continuously on these effects and are behaving as expected in our test scenario.
If you have a sample that demonstrate your problem, send it and we’ll have a look.
Regards,
Sylvain
1 Like
Thank you for the sample and the time it took to create it. Please make it part of the samples
I walked through your code to try and find the issue on my end and threw a few things at the wall.
TLDR, it works as expected, it was an error on my side.
The issue was, I am using a vector<pair<int, FsVfxId>> objects;
to track object and vfx id pairs.
I was using (not working):
if (!fsVfxSetOffset(objects[i].second, { 0,0,0 })) {
and now (working):
FsVfxId effect_id = objects[i].second;
if (!fsVfxSetOffset(effect_id, { 0,0,0 })) {
The joys of C++.