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

[SA:DE] 0A69 crashes in JS script #12

Open
x87 opened this issue Dec 1, 2021 · 2 comments
Open

[SA:DE] 0A69 crashes in JS script #12

x87 opened this issue Dec 1, 2021 · 2 comments
Labels
remasters The Trilogy: The Definitive Edition type:bug Something isn't working

Comments

@x87
Copy link
Contributor

x87 commented Dec 1, 2021

Calling

/// <reference path=".config/sa.d.ts" />
Widget.CreateShopMenu('IE09')

crashes the game with error

ErrorMessage>LowLevelFatalError [File:Unknown] [Line: 970] 
Node /Game/SanAndreas/Textures/mobile/T_shop_barber_BC 0 Package_LoadSummary    has zero prerequisites, but has not been queued.

Same command works when in a CS script

{$CLEO}
{$USE ios}
{$O 0C05=0,terminate_this_custom_script }

0A69: create_shop_widget_menu "IE09"
0C05: terminate_this_custom_script 
@x87 x87 added the type:bug Something isn't working label Dec 1, 2021
@x87 x87 changed the title 0A69 crashes in JS script [SA:DE] 0A69 crashes in JS script Dec 1, 2021
@x87
Copy link
Contributor Author

x87 commented Dec 1, 2021

note:

if I have both CS script and JS script with 0A69 and let CS run first (by adding wait command before Widget.CreateShopMenu in a js script), both would work with no crash.

@x87 x87 added the remasters The Trilogy: The Definitive Edition label Dec 3, 2021
@x87
Copy link
Contributor Author

x87 commented Dec 8, 2021

This can be a technical limitation for now. Creating widgets requires running in the main thread (it appears that they use thread local storage for queuing resources?) and JavaScript VM currently runs in a separate thread. If I run a JS script with Widget.CreateShopMenu('IE09') on the main thread it works fine.

CS scripts run on the main thread and there is no issues with widgets.

I will look into possible workarounds, but can't promise anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
remasters The Trilogy: The Definitive Edition type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant