AI Core

ai-loading for developers

ai-loading has no exports or events. How its data reaches the page, for people who build their own loading screen.

ai-loading has no exports, events or state bags. It is a FiveM loadscreen page with a small server part.

How the data reaches the page

A loading screen cannot receive NUI messages from a client script (no client script runs yet). ai-loading uses the only channel there is, the connection handover:

  1. When a player connects, ai-loading's server answers playerConnecting with deferrals.handover({ aiLoading: view }).
  2. The page reads window.nuiHandoverData.aiLoading when it opens.

The aiLoading object:

Prop

Type

Handovers of several resources are merged by FiveM, so your own loading screen resource can add its own key next to aiLoading.

Closing

ai-loading's manifest has loadscreen_manual_shutdown 'yes'. AI Core's character screen closes the loading screen (ShutdownLoadingScreenNui) once its scene stands. If you replace ai-loading with your own loading screen, use the same manifest line, or the game closes your screen as soon as the map loads and players see the empty world before the character screen.

On this page