How player can go back to main menu
by Ocwarts · in Torque 3D Beginner · 10/16/2012 (2:30 am) · 5 replies
Hi,
I made a game level. I create a trigger in the level and what i want is that when player hit the trigger the level should end and the player reach back to main menu of the game so he/she can select another level to play.
How can i do it.
Thanks
I made a game level. I create a trigger in the level and what i want is that when player hit the trigger the level should end and the player reach back to main menu of the game so he/she can select another level to play.
How can i do it.
Thanks
#2
10/16/2012 (5:52 am)
Many many thanks.
#3
10/16/2012 (6:43 am)
Hello I tried disconnect(); function but it simply crash the game. Still unable to reach main menu.
#4
Disconnect(); will do the first part. Then You'll want to have a look at function disconnectCleanup(). This is where the post disconnect functioning is located. Recode the function to point the client to the menu you want, and you'll be in good shape.
As for the crash, I have a feeling you might be trying to use disconnect() inside the trigger, which is what would do this. Instead, have the trigger send a clientCmd to the client inside the trigger, and on the client side, code this clientCmd to disconnect your client from the server.
10/16/2012 (7:04 am)
You want to first close your current connection to the server.Disconnect(); will do the first part. Then You'll want to have a look at function disconnectCleanup(). This is where the post disconnect functioning is located. Recode the function to point the client to the menu you want, and you'll be in good shape.
As for the crash, I have a feeling you might be trying to use disconnect() inside the trigger, which is what would do this. Instead, have the trigger send a clientCmd to the client inside the trigger, and on the client side, code this clientCmd to disconnect your client from the server.
#5
Will it be possible for you to kindly show me how to code this.
Regards
10/16/2012 (9:04 pm)
Hello Robert,Will it be possible for you to kindly show me how to code this.
Regards
Ahsan Muzaheed
Default Studio Name
it will do the work for u.