Single player/ multiplayer

Posted By: Truth

Single player/ multiplayer - 04/13/20 11:13

Hi,

I am trying to turn my game into multiplayer but still allow single player too. My problem is I need the level to load before the menu otherwise it will crash, so is there anyway to session_connect after the level has been loaded? the only way I can make the multiplayer connect is if it is set before the menu so if the user selects single player it doesn't work as the engine is already in multiplayer mode. Or is there a way to disconnect from the server after the level has loaded and the user selects single player mode?

example

1. session_connect > level_load > menu selection > *user selects multiplayer* = SUCCESSFUL
2. session_connect > level_load > menu selection > *user selects single player* = FAILED
3. level_load > menu selection > *user selects single player* = SUCCESSFUL
4. level_load > menu selection > *user selects multiplayer* > *session_connect* = FAILED

I've found a slight work around, but is far from ideal. If the user disables their internet connection before doing method 2 then single player works
Posted By: jcl

Re: Single player/ multiplayer - 04/28/20 11:30

Can't you simply load the level again in case 4 after the session_connect?
© 2024 lite-C Forums