NativeMultiplayer: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 21: Line 21:
* Using native multiplayer mode presents a challenge when trying to script a gamemode that needs to track elements. For example, a roleplay server might provide vehicle ownership but if the server doesn't know the vehicle exists, tying that data to the vehicle would be an issue. You could tell a client to spawn it, then report back with the newly spawned vehicle's ID, but as soon as the session is destroyed and/or another one is created, those ID's are useless. The ID's also change if the element is streamed out for everybody and no client has it in memory anymore. If you need to attach persistent data to an element, you should disable native multiplayer on your server
* Using native multiplayer mode presents a challenge when trying to script a gamemode that needs to track elements. For example, a roleplay server might provide vehicle ownership but if the server doesn't know the vehicle exists, tying that data to the vehicle would be an issue. You could tell a client to spawn it, then report back with the newly spawned vehicle's ID, but as soon as the session is destroyed and/or another one is created, those ID's are useless. The ID's also change if the element is streamed out for everybody and no client has it in memory anymore. If you need to attach persistent data to an element, you should disable native multiplayer on your server


* Using native multiplayer mode, you can't force players to create or join specific sessions (also called lobbies) with scripting. Each session has a player hosting it. Even if you have the phone disabled, the game might still place some players in different sessions with different hosts, and they won't be able to see players from another session. If you're trying to script a gamemode that needs everybody in the same "world" then you should disable native multiplayer on your server.
* When using native multiplayer mode, you can't force players to create or join specific sessions (also called lobbies) with scripting. Each session has a player hosting it. Even if you have the phone disabled, the game might still place some players in different sessions with different hosts, and they won't be able to see players from another session. If you're trying to script a gamemode that needs everybody in the same "world" then you should disable native multiplayer on your server.


* If you want to use elements in the same way as other GTA multiplayer mods, or the older games here on GTA Connected, you'll need to turn off native MP mode in server config. This will force GTAC to use it's own custom sync. Servers will be aware of elements and all can be handled using either GTAC functions or natives, although natives will only exist client-side.  
* If you want to use elements in the same way as other GTA multiplayer mods, or the older games here on GTA Connected, you'll need to turn off native MP mode in server config. This will force GTAC to use it's own custom sync. Servers will be aware of elements and all can be handled using either GTAC functions or natives, although natives will only exist client-side.  
Line 29: Line 29:
* The [element.id|element.id] is part of GTAC's own element handling and doesn't not work on native multiplayer mode. If you're using native multiplayer mode, you will need to use natives to get the ID of an element.
* The [element.id|element.id] is part of GTAC's own element handling and doesn't not work on native multiplayer mode. If you're using native multiplayer mode, you will need to use natives to get the ID of an element.


* Using native multiplayer mode, the server doesn't know how to read the sync packets, and only passes them along '''as-is'''. Any references to elements in this mode is handled by the games themselves.
* When using native multiplayer mode, the server doesn't know how to read the sync packets, and only passes them along '''as-is'''. Any references to elements in this mode is handled by the games themselves.
2,599

edits