Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- global_model = "unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_"
- global_model_normal = "unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_normal.texture"
- global_sprite = "_ug1_Pavise_Crossbowmen_sprite.spr"
- global_attachment = "unit_models/AttachmentSets/Final European CB Gun_"
- function generate_unit(faction)
- local strings = {}
- local temp_string
- strings[1] = string.len(faction) .." " .. faction .."\n"
- temp_string = global_model .. faction ..".texture"
- strings[2] = string.len(temp_string) .." " .. temp_string .."\n"
- strings[3] = string.len(global_model_normal) .. " " .. global_model_normal .. "\n"
- temp_string ="unit_sprites/" .. faction ..global_sprite
- strings[4] = string.len(temp_string) .." " .. temp_string .."\n"
- temp_string =""
- for key in pairs(strings) do
- temp_string = temp_string .. strings[key]
- end
- return temp_string
- end
- function generate_unit2(faction)
- local strings = {}
- local temp_string
- strings[1] = string.len(faction) .." " .. faction .."\n"
- temp_string =global_attachment .. faction .."_diff.texture"
- strings[2] = string.len(temp_string) .." " .. temp_string .."\n"
- temp_string =global_attachment .. faction .."_norm.texture"
- strings[3] = string.len(temp_string) .." " .. temp_string .." 0\n"
- temp_string =""
- for key in pairs(strings) do
- temp_string = temp_string .. strings[key]
- end
- return temp_string
- end
- function generate_units1(factions)
- local temp_string = tablelength(factions) .."\n"
- for key in pairs(factions) do
- temp_string = temp_string .. generate_unit(factions[key])
- end
- return temp_string
- end
- function generate_units2(factions)
- local temp_string = tablelength(factions) .."\n"
- for key in pairs(factions) do
- temp_string = temp_string .. generate_unit2(factions[key])
- end
- return temp_string
- end
- factiones = {"england","france","hre","spain","venice","sicily","milan","scotland","denmark","portugal","poland","hungary","slave","papal_states"}
- print(generate_units1(factiones) .. generate_units2(factiones) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement