ahwa 26 Posted April 28, 2015 How to get armor penetration in crosshairControls.swf Green Who can give me Python code For example: if Green =True: ............ 1 2 Quote Share this post Link to post Short link Share on other sites
KACTET 317 #266595 Posted April 29, 2015 (edited) How to get armor penetration in crosshairControls.swf Green Who can give me Python code For example: if Green =True: ............ def new_changeColor(self, hitPoint, armor): vDesc = BigWorld.player().vehicleTypeDescriptor ppDesc = vDesc.shot['piercingPower'] maxDist = vDesc.shot['maxDistance'] dist = (hitPoint - BigWorld.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: piercingPercent = 100.0 + (armor - piercingPower) / piercingPower * 100.0 type = 'great_pierced' if piercingPercent >= 150: type = 'not_pierced' elif 90 < piercingPercent < 150: type = 'little_pierced' self.call('Crosshair.setMarkerType', [self._curColors[type], armor, piercingPower]) Ok? Edited April 29, 2015 by KACTET 2 Quote Share this post Link to post Short link Share on other sites
ahwa 26 #266599 Posted April 29, 2015 def new_changeColor(self, hitPoint, armor): vDesc = BigWorld.player().vehicleTypeDescriptor ppDesc = vDesc.shot['piercingPower'] maxDist = vDesc.shot['maxDistance'] dist = (hitPoint - BigWorld.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: piercingPercent = 100.0 + (armor - piercingPower) / piercingPower * 100.0 type = 'great_pierced' if piercingPercent >= 150: type = 'not_pierced' elif 90 < piercingPercent < 150: type = 'little_pierced' self.call('Crosshair.setMarkerType', [self._curColors[type], armor, piercingPower]) Ok? Thank lsdmax I study 1 2 Quote Share this post Link to post Short link Share on other sites