Author Topic: First level doesnt change  (Read 2313 times)

choarrim

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
First level doesnt change
« 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??

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: First level doesnt change
« Reply #1 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.

choarrim

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: First level doesnt change
« Reply #2 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?

choarrim

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: First level doesnt change
« Reply #3 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 :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: First level doesnt change
« Reply #4 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.