Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM2020] CopyPaste_GetLightmapQualityInSelection_Results return wrong value #5

Open
AmazingBeu opened this issue Oct 6, 2021 · 3 comments
Labels
bug Something isn't working external library Needs changes in an external library

Comments

@AmazingBeu
Copy link

CopyPaste_GetLightmapQualityInSelection_Results should return a MwFastBuffer<CGameEditorPluginMap::EMapElemLightmapQuality> but returns something completely inconsistent like 1128792064, 100991744 or 1124102767 and this value seems to change depending on the number of blocks placed on the map etc...

the Lightmap Quality plugin has a commented code part that allows to display in the openplanet logs the return of each value of the MwFastBuffer
to do this, simply uncomment the code part, and select blocks in the editor with the copy and paste tool, with the plugin open

and this should not be a bug of the game, because it's in this same context that this function is used in a Maniascript editor plugin

don't hesitate if you need more precision

@codecat codecat modified the milestones: 1.20.1, 1.21.0 Oct 6, 2021
@codecat
Copy link
Member

codecat commented Oct 6, 2021

This is currently an Angelscript limitation, see: https://www.gamedev.net/forums/topic/699287-enum-size/

In theory, you could get the actual value of the elements by doing something like uint32(arr[0]) & 0xFF, and the value of the second item by doing (uint32(arr[0]) & 0xFF00) >> 8.

Note that the Length property in this case doesn't have anything to do with the indexer in this case, but just to the amount of bytes. The size of returned items is always 4 bytes (eg. 4 items).

I don't recommend hacking around this though, there seems to be a high amount of requests for this over on the Angelscript forum (even though the thread was locked), so I'll open another thread with more interest, also linking to this issue.

Edit: Here's the new thread: https://www.gamedev.net/forums/topic/710930-enum-size-continuation/

@codecat codecat added bug Something isn't working external library Needs changes in an external library labels Oct 6, 2021
@codecat codecat removed this from the 1.21.0 milestone Dec 5, 2021
@AmazingBeu
Copy link
Author

Still not fixed i guess ?

@codecat
Copy link
Member

codecat commented Feb 13, 2022

Unfortunately not, as far as I'm aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external library Needs changes in an external library
Projects
None yet
Development

No branches or pull requests

2 participants