Bots Remove from room

Support for MFPS 2.0 (for verified users)
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
User avatar
Murilom84
Member
Member
Posts: 12
Joined: Thu Mar 12, 2020 7:24 am

Hello everyone,

When master client disconnect from room all bots remove in room , i don't want bots deleted from room

how can I do it?

Thanks.
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

on bl_Lobby.cs -> in the functions: CreateRoom() and OnNoRoomsToJoin() -> change this line:

Code: Select all

CleanupCacheOnLeave = true,
with:

Code: Select all

CleanupCacheOnLeave = false,
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
Murilom84
Member
Member
Posts: 12
Joined: Thu Mar 12, 2020 7:24 am

Thank you for the feedback , but after making this change "CleanupCacheOnLeave = false" 3 errors are returned

1- bl_AIManager.cs Line 160 = if (agent.AITeam == Team.None) { Debug.LogError("This bot has not team"); }

2- bl_PlayerSync.cs Line 288 = RemotePlayerName = photonView.Owner.NickName;

3-bl_GameManager.cs Line 516 = if (OthersActorsInScene.ActorView != null && OthersActorsInScene.ActorView.Owner.ActorNumber == player.ActorNumber)

how can i fix them
User avatar
Murilom84
Member
Member
Posts: 12
Joined: Thu Mar 12, 2020 7:24 am

Thank you, I solved the problem
User avatar
farizakbarov
New Member
New Member
Posts: 6
Joined: Mon Nov 25, 2019 7:46 am

Murilom84 wrote: Fri Mar 13, 2020 6:37 am Thank you, I solved the problem
How did you do it? I need help too.
User avatar
farizakbarov
New Member
New Member
Posts: 6
Joined: Mon Nov 25, 2019 7:46 am

Murilom84 wrote: Thu Mar 12, 2020 11:21 pm


2- bl_PlayerSync.cs Line 288 = RemotePlayerName = photonView.Owner.NickName;
I couldn't solve these problem
User avatar
Murilom84
Member
Member
Posts: 12
Joined: Thu Mar 12, 2020 7:24 am

farizakbarov wrote: Fri Mar 13, 2020 6:41 am
Murilom84 wrote: Fri Mar 13, 2020 6:37 am Thank you, I solved the problem
How did you do it? I need help too.


I did it with a little change. There is a slight delay but the game continues from where it left off.

Code: Select all

 public void OnMasterClientSwitched(Player newMasterClient)
    {
        Debug.Log("The old masterclient left, we have a new masterclient: " + newMasterClient.NickName);
        this.GetComponent<bl_ChatRoom>().AddLine("We have a new masterclient: " + newMasterClient.NickName);

        if(PhotonNetwork.CurrentRoom.CustomProperties.ContainsKey("withbots"))
        {
            bl_AIMananger.Instance.BotSpawn();
        }
       
    }
User avatar
Murilom84
Member
Member
Posts: 12
Joined: Thu Mar 12, 2020 7:24 am

CleanupCacheOnLeave = true,


you shouldn't change this code either
User avatar
farizakbarov
New Member
New Member
Posts: 6
Joined: Mon Nov 25, 2019 7:46 am

Murilom84 wrote: Fri Mar 13, 2020 6:49 am
farizakbarov wrote: Fri Mar 13, 2020 6:41 am
Murilom84 wrote: Fri Mar 13, 2020 6:37 am Thank you, I solved the problem
How did you do it? I need help too.


I did it with a little change. There is a slight delay but the game continues from where it left off.

Code: Select all

 public void OnMasterClientSwitched(Player newMasterClient)
    {
        Debug.Log("The old masterclient left, we have a new masterclient: " + newMasterClient.NickName);
        this.GetComponent<bl_ChatRoom>().AddLine("We have a new masterclient: " + newMasterClient.NickName);

        if(PhotonNetwork.CurrentRoom.CustomProperties.ContainsKey("withbots"))
        {
            bl_AIMananger.Instance.BotSpawn();
        }
       
    }
Thank you. I'll test it right away.
User avatar
farizakbarov
New Member
New Member
Posts: 6
Joined: Mon Nov 25, 2019 7:46 am

farizakbarov wrote: Fri Mar 13, 2020 6:51 am
Murilom84 wrote: Fri Mar 13, 2020 6:49 am
farizakbarov wrote: Fri Mar 13, 2020 6:41 am
How did you do it? I need help too.


I did it with a little change. There is a slight delay but the game continues from where it left off.

Code: Select all

 public void OnMasterClientSwitched(Player newMasterClient)
    {
        Debug.Log("The old masterclient left, we have a new masterclient: " + newMasterClient.NickName);
        this.GetComponent<bl_ChatRoom>().AddLine("We have a new masterclient: " + newMasterClient.NickName);

        if(PhotonNetwork.CurrentRoom.CustomProperties.ContainsKey("withbots"))
        {
            bl_AIMananger.Instance.BotSpawn();
        }
       
    }
Thank you. I'll test it right away.
I've tried. Sorry, it didn't work correctly. the bots are spawning again. Other players understand this. Scores and names don't work properly.
Post Reply