@@ -107,6 +107,22 @@ def _try_initialize(self):
107107 ):
108108 return
109109
110+ # Search match configuration for our spawn ids
111+ for player_id in self .player_ids :
112+ for player in self .match_config .player_configurations :
113+ match player .variety .item :
114+ case flat .CustomBot (name ):
115+ if player .player_id == player_id :
116+ self .names .append (name )
117+ self .loggers .append (get_logger (name ))
118+ break
119+ else : # else block runs if break was not hit
120+ self ._logger .warning (
121+ "Hivemind with agent id '%s' did not find itself in the match configuration for player id %s" ,
122+ self ._game_interface .agent_id ,
123+ player_id ,
124+ )
125+
110126 try :
111127 self .initialize ()
112128 except Exception as e :
@@ -125,16 +141,6 @@ def _handle_match_config(self, match_config: flat.MatchConfiguration):
125141 self .match_config = match_config
126142 self ._has_match_settings = True
127143
128- # Search match settings for our spawn ids
129- for player_id in self .player_ids :
130- for player in self .match_config .player_configurations :
131- match player .variety .item :
132- case flat .CustomBot (name ):
133- if player .player_id == player_id :
134- self .names .append (name )
135- self .loggers .append (get_logger (name ))
136- break
137-
138144 self ._try_initialize ()
139145
140146 def _handle_field_info (self , field_info : flat .FieldInfo ):
@@ -250,7 +256,7 @@ def update_rendering_status(
250256 ):
251257 """
252258 Requests the server to update the status of the ability for this bot to render.
253- Will be ignored if rendering has been set to AlwaysOff in the match settings .
259+ Will be ignored if rendering has been set to AlwaysOff in the match configuration .
254260 If the status is successfully updated, the `self.rendering_status_update` method will be called which will update `self.renderer.can_render`.
255261
256262 - `status`: `True` to enable rendering, `False` to disable.
@@ -283,7 +289,7 @@ def handle_match_comm(
283289 """
284290 Called when a match communication message is received.
285291 See `send_match_comm`.
286- NOTE: Messages from scripts will have `team == 2` and the index will be its index in the match settings .
292+ NOTE: Messages from scripts will have `team == 2` and the index will be its index in the match configuration .
287293 """
288294
289295 def send_match_comm (
@@ -337,7 +343,7 @@ def set_loadout(self, loadout: flat.PlayerLoadout, index: int):
337343
338344 def initialize (self ):
339345 """
340- Called when the bot is ready for initialization. Field info, match settings , name, index, and team are
346+ Called when the bot is ready for initialization. Field info, match configuration , name, index, and team are
341347 fully loaded at this point, and will not return garbage data unlike in `__init__`.
342348 """
343349
0 commit comments