fsVfxSetWorldPosition, fsVfxSetRotation throwing exceptions

Version: 1.6.31.0

Frequency: Consistently

Severity: Blocker

Context: in a WASM module, after injecting a particle effect at a lat/lon in the world

Bug description: The following Exception gets thrown when trying to relocate an effect

Exception thrown at 0x00007FF7D0A6B3E3 in FlightSimulator2024.exe: 0xC0000005: Access violation writing location 0x0000000000000070.

Repro steps:

  1. Inject an effect using id = fsVfxSpawnInWorld
  2. Call fsVfxSetWorldPosition(id...) or fsVfxSetRotation(id...)to relocate the effect

Follow-up question: Do you guys have test coverage for those WASM functions?

Hello @runshotgun ,

I tried modifying the Sample VFX Aircraft to add fsVfxSetWorldPosition and fsVfxSetRotation, and so far I haven’t been able to reproduce an exception.

Do you see any related messages in the console?

Could you send us your project, or at least a minimal sample that reproduces the issue, please?
See 3) Provide Private Content

Thank you

Regards,
Boris

It seems like I can’t reproduce the issue on the latest build either.
Reviewing this but consider it solved for now

1 Like

Ok

Thank you for the feedback

Regards,
Boris

Scratch that, I had the 2 lines disabled in my code. The issue is reproducible. File send in Private Content.

Hi @runshotgun ,

I was able to reproduce the freeze using your code and logged an issue.

However :

In the code, you initialize
L.35 : FsVfxId effect_uid = -1;

Any reason not to use FSVFXID_NULL instead?
FSVFXID_NULL is 0xffffffff
I may be wrong but if fsVfxSpawnInWorld() fails and returns FSVFXID_NULL, your later check if (effect_uid > -1)will be true and you will be calling fsVfxSetWorldPosition / fsVfxSetRotation. That could explain the freeze/crash.

I think you should/could use fsVfxIsValid(effect_uid) instead.

Regards,
Boris

1 Like

Thanks for the heads up!
We’ll put in those changes.

1 Like

Hello @runshotgun

This is fixed in SU5 Beta. This does not require any change on the module side.
Let us know if this is good for you.

Regards,
Sylvain

1 Like

All working here, thanks for the fix!!

This topic has been automatically closed after 60 days of inactivity since it was marked as fixed.

If there is important new information about this same report, you can use the “Request reopen” button below to ask the moderation team to review it again.
For other issues or broader discussion, please open a new topic in the appropriate category.