Advertisement
RA2lover

War Thunder Battle Cost Improvement Analysis

Mar 20th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.42 KB | None | 0 0
  1. --table information is taken from the new_economic_arcade.html attachment attached on Borisych's post explaining the economy changes at 1.29, accessible at http://forum.warthunder.com/index.php?/topic/22413-economy-v129/page-0
  2. --is the improvement actually paying off for the increase in airplane research and training costs?
  3.  
  4. --feel free to run it at lua.org/demo.html
  5.  
  6. US={-655,-707,-678,2124,1072,1522,4145,2118,3138,3202,1347,738,2070,2245,6240,1750,1050,-1867,-638,-54,1147,3526,1802,70,752,-1178,-370,-344,64,142,-158,1031,1420,175,1049,631,-276,-1098}
  7. Germany={-717,-715,-795,-800,-811,-473,522,862,869,1354,926,772,1424,-696,-722,-700,-722,-779,-566,115,776,1198,1833,632,-1478,751,-1855,730,-680,4694,4320,-1131,2601,-2133,-422,193,1542,103,784,1811,152,4306,-654,-689,-388,305,-105,-164,1000,-59,710,1983,1805,-1620,-430,767,5411,2624,5867}
  8.  
  9. USSR={15,101,3148,2146,-729,-739,-738,-705,-879,-691,3545,1488,4286,314,3550,-856,-829,-728,-365,311,856,-704,-800,-241,355,387,199,850,1377,1604,898,2599,2130,234,3345,3193,3508,-759,-452,-81,488,775,807,1349,1784,-13,1114,1992,-40,503,1537,750,1656}
  10.  
  11. --the original britain table had japanese planes too, but i removed them from here.
  12. Britain={-678,-685,-707,-690,52,59,-39,2283,2825,-758,402,3909,1908,4240,1392,2089,-2001,-4234,-13930,-13930,-465,-138,247,2822,3459,757,458,1534,1244,1687,2005,9837,-1177,-593,710,1156,523,116,5592,3131}
  13. --Japan's table is actually US table again originally. instead i'm picking the data from the rest of the Britain table.
  14. Japan={-167,1232,2002,2177,5439,-309,2535,7112,-748,-761,-758,-771,87,1143,1489,1836,1350,-487,-687,4880,-333,1244,2032,3244,5293,5681,502,11,3100,-75}
  15.  
  16. --now for the code part.
  17. NationTable={US,Germany,USSR,Britain,Japan}
  18. --loops through all the tables.
  19. for Nation,Table in pairs(NationTable) do--lame variable naming, i know
  20. --loops through each nation's table to get the average
  21. PlanesInNation=0
  22. TotalImprovement=0--might be anedoctal. or not.
  23. for _,v in pairs(Table)do
  24. PlanesInNation=PlanesInNation+1
  25. TotalImprovement=TotalImprovement+v
  26. end
  27. --averages it out and outputs the result for a nation
  28. local AverageImprovement=TotalImprovement/PlanesInNation
  29. print(PlanesInNation.." Planes, Average Profit Improvement = "..AverageImprovement)
  30. --i would print out the nation name, but lua stores it as a memory address:-/
  31. --anyway, the order is US-Germany-USSR-Britain-Japan for those too lazy to check or unable to read lua scripts.
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement