Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: choarrim on June 27, 2016, 04:44:33 AM

Title: First level doesnt change
Post by: choarrim on June 27, 2016, 04:44:33 AM
I created my own scene and added the "start" scene to the build settings then added the TN Auto Join and first it constantly connected/disconnected my game, but that seems as if the example scene that has a Auto Join, that triggered as well.

So I removed the auto join from my scene and tried to run the "Example Auto Join" scene and even though the "First Level" was set to "Example AutoSync", TNet still gave a debug error that the Scene "start", which was my scene, was not amongst the Build scenes.

Now I tried to check the "start" scene again (still clean from any TNet scripts). When the Auto Join connects, it still loads my "start" scene instead of the "Example AutoSync" scene.

I have tried to clean the project, restarted the server but nothing seems to work. Where does TNET store this??
Title: Re: First level doesnt change
Post by: ArenMook on June 27, 2016, 06:53:34 AM
In the Example AutoJoin scene there is an object called "AutoJoin". It has a script on it where you set the first level to load. However assuming you kept other values as they are in that example, it has "persistent" flag turned on. Persistent means that the first person to join the channel sets its scene -- and this scene is remembered for the next player to join. Meaning once set, it will remain unless you change it or delete the server.dat file.
Title: Re: First level doesnt change
Post by: choarrim on June 27, 2016, 12:28:37 PM
Yeah that did it. But now when I start the scene it constantly connects/dissconnects all the time????
The Auto Join has the properties:
Server Address: 127.0.0.1
Server Port: 5127
First Level: start
Channel ID: 1
Persistent: true
Disconnect Level: end
Allow UDP: false
Connect on start: true.

I also only have several objects on scene. Tried to have all with TNObjectID, none and mixed but I get the same thing with connect/disconnect/connect/etc...

What am I doing wrong?
Title: Re: First level doesnt change
Post by: choarrim on June 27, 2016, 12:34:49 PM
Hmmm I think I solved it now. May it be due to the fact that I used the autojoin in the same scene as the rest of the game???
If I missed this important part I am sorry but it would be nice to have this confirmed.
If it doesn't exist in the manual for autojoin, maybe it needs to be explained for noobs like me :)
Title: Re: First level doesnt change
Post by: ArenMook on June 27, 2016, 06:09:32 PM
Yes, autojoin needs to be in a separate scene. It will load your proper scene when a connection is established.