Перейти к содержимому
Korean Random

pipje2001

Пользователь
  • Публикации

    17
  • Зарегистрирован

  • Посещение

Репутация

0 Нуп
  1. pipje2001

    some questions about modmaking

    @Kotyarko_O No problem at all, its good to know it is possible though, if you have time for it and you like to help it would be really appreciated
  2. pipje2001

    some questions about modmaking

    @Kotyarko_O Thats awesome, so i already got a next question, i want to try to dynamically create a textinput for the modsettingapi, so if a certain value is 5 it needs to create 5 textinputs, is this even possible or not?
  3. pipje2001

    some questions about modmaking

    @Kotyarko_O Awesome that did it! thank you so much but i guess this wont be the last time i ask you something if you don't mind
  4. pipje2001

    some questions about modmaking

    @Kotyarko_O Alright done that, but how do i get the mod to load the saved settings?
  5. pipje2001

    some questions about modmaking

    @Kotyarko_O it should be in one file? so mod_modsettings.py and mod_hello.py sould be one file?
  6. pipje2001

    some questions about modmaking

    @Kotyarko_O newSettings are the settings that you changed in the game so print 'onModSettingsChanged', newSettings will print onModSettingsChanged {'enabled': True, 'ip_hub': '192.168.1.101', 'minimapClick': True} so i need to get the newSettings from inside my own mod, because settings in the mod_modsettings.py don't change otherwise i need to press apply everytime i restart the game
  7. pipje2001

    some questions about modmaking

    @Kotyarko_O still don't understand it though, how do i get the value from the textinput into my own mod? and how can i run a function in my mod when i press apply in the settings menu?
  8. pipje2001

    some questions about modmaking

    @Kotyarko_O I tried using https://bitbucket.org/The_IzeBerg/modssettingsapi/src and https://bitbucket.org/P0LIR0ID/wot-modslist/src/ce1e5c1d2662?at=master, but i can't find where the settings are saved and how is can access them from my own mod... for example i want to be able to set the ip adress of the hub in the settings menu, but i have no idea how mod_hello.py mod_modsettings.py
  9. pipje2001

    some questions about modmaking

    @Kotyarko_O Thanks, that did the trick, do you mind if i ask you some more questions? - how do you know if the tank is on fire? - how do you know if modules are hit? and which module is hit? - and how can you make a settings window in the game? I tried to search for answers but because most stuff is in russian searching is kinda difficult
  10. pipje2001

    getting last damage recieved

    Is it possible to get the last damage that i have recieved? and if so how?
  11. pipje2001

    some questions about modmaking

    @Kotyarko_O Awesome, i got one more problem though, i try to run this code in a loop: def LowHp(): while curHp > 0: b.set_light(1, 'xy', [0.678, 0.3168], transitiontime=0) b.set_light(1, 'bri', 254, transitiontime=10) time.sleep(1) b.set_light(1, 'bri', 0, transitiontime=10) time.sleep(1) print("LH_Done") But i only want this function to run once at a time so i use this method to check if the tread is already running but it "forgets" that its running so the next time i get shot it just runs it again which kinda breaks my lights XD if fcurHp/fmaxHp <= 0.1: LH = threading.Thread(target=LowHp) print(LH.is_alive()) if not LH.is_alive(): LH.start() print("LH_Start") mod_hello.py
  12. pipje2001

    some questions about modmaking

    @Kotyarko_O and what about the onAvatarBecomeNonPlayer
  13. pipje2001

    some questions about modmaking

    @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'
  14. pipje2001

    some questions about modmaking

    @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
  15. pipje2001

    some questions about modmaking

    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)
×