copyisrighted 0 Posted March 14, 2020 Hi, Thanks to the WOT-Decompiled source, I can write the mod much easier. What I want to do is to add manual correction to auto-aimed target shoot. I found predictLockedTargetShotPoint from VehicleGunRotator and hooked as this new function to include the speed and manual correction. I can see that the marker is already changed in game. However, my question is why the actual shot point is still the original autoAimVehicle.position ? Is this auto aimed target shot point calculated and locked at the server side? def predictLockedTargetShotPoint(self, *args, **kargs): """ return False will prevent old func from running global UP in map is positive Z global RIGHT in map is positive X local front is positive Z local right is positive X rotate left """ with suppressButLog(Exception): autoAimVehicle = BigWorld.player().autoAimVehicle if autoAimVehicle is not None: player = BigWorld.player() vname = autoAimVehicle.typeDescriptor.type.name centerBias = self.shotOffset.get(vname, Math.Vector3(0,0,0)) autoAimPosition = Math.Vector3(autoAimVehicle.position) dist = (autoAimPosition - player.getOwnVehiclePosition()).length shotspeed = player.vehicle.typeDescriptor.shot.speed aimVspeed, aimVrot = autoAimVehicle._Vehicle__speedInfo.value[:2] velVec = Math.Vector3(aimVspeed*math.sin(aimVrot),0,aimVspeed*math.cos(aimVrot))*self.speedGain*dist/shotspeed/100.0 offset = getLocalAimPoint(autoAimVehicle.typeDescriptor) worldoff = Math.Matrix(autoAimVehicle.matrix).applyVector(offset+velVec+centerBias) autoAimPosition += worldoff return False, args, kargs, autoAimPosition else: return False, args, kargs, None return True, args, kargs, None Quote Share this post Link to post Short link Share on other sites
StranikS_Scan 4,203 #479269 Posted March 14, 2020 12 часов назад, copyisrighted сказал: However, my question is why the actual shot point is still the original autoAimVehicle.position ? LOL def autoAim(self, target=None, magnetic=False): if target is None: vehID = 0 elif not isinstance(target, Vehicle.Vehicle): vehID = 0 elif target.id == self.__autoAimVehID: vehID = 0 elif target.publicInfo['team'] == self.team: vehID = 0 elif not target.isAlive(): vehID = 0 else: vehID = target.id if self.__autoAimVehID != vehID: self.__autoAimVehID = vehID self.cell.autoAim(vehID, magnetic) <================================================================= Server AutoAim if vehID != 0: self.inputHandler.setAimingMode(True, AIMING_MODE.TARGET_LOCK) self.gunRotator.clientMode = False self.onLockTarget(AimSound.TARGET_LOCKED, True) TriggersManager.g_manager.activateTrigger(TRIGGER_TYPE.AUTO_AIM_AT_VEHICLE, vehicleId=vehID) else: self.inputHandler.setAimingMode(False, AIMING_MODE.TARGET_LOCK) self.gunRotator.clientMode = True self.__aimingInfo[0] = BigWorld.time() minShotDisp = self.vehicleTypeDescriptor.gun.shotDispersionAngle self.__aimingInfo[1] = self.gunRotator.dispersionAngle / minShotDisp self.onLockTarget(AimSound.TARGET_UNLOCKED, True) TriggersManager.g_manager.deactivateTrigger(TRIGGER_TYPE.AUTO_AIM_AT_VEHICLE) gui_event_dispatcher.hideAutoAimMarker() return Quote Share this post Link to post Short link Share on other sites
copyisrighted 0 #479287 Posted March 15, 2020 Aha, I'll rewrite the autoaim() then. Thank you for your confirm. Quote Share this post Link to post Short link Share on other sites