ahwa 26 Posted February 1, 2017 from gui.WindowsManager import g_windowsManager from AvatarInputHandler.control_modes import _FlashGunMarker Will these changes to the API ImportError: No module named? Quote Share this post Link to post Short link Share on other sites
ahwa 26 #378128 Posted February 1, 2017 I only have to find one from AvatarInputHandler.control_modes import _FlashGunMarker change --------------------------------------------------------------------------------------- from AvatarInputHandler import gun_marker_ctrl _MARKER_TYPE = aih_constants.GUN_MARKER_TYPE_MARKER_FLAG = aih_constants.GUN_MARKER_FLAG_SHOT_RESULT = aih_constants.SHOT_RESULT def New_getShotResult(hitPoint, collision, excludeTeam = 0): Old_getShotResult(hitPoint, collision, excludeTeam = 0) if collision is None: return _SHOT_RESULT.UNDEFINED else: entity = collision.entity if entity.health <= 0 or entity.publicInfo['team'] == excludeTeam: return _SHOT_RESULT.UNDEFINED player = BigWorld.player() if player is None: return _SHOT_RESULT.UNDEFINED vDesc = player.getVehicleDescriptor() ppDesc = vDesc.shot['piercingPower'] maxDist = vDesc.shot['maxDistance'] dist = (hitPoint - player.getOwnVehiclePosition()).length if dist <= 100.0: piercingPower = ppDesc[0] elif maxDist > dist: p100, p500 = ppDesc piercingPower = p100 + (p500 - p100) * (dist - 100.0) / 400.0 if piercingPower < 0.0: piercingPower = 0.0 else: piercingPower = 0.0 piercingPercent = 1000.0 if piercingPower > 0.0: armor = collision.armor piercingPercent = 100.0 + (armor - piercingPower) / piercingPower * 100.0 if piercingPercent >= 150: result = _SHOT_RESULT.NOT_PIERCED type = 'not_pierced' elif 90 < piercingPercent < 150: result = _SHOT_RESULT.LITTLE_PIERCED type = 'little_pierced' else: result = _SHOT_RESULT.GREAT_PIERCED type = 'great_pierced' AimData['__Type__'] = type return result Old_getShotResult = gun_marker_ctrl.getShotResult gun_marker_ctrl.getShotResult = New_getShotResult -------------------------------------------------------------------------------------- No method found from gui.WindowsManager import g_windowsManager g_windowsManager.onInitBattleGUI += OnInitBattleGUIg_windowsManager.onDestroyBattleGUI += OnDestroyBattleGUI Quote Share this post Link to post Short link Share on other sites