How can i do this...?

12/31/2017 18:44 Xenok5#1
Anyone knows a way to increase the maximum group members? Now is 3 i want to increase it to 5 if it's possible.

Like this:

Regards, NosSacred Team.
12/31/2017 19:00 Fizo55#2
Quote:
Originally Posted by Xenok5 View Post
Anyone knows a way to increase the maximum group members? Now is 3 i want to increase it to 5 if it's possible.

Like this:

Regards, NosSacred Team.
opennos.gameobject/networking/servermanager.cs line 1341, 1342, 1343, 1344

Code:
        public bool IsCharactersGroupFull(long characterId)
        {
            return Groups != null && Groups.Any(g => g.IsMemberOfGroup(characterId) && g.CharacterCount == (byte)g.GroupType);
        }
change by

Code:
        public bool IsCharactersGroupFull(long characterId)
        {
            return Groups != null && Groups.Any(g => g.IsMemberOfGroup(characterId) && g.CharacterCount == 5);
        }
01/01/2018 14:32 Xenok5#3
Oh, thank you, but, it increase the gain XP, or it decrease? If you know if it makes any bugg or something i'll be glad to read it xD

PD: Thank you <3
01/01/2018 15:29 BlowaXD#4
Quote:
Originally Posted by Xenok5 View Post
Oh, thank you, but, it increase the gain XP, or it decrease? If you know if it makes any bugg or something i'll be glad to read it xD

PD: Thank you <3
Do not use @[Only registered and activated users can see links. Click Here To Register...] code if you want to run your server correctly, you just have to change the GroupType.
On this code, you fix the amount of players to 5 without considering which GroupType is your group.
Which means that you will run a raid with only 5 guys max. (with hugo's piece of code)

Not recommended solution
Code:
public bool IsCharactersGroupFull(long characterId)
        {
            const int normalGroupMembersCount = 5;
            return Groups != null && Groups.Any(g => g.IsMemberOfGroup(characterId) && 
                (g.CharacterCount == (g.GroupType == GroupType.Group ? normalGroupMembersCount : (byte)g.GroupType)));
        }
Better solution
Code:
public enum GroupType : byte
    {
        Group = 3, // HERE YOU CHANGE GROUP BY YOUR VALUE
        CustomGroup = 6, // HERE YOU ADD ANOTHER GROUP TYPE but, depends on the sources you'r using
        Team = 15,
        BigTeam = 20,
        GiantTeam = 40,
        IceBreaker = 50
    }
Or you can add, as on my code "CustomGroup" but you'll have to change every single call of GroupType.Group in your code to GroupType.CustomGroup.

However, you can too add a property for MaxCharacters that does not change the GroupType enum, it's free to you on that.
There is no "best solution" in your case, there are many way to do it, the fact is you'll require more experience to find a maintainable way to do it.


There are many options, you'r free to use the one you prefer, but do not break your Group class utilities as it's used for raids aswell.

Regards,
Blowa.