[Lua] Cannot push vector3 value instead of x, y, z in native functions

  1. Client both, FxServer 3922 on Windows Server 2019
  2. Correctly working pushing vector3 into native functions as coords (and the like)
  3. Vector3 are readen as single parameter instead of 3 (x, y, z) in native functions eg. AddBlipForCoords, DrawMarker etc.
  4. Lua interpreter bug?

A day ago this way of calling natives works correctly.
Now most of my scripts must be fixed.

Do your scripts have use_fxv2_oal enabled? Otherwise, can you paste a quick repro?

Yes, this option was enabled. Without it, everything works fine. Below is a piece of code for reproduction.

image

blipData:
image

Another undocumented/experimental feature that was changed on you. :frowning:

The OAL changes are designed to be as optimized as possible when passing/converting arguments from Lua to the native script handler. Including eliminating most branching. Unfortunately, it is difficult to support implicit vector unrolling in a branchless (or near-branchless fashion) without running into other issues.

Reminder to myself: as LuaArgumentParser only works on positive Lua stack indices, double check whether the extreme inlining correctly eliminates dead code.

1 Like

OAL never supported vector unpacking, however. How can this have worked before, and what made this person enable it in the first place given this forum post is the only result on the forums so far, there’s no mention on the Cfx.re Discord either (other than after these changes), and Google isn’t returning anything but our own code on GH?

From what I understand, as natives with vectors/floats were considered unsafe they would use the fallback/lazy implementation and there would be no issue. Although, I am surprised this was not reported sooner given these changes have been on canary for a month.

At least we have confirmation some people actively monitor the github commit logs. :slight_smile:

Huh, there was a second implementation of OAL behind the same flag?

1 Like

fix(lua): revive temp-OAL with nil and SEH · citizenfx/fivem@0fd0b2b · GitHub This?

Thank you for help. Sorry for making problems :man_shrugging:.
I think i love experimental features in lua interpreter :smiley: