Advertisement
Tom_Neverwinter

hawken config test

Jun 17th, 2023 (edited)
99
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. import configparser
  2. from collections import OrderedDict
  3.  
  4. def get_map_names():
  5. return OrderedDict({
  6. "Alleys": "Uptown",
  7. "Andromeda": "Prosk",
  8. "Bunker": "Bunker",
  9. "Facility": "Facility",
  10. "FightClub": "Fight Club",
  11. "LastEco": "Last Eco",
  12. "Sahara": "Bazaar",
  13. "Titan": "Origin",
  14. "Valkirie": "Front Line",
  15. "Wreckage": "Wreckage"
  16. })
  17.  
  18. def get_game_type_names():
  19. return OrderedDict({
  20. "VS": "Deathmatch",
  21. "CO": "Co-Op Team Deathmatch",
  22. "SG": "Siege",
  23. "MA": "Missile Assault",
  24. "AI": "Co-Op Bot Destruction"
  25. })
  26.  
  27. def get_time_limits():
  28. return [5, 10, 15, 20, 25, 30] # Example time limits. Adjust as needed.
  29.  
  30. def get_goal_scores():
  31. return [20000, 30000, 40000, 50000] # Example goal scores. Adjust as needed.
  32.  
  33. def create_config_files(map_names, game_type_names, time_limits, goal_scores):
  34. root_path = "X:\\Games\\Hawken\\"
  35. game_path = "X:\\Games\\Hawken\\Binaries\\Win32\\HawkenGame-Win32-Shipping.exe"
  36.  
  37. for map_key, map_name in map_names.items():
  38. for game_key, game_name in game_type_names.items():
  39. # Generate all possible map_key and game_key combinations
  40. full_key = f"{game_key}-{map_key}"
  41. for time_limit in time_limits:
  42. for goal_score in goal_scores:
  43. config = configparser.ConfigParser()
  44. config['config'] = {
  45. 'root': root_path,
  46. 'game': game_path,
  47. 'args': f"Server {full_key}?NumPublicConnections=10?GoalScore={goal_score}?TimeLimit={time_limit}?bIsLanMatch=True?game=HawkenGame.R_{game_key} -log"
  48. }
  49. with open(f'hook_{map_name}_{game_name}_score_{goal_score}_time_{time_limit}.ini', 'w') as configfile:
  50. config.write(configfile)
  51.  
  52. def main():
  53. map_names = get_map_names()
  54. game_type_names = get_game_type_names()
  55. time_limits = get_time_limits()
  56. goal_scores = get_goal_scores()
  57. create_config_files(map_names, game_type_names, time_limits, goal_scores)
  58.  
  59. if __name__ == "__main__":
  60. main()
  61.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement