Debriefing > Bug Reports & Fixes
[Bug] -Python function SetExcludedCharacters only allows frist 58 chars in list
Entropy-Soldier:
Yeah, a more clear definition of the function's purpose is due at the very least, though it could conceivably be extended to include more characters as well. We'll look at it for 5.1.
What quirks does SetPlayerModel() have? I haven't looked at these functions much myself so I'd love to know if they could be improved.
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):
--- Code: ---
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)
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version