Jump to content


tank list


  • Please log in to reply
10 replies to this topic

_ttank #1 Posted 04 September 2019 - 02:56 PM

    Private

  • Player
  • 30111 battles
  • 12
  • Member since:
    01-13-2016
I am trying to retrieve tank list from files \scripts.pkg\item_defs\vehicles but I have no idea how to read them in python, these files are not pickled or zipped - how to read these files? so far - in battle results I found a way to get itemTypeID, nationID, tankID from type descr but reading these lists is blocking me

RaJCeL #2 Posted 04 September 2019 - 03:44 PM

    Lieutenant

  • Player
  • 25164 battles
  • 1,908
  • Member since:
    10-14-2011
Check what is inside:
from items import vehicles

_ttank #3 Posted 04 September 2019 - 03:50 PM

    Private

  • Player
  • 30111 battles
  • 12
  • Member since:
    01-13-2016
I realized that I can call this VehicleList and for all nations pickle content of list... thx

ShuraBB #4 Posted 04 September 2019 - 08:32 PM

    Warrant Officer

  • Player
  • 836 battles
  • 891
  • [RU_PP] RU_PP
  • Member since:
    07-01-2014

>I am trying to retrieve tank list from files \scripts.pkg\item_defs\vehicles

Why read it?



_ttank #5 Posted 05 September 2019 - 07:44 AM

    Private

  • Player
  • 30111 battles
  • 12
  • Member since:
    01-13-2016

because when I retrieve battle results I have to get mapping tankID -> actuall tank like (1, 238) -> T-55A



RaJCeL #6 Posted 05 September 2019 - 08:25 AM

    Lieutenant

  • Player
  • 25164 battles
  • 1,908
  • Member since:
    10-14-2011

View Post_ttank, on 05 September 2019 - 08:44 AM, said:

because when I retrieve battle results I have to get mapping tankID -> actuall tank like (1, 238) -> T-55A

What I mentioned above - with example:

 

Block Quote

from items import vehicles

# in battle results context

personal = value['personal'].itervalues().next()

idNum = personal['typeCompDescr']

vt = vehicles.getVehicleType(idNum)

print(str(vt.userString))

print(str(vt.name))

print(str(vt.shortUserString))

 

Chose the one that you need.


Edited by RaJCeL, 05 September 2019 - 08:28 AM.


lgfrbcsgo #7 Posted 08 September 2019 - 02:06 PM

    Second Lieutenant

  • Player
  • 33824 battles
  • 1,045
  • [MOTIV] MOTIV
  • Member since:
    04-04-2012

I suggest installing the replserver mod. https://wgmods.net/786/

It allows you to run Python code from your console (I suggest using the Windows Subsystem for Linux) inside the WoT process.

 



_ttank #8 Posted 08 September 2019 - 09:51 PM

    Private

  • Player
  • 30111 battles
  • 12
  • Member since:
    01-13-2016
this mod is awesome, thx for advice

lgfrbcsgo #9 Posted 09 September 2019 - 06:56 PM

    Second Lieutenant

  • Player
  • 33824 battles
  • 1,045
  • [MOTIV] MOTIV
  • Member since:
    04-04-2012

Some other advice I can give: 

After every major version, uncompile the entire scripts package (for example using uncompyle6 https://github.com/rocky/python-uncompyle6 or uncompyle2 https://github.com/wibiti/uncompyle2) and check it into a local Git repository. The Git diff will help you figuring out what broke your mods. 

Also, I suggest using PyCharm https://www.jetbrains.com/pycharm/download/ for development (I use the Ultimate version professionally, but the Community version should suffice). Its excellent search will help you sifting through that huge code base.


Edited by lgfrbcsgo, 09 September 2019 - 06:59 PM.


RaJCeL #10 Posted 09 September 2019 - 06:59 PM

    Lieutenant

  • Player
  • 25164 battles
  • 1,908
  • Member since:
    10-14-2011
No need to uncompyle WoT for your own and upload on Git.
It is already done there, and you can compare branches.

Edited by RaJCeL, 09 September 2019 - 06:59 PM.


_ttank #11 Posted 18 September 2019 - 05:37 PM

    Private

  • Player
  • 30111 battles
  • 12
  • Member since:
    01-13-2016

thx for advice!

 

right now I don't work on it but in near future I will try to dive into ActionScript files to figure out some things (how to automatically download battle results without user clicking details)






1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users