@Uveso
Can you explain how this code "tables.lua" file
local NameTable = {
Default = { -- land units
"Destiny",
"Infinity",
"Void",
"Overcharge",
"Neo",
},
UEFT4table = {
"George Washington",
"John Adams",
"Thomas Jefferson",
"James Madison",
"James Monroe",
"John Q. Adams",
"Andrew Jackson",
"Martin Van Buren",
"William H. Harrison",
"John Tyler",
"James K. Polk",
"Zachary Taylor",
"Millard Fillmore",
"Franklin Pierce",
"James Buchanan",
"Abraham Lincoln",
"Andrew Johnson",
"Ulysses S. Grant",
"Rutherford B. Hayes",
"James A. Gardield",
"Chester A. Arthur",
"S. Grover Cleveland",
"Benjamin Harrison",
"William McKinley",
"Theodore Roosevelt",
"William H. Taft",
"T.Woodrow Wilson",
"Warren G. Harding",
"J. Calvin Coolidge",
"Herbet C. Hoover",
"Franlin D. Roosevelt",
"Harry S. Truman",
"Dwight D. Eisenhower",
"John F. Kennedy",
"Lyndon B. Johnson",
"Richard M. Nixon",
"Gerald R. Ford",
"James E. Carter",
"Ronald W. Reagan",
"George H. W. Bush",
"William J. 'Bill' Clinton",
"George W. Bush",
"Barack Obama",
"Bernie Sanders",
},
AeonT4table = {
"UFO",
},
SeraphimT4table = {
"Obvious alien is obvious",
},
CybranT4table = {
"Obvious Troll is obvious",
"This is a mantis",
"Captain sneak",
},
AirTable = {
"Eagle",
"Owl",
"Falcon",
"Griffin",
},
Naval = {
"Nessie",
"Jormungandr",
"The Kraken",
},
BNaval = {
"Leviathan",
"Carcinos",
},
Gunships = {
"Snake",
"Starvation",
"Nidhogg",
"Phoenix",
},
Defense = {
"I am expansive",
"Killer",
"AWW YEAA",
"THIS IS SPARTA",
"mega turret",
"Thousand flames",
"You are an idiot",
},
Structures = {
"Nuker",
"Alpha",
"Foxtrot",
"Beta",
"Charlie",
"Echo",
"Golf",
"Juliett",
"November",
}
}
function GetTable()
return NameTable;
end
work together with this part of main codes ?
function RenameVet()
for index, unit in allUnits do
local Ukills = unit:GetStat('KILLS', 0).Value
if Ukills >= unit:GetBlueprint().Veteran.Level1 and Ukills != 0 and ( unit:GetCustomName(unit) == nil or unit:IsInCategory('COMMAND') == true ) then
local unitname = unit:GetBlueprint().General.UnitName
local newName
local temptable ;
if unit:IsInCategory('COMMAND') == true then
if Ukills >= unit:GetBlueprint().Veteran.Level5 then
newName = "<[["..username.."]]>"
elseif Ukills >= unit:GetBlueprint().Veteran.Level4 then
newName = "[["..username.."]]"
elseif Ukills >= unit:GetBlueprint().Veteran.Level3 then
newName = "<["..username.."]>"
elseif Ukills >= unit:GetBlueprint().Veteran.Level2 then
newName = "["..username.."]"
elseif Ukills >= unit:GetBlueprint().Veteran.Level1 then
newName = "<"..username..">"
else
newName = username
end
else
if unit:IsInCategory('EXPERIMENTAL') then
if unit:IsInCategory('UEF') then
temptable = NameTable.UEFT4table
elseif unit:IsInCategory('CYBRAN') then
temptable = NameTable.CybranT4table
elseif unit:IsInCategory('AEON') then
temptable = NameTable.AeonT4table
elseif unit:IsInCategory('SERAPHIM') then
temptable = NameTable.SeraphimT4table
end
elseif unit:IsInCategory('DEFENSE') then
temptable = NameTable.Defense
elseif unit:IsInCategory('STRUCTURE') then
temptable = NameTable.Structures
elseif unit:IsInCategory('BATTLESHIP') == true or unit:IsInCategory('BATTLECRUISER') then
temptable = NameTable.BNaval
elseif unit:IsInCategory('NAVAL') then
temptable = NameTable.Naval
elseif unit:IsInCategory('AIR') and unit:IsInCategory('GROUNDATTACK') then
temptable = NameTable.Gunships
elseif unit:IsInCategory('AIR') then
temptable = NameTable.AirTable
else
temptable = NameTable.Default
end
if temptable != nil then
newName = temptable[math.random(table.getsize (temptable) )]
end
end
if newName != nil then
unit:SetCustomName(newName)
else
unit:SetCustomName("test")
end
end
end
end
Especially this part here ...
if unit:IsInCategory('EXPERIMENTAL') then
if unit:IsInCategory('UEF') then
temptable = NameTable.UEFT4table
elseif unit:IsInCategory('CYBRAN') then
temptable = NameTable.CybranT4table
elseif unit:IsInCategory('AEON') then
temptable = NameTable.AeonT4table
elseif unit:IsInCategory('SERAPHIM') then
temptable = NameTable.SeraphimT4table
end
The NameTable for UEF has a much longer name list than others ? How do this work out ?
I hope I am not giving you too much trouble getting you to explain all these. I really appreciate the explanation.