Advertisement
TATATATRATATATA

Untitled

Oct 15th, 2023
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. -- Generate miniface for everyplayer with real face model in playable league.
  2. -- THIS WILL TAKE A WHILE TO COMPLETE, like around 10h...
  3. -- and... if the game will crash (which is very possible) you will have to start from beginning...
  4.  
  5. -- Execute only if we are in career mode
  6. if not IsInCM() then return end
  7.  
  8. -- List of teams that cause game crashes or other problems
  9. local BLACKLISTED_TEAMS = {
  10. [112264] = true -- YOUTH ACADEMY
  11. }
  12.  
  13. -- List of leagues that we want to skip
  14. local BLACKLISTED_LEAGUES = {
  15. [78] = true, -- International
  16. [2136] = true, -- International Women
  17. [76] = true, -- Rest of World
  18. [383] = true, -- Create Player League
  19. [2028] = true -- Youth Squad League
  20. }
  21.  
  22. -- Path is relative to the game installation directory
  23. -- <default> means that the minifaces will be generated to your current Live Editor Mods directory (C:\FIFA 23 Live Editor\mods\root\Legacy\data\ui\imgAssets\heads if you didn't changed it')
  24. PlayerCaptureSetOutputDirectory("<default>")
  25.  
  26. -- 0 - Head and shoulders
  27. -- 1 - Head
  28. -- 2 - Body
  29. PlayerCaptureSetCamera(1)
  30.  
  31. -- 256x256
  32. PlayerCaptureSetSize(256, 256)
  33.  
  34. -- Image Type
  35. -- 0 - PNG
  36. -- 1 - DDS
  37. PlayerCaptureSetType(1)
  38.  
  39. -- Get all rows for leagueteamlinks table
  40. local leagueteamlinks_table = LE.db:GetTable("leagueteamlinks")
  41. local leagueteamlinks_current_record = leagueteamlinks_table:GetFirstRecord()
  42.  
  43. local leagueid = 0
  44. local teamid = 0
  45. while leagueteamlinks_current_record > 0 do
  46. leagueid = leagueteamlinks_table:GetRecordFieldValue(leagueteamlinks_current_record, "leagueid")
  47.  
  48. if BLACKLISTED_LEAGUES[leagueid] then
  49. teamid = leagueteamlinks_table:GetRecordFieldValue(leagueteamlinks_current_record, "teamid")
  50. BLACKLISTED_TEAMS[teamid] = true
  51. end
  52.  
  53. leagueteamlinks_current_record = leagueteamlinks_table:GetNextValidRecord()
  54. end
  55.  
  56. -- Get all rows for teamplayerlinks table
  57. local teamplayerlinks_table = LE.db:GetTable("teamplayerlinks")
  58. local teamplayerlinks_current_record = teamplayerlinks_table:GetFirstRecord()
  59.  
  60. local playerid = 0
  61. local player_teams = {}
  62. while teamplayerlinks_current_record > 0 do
  63. teamid = teamplayerlinks_table:GetRecordFieldValue(teamplayerlinks_current_record, "teamid")
  64. if not BLACKLISTED_TEAMS[teamid] then
  65. playerid = teamplayerlinks_table:GetRecordFieldValue(teamplayerlinks_current_record, "playerid")
  66. player_teams[playerid] = teamid
  67. end
  68.  
  69. teamplayerlinks_current_record = teamplayerlinks_table:GetNextValidRecord()
  70. end
  71.  
  72. -- Get all rows for players table
  73. local players_table = LE.db:GetTable("players")
  74. local players_current_record = players_table:GetFirstRecord()
  75.  
  76. local player_gen_count = 0
  77. local headassetid = 0
  78. local headclasscode = 0
  79. while players_current_record > 0 do
  80. playerid = players_table:GetRecordFieldValue(players_current_record, "playerid")
  81. headassetid = players_table:GetRecordFieldValue(players_current_record, "headassetid")
  82. headclasscode = players_table:GetRecordFieldValue(players_current_record, "headclasscode")
  83.  
  84. if headassetid > 0 and headclasscode == 0 then
  85. teamid = player_teams[playerid]
  86.  
  87. if teamid then
  88. PlayerCaptureAddPlayer(headassetid, teamid)
  89. end
  90. end
  91.  
  92. players_current_record = players_table:GetNextValidRecord()
  93. end
  94.  
  95. -- Start Capturing
  96. PlayerCaptureStart()
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement