-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Add event on SA world map loaded #1578
Comments
Hmm. Would this event fire when you teleport for away and the world around your new position needs to stream in? I know the freeroam resource does some trickery to ensure that you don't fall through the ground when you teleport far away. |
This function/event shouldn't be attached to collision, it's to check if all original SA world model data has loaded, which happens shortly after connecting to a server for the first time (see CModelInfoSA::IsLoaded). Therefore, this event would only fire once. Further usage context: you want to show part of the SA map when a client joins your server, but it looks bad when the world models slowly load in - with the proposed function/event you'd be able to ensure all world models are fully loaded before fading the camera in. When you load MTA and connect to a server for the first time - MTA has to load all SA world model data, the speed of which depends on client hardware (could possibly take 10+ seconds). Obviously, models that haven't been loaded yet will not be visible. Once all SA world models have loaded, you can travel from point A to point B (which can be as far as you like) then back to point A, and the model should be instantly visible (at least that's what I found from my testing). You can disconnect from the server and connect to another server - SA world models should still be instantly visible (as their data is already loaded). I've uploaded a camera resource which includes a test script to replicate this (https://github.com/Lpsd/CameraManager)
|
It's not necessarily occurs just first time. It's highly depends on your PC configuration and streaming setup. Every time an object loads the game checks is there enough space for it. Otherwise others will be immediately unloaded until enough amount of free space reached. So for some PC configurations the same model will requires a loading twice and more times. |
There's currently no way to know if the SA world map has loaded.
Upon a client first launching the game and connecting to a server, if the server sets the camera position to look anywhere on the map (and fades in the camera) it may take a few seconds for models to be loaded/displayed.
iirc (confirmation needed) all SA map models are loaded when first connecting to a server, and they'll remain "loaded" even when disconnecting and joining another server. If that's the case, we'd need a function to know whether the SA world has loaded, and an event (such as
onWorldMapLoaded
) to know when they've loaded.Proposed usage:
The text was updated successfully, but these errors were encountered: