Jump to content
Korean Random

pipje2001

User
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by pipje2001

  1. @Kotyarko_Oo i see i forgot to add them Traceback (most recent call last): File "scripts/common/Event.py", line 44, in __call__ File "mod_hello", line 40, in setMaxHp File "scripts/client/avatar_components/AvatarObserver.py", line 260, in getVehicleAttached AttributeError: 'PlayerAvatar' object has no attribute 'playerVehicleID'
  2. @Kotyarko_O the code you send doesn't seem to be working, although i changed some of it i can't find what is wrong import BigWorld from PlayerEvents import g_playerEvents from Vehicle import Vehicle from random import randint import time import threading #file for using philips hue in python from mod_phue import Bridge #some stuff needed for philips hue b = Bridge('192.168.1.101') listOfLight = b.lights maxHp = None curHp = None def DamageRecievedSmall(): b.set_light(4, 'xy', [0.678, 0.3168], transitiontime=0) b.set_light(4, 'bri', 254, transitiontime=0) time.sleep(0.2) b.set_light(4, 'bri', 0, transitiontime=3) print("DRS_Done") def DamageRecievedLarge(): b.set_light(4, 'xy', [0.678, 0.3168], transitiontime=0) b.set_light(4, 'bri', 254, transitiontime=0) time.sleep(0.6) b.set_light(4, 'bri', 0, transitiontime=3) print("DRL_Done") def setMaxHp(): global maxHp plVeh = BigWorld.player().getVehicleAttached() maxHp = plVeh.typeDescriptor.maxHealth def new_onHealthChanged(self, newHealth, attackerID, attackReasonID): old_onHealthChanged(self, newHealth, attackerID, attackReasonID) print(attackerID) print(attackReasonID) print(BigWorld.player().playerVehicleID) if not self.isPlayerVehicle: if attackerID != BigWorld.player().playerVehicleID: return global curHp curHp = newHealth # if attackerID == BigWorld.player().playerVehicleID: # t3 = threading.Thread(target=hue3) # t4 = threading.Thread(target=hue4) # if t3.isAlive()==False: # print("hue3start") # t3.start() # if t4.isAlive()==False: # print("hue4start") # t4.start() if attackerID != BigWorld.player().playerVehicleID: if curHp/maxHp <= 0.2: DRS = threading.Thread(target=DamageRecievedSmall) if DRS.isAlive()==False: DRS.start() print("DRS_Start") if curHp/maxHp > 0.2: DRL = threading.Thread(target=DamageRecievedLarge) if DRL.isAlive()==False: DRL.start() print("DRL_Start") def reset(): global maxHp, curHp maxHp = None curHp = None g_playerEvents.onAvatarBecomePlayer += setMaxHp old_onHealthChanged = Vehicle.onHealthChanged Vehicle.onHealthChanged = new_onHealthChanged g_playerEvents.onAvatarBecomeNonPlayer += reset
  3. I looked trough the links you send but i dont understand shit about how it works XD, for example if i want to set the ip of the bridge in the game. b = Bridge('192.168.1.101') what would i need to make this possible? And how do you get the playerid of the player which i am playing with? never mind already found it (BigWorld.player().playerVehicleID)
  4. @Kotyarko_O Awesome, that really helped me, although i still have some more questions though. is it possible to get the currunt hp and max hp of the tank you are playing at that moment? and is there somewhere where i can find information about an ingame settings window for my own mod? like some populair mods have?
  5. I just started trying to make my own mod, but i have absolutely no experience with modding for any game. I do know the basics of python so that shouldn't be a big problem. So far i tried to follow this short tutorial https://bitbucket.org/_vb_/wot.mods/wiki/GettingStarted with the help of google translate. # -*- coding: utf-8-sig -*- import BigWorld from gui import SystemMessages from Account import Account #file for using philips hue in python from mod_phue import Bridge #some stuff needed for philips hue b = Bridge('192.168.1.101') listOfLight = b.lights def hello(self): parent(self) SystemMessages.pushMessage('Hello WoT!', type=SystemMessages.SM_TYPE.Warning) #sets the ligt red b.set_light(4, 'xy', [0.1938, 0.6821], transitiontime=10) b.set_light(5, 'xy', [0.1938, 0.6821], transitiontime=10) #sets the ligt on max brightness b.set_light(4, 'bri', 254, transitiontime=10) b.set_light(5, 'bri', 254, transitiontime=10) Account.onBecomePlayer = parent parent = Account.onBecomePlayer Account.onBecomePlayer = hello with some modifications i got the lights to change to red and on max brightness, so it is possible to control the lights with a mod, but i am trying to make the lights flash when i get hit. But i guess i have to use onHealthChanged but i have no idea how. If somebody could help me it would be appreciated
×
×
  • Create New...