The function GEMPGameRules.SetExcludedCharacters(char_list * string) only allows the first 58 chars including commas, after that any characters will be ignored from the exclusion, example:
#58 characters between: (" AND ,oddjob will prevent oddjob and characters after from being excluded.
GEMPGameRules.SetExcludedCharacters("bond,boris,valentin,guard,jaws,infantry,Mishkin,Mayday ,oddjob,ourumov,samedi,female_scientist,006_mi6")
#57 characters between: (" AND ,oddjob will prevent ourumov and characters after from being excluded.
GEMPGameRules.SetExcludedCharacters("bond,boris,valentin,guard,jaws,infantry,Mishkin,Mayday ,oddjob,ourumov,samedi,female_scientist,006_mi6")
I'm not sure how to trace the code it its origin, but I'm guessing this is part of the main compiled code binary, which i have no access to.
Btw, what is the reference string for the "Random" character?
Thanks,
Null
i had to change my reply a little too since you're reply. Luckily, I was planning on choosing characters specifically, but this was kinda driving me crazy because has its own quirks.
Maybe just an update to the comment starting in GEMPGameRules.py #Line: 201 would be suitable.
def SetExcludedCharacters( char_list ):
'''
Exclude characters from being shown on the character select panel.
char_list -- Comma seperated list of character identities (ex. "006_mi6,bond,samedi")
'''
Thanks for the info guys!
Null
Awesome, glad you ask, i have notifications turned off or i would have replied sooner.
player.SetPlayerModel() was actually a little too much fun to test, because if you try and use it directly in OnPlayerSpawn without the right checks SetPlayerModel and/or OnPlayerSpawn gets called like 20 times per player spawn, which will lead to a crash once the gameplay is reloaded with like 20 * player spawns.
This works for teams though (ignore the name, color, levels, kills though):
import random
#Track team levels and kills
self.TEAM_SCORES = {
Glb.TEAM_JANUS: {
'name': "Janus",
'color': "^r",
'Levels': 0,
'Kills': 0,
'chars': ['boris', 'guard', 'infantry', 'ourumov', 'jaws', 'samedi', 'mayday', 'oddjob'],
'random_char': random.choice (self.TEAM_SCORES[Glb.TEAM_JANUS]['chars'])
},
Glb.TEAM_MI6: {
'name': "MI6",
'color': "^i",
'Levels': 0,
'Kills': 0,
'chars': ['bond', '006_mi6', 'female_scientist', 'mishkin', 'valentin'],
'random_char': random.choice (self.TEAM_SCORES[Glb.TEAM_MI6]['chars'])
}
}
self.CreateCVar("ar_onecharperteam", "1", "Each team is assigned one character each. (Use 0 to disable)")
if player and player.GetTeamNumber() == Glb.TEAM_JANUS and not player.GetPlayerModel().lower() == self.TEAM_SCORES[Glb.TEAM_JANUS]['random_char'] and self.ar_onecharperteam == 1:
player.SetPlayerModel(self.TEAM_SCORES[Glb.TEAM_JANUS]['random_char'], 0)
if player and player.GetTeamNumber() == Glb.TEAM_MI6 and not player.GetPlayerModel().lower() == self.TEAM_SCORES[Glb.TEAM_MI6]['random_char'] and self.ar_onecharperteam == 1:
player.SetPlayerModel(self.TEAM_SCORES[Glb.TEAM_MI6]['random_char'], 0)