ggtracker / ggtrackerstack

Project to run the whole ggtracker stack in vagrant
20 stars 10 forks source link

Zerg macro doesn't work with Queen command group target change #49

Closed gravelweb closed 8 years ago

gravelweb commented 8 years ago

Using this game as an example, I've been trying to figure out why only one hatchery is being tracked. I've narrowed it down the cause to the inject method used by the Zerg player:

  1. Select queen control group, shift+inject_hot_key
  2. Camera hotkey to first base
  3. Left click on the hatchery
  4. Camera hotkey to second base
  5. Left click on the hatchery

I've dumped the corresponding events w/ data from the replay below. It appears the problem is related to the command_update_target_unit_event not being handled.

03.20: 139730577463632: [class 'sc2reader.events.game.GetFromHotkeyEvent']: {'is_local': True, 'mask_type': u'None', 'frame': 4495, 'pid': 1, 'mask_data': None, 'player': None, 'second': 280, 'update_type': 2, 'control_group': 8, 'hotkey': 8, 'bank': 8}
03.20: 139730577463440: [class 'sc2reader.events.game.CameraEvent']: {'is_local': True, 'distance': None, 'frame': 4501, 'pid': 1, 'player': None, 'second': 281, 'location': (64.5, 158.76171875), 'pitch': None, 'y': 158.76171875, 'x': 64.5, 'yaw': None}
03.21: 139730577463824: [class 'sc2reader.events.game.TargetAbilityEvent']: {'upkeep_player_id': 2, 'target_unit': None, 'frame': 4508, 'pid': 1, 'other_unit': None, 'player': None, 'second': 281, 'target_flags': 111, 'ability_type_data': {'upkeep_player_id': 2, 'unit_tag': 74711041, 'unit_link': 108, 'control_player_id': 2, 'point': {'y': 657408, 'x': 264192, 'z': 40896}, 'flags': 111, 'timer': 0}, 'command_index': 0, 'control_player_id': 2, 'target_timer': 0, 'location': (64.5, 160.5, 40896), 'has_ability': True, 'target_unit_type': 108, 'ability': None, 'ability_id': 3296, 'ability_link': 103, 'other_unit_id': None, 'flag': {'alternate': False, 'target_self': False, 'dispatch_to_other_unit': False, 'data_a': False, 'preempt': False, 'repeat': False, 'user': True, 'subgroup': False, 'data_abil_queue_order_id': False, 'homogenous_interruption': False, 'data_b': False, 'minimap': False, 'is_order': False, 'script': False, 'smart_rally': False, 'ai_ignore_on_finish': False, 'set_autocast': False, 'set_autocast_on': False, 'ai': False, 'data_passenger': False, 'queued': True, 'smart_click': False}, 'ability_type': u'TargetUnit', 'is_local': True, 'target_unit_id': 74711041, 'flags': 258, 'y': 160.5, 'x': 64.5, 'z': 40896, 'ability_name': u'', 'ability_data': None}
03.21: 139730577464208: [class 'sc2reader.events.game.CameraEvent']: {'is_local': True, 'distance': None, 'frame': 4512, 'pid': 1, 'player': None, 'second': 282, 'location': (36.5, 151.7578125), 'pitch': None, 'y': 151.7578125, 'x': 36.5, 'yaw': None}
03.21:     skipped: [bound method GameEventsReader_38996.command_update_target_unit_event of [sc2reader.readers.GameEventsReader_38996 object at 0x7f158f849a10]]: {'target': {'snapshot_control_player_id': 2, 'snapshot_point': {'y': 628736, 'x': 149504, 'z': 32768}, 'tag': 80740354, 'snapshot_upkeep_player_id': 2, 'snapshot_unit_link': 108, 'target_unit_flags': 111, 'timer': 0}}
03.21:     skipped: [bound method GameEventsReader_38996.command_manager_state_event of [sc2reader.readers.GameEventsReader_38996 object at 0x7f158f849a10]]: {'state': 1, 'sequence': None}
gravelweb commented 8 years ago

@dsjoerg Is there someplace these events and their data are documented, so that I can create a handler for this event?

dsjoerg commented 8 years ago

@gravelweb not really. in the past we've figured these things out through trial and error and looking at a bunch of examples. if all that failed and there was still a mystery, Blizzard has helped out in the past.