@cdrmv
MeshBlueprint is seen in MohoData\system\Blueprints.lua line 149, under the following function:
function ExtractMeshBlueprint(bp)
local disp = bp.Display or {}
bp.Display = disp
if disp.MeshBlueprint=='' then
LOG('Warning: ',bp.Source,': MeshBlueprint should not be an empty string')
disp.MeshBlueprint = nil
end
if type(disp.MeshBlueprint)=='string' then
if disp.MeshBlueprint!=lower(disp.MeshBlueprint) then
#Should we allow mixed-case blueprint names?
#LOG('Warning: ',bp.Source,' (MeshBlueprint): ','Blueprint IDs must be all lowercase')
disp.MeshBlueprint = lower(disp.MeshBlueprint)
end
# strip trailing .bp
disp.MeshBlueprint = gsub(disp.MeshBlueprint, "%.bp$", "")
if disp.Mesh then
LOG('Warning: ',bp.Source,' has mesh defined both inline and by reference')
end
end
if disp.MeshBlueprint==nil then
# For a blueprint file "/units/uel0001/uel0001_unit.bp", the default
# mesh blueprint is "/units/uel0001/uel0001_mesh"
local meshname,subcount = gsub(bp.Source, "_[a-z]+%.bp$", "_mesh")
if subcount==1 then
disp.MeshBlueprint = meshname
end
if type(disp.Mesh)=='table' then
local meshbp = disp.Mesh
meshbp.Source = meshbp.Source or bp.Source
meshbp.BlueprintId = disp.MeshBlueprint
# roates: Commented out so the info would stay in the unit BP and I could use it to precache by unit.
# disp.Mesh = nil
MeshBlueprint(meshbp)
end
end
end
BuildMeshBP is seen in MohoData\system\Blueprints.lua line 223, under the following function:
function ExtractBuildMeshBlueprint(bp)
local FactionName = bp.General.FactionName
if FactionName == 'Aeon' or FactionName == 'UEF' or FactionName == 'Cybran' or FactionName == 'Seraphim' then
local meshid = bp.Display.MeshBlueprint
if not meshid then return end
local meshbp = original_blueprints.Mesh[meshid]
if not meshbp then return end
local shadername = FactionName .. 'Build'
local secondaryname = '/textures/effects/' .. FactionName .. 'BuildSpecular.dds'
local buildmeshbp = table.deepcopy(meshbp)
if buildmeshbp.LODs then
for i,lod in buildmeshbp.LODs do
lod.ShaderName = shadername
lod.SecondaryName = secondaryname
if FactionName == 'Seraphim' then
lod.LookupName = '/textures/environment/Falloff_seraphim_lookup.dds'
end
end
end
buildmeshbp.BlueprintId = meshid .. '_build'
bp.Display.BuildMeshBlueprint = buildmeshbp.BlueprintId
MeshBlueprint(buildmeshbp)
end
end
It looks like ExtractBuildMeshBlueprint is applying BuildSpecular for when a unit is being constructed at a factory. This could indicate a way to create your own custom blueprints during the game load-up. Then later be able to reference them and call them up as needed.
Further up Blueprint.lua check out the following function:
function ExtractAllMeshBlueprints()
for id,bp in original_blueprints.Unit do
ExtractMeshBlueprint(bp)
ExtractWreckageBlueprint(bp)
ExtractBuildMeshBlueprint(bp)
end
for id,bp in original_blueprints.Prop do
ExtractMeshBlueprint(bp)
ExtractWreckageBlueprint(bp)
end
for id,bp in original_blueprints.Projectile do
ExtractMeshBlueprint(bp)
end
end
This appears to kick off each of the Mesh build-ups in sequence. Could simply create your own function via /hook then reference it here towards the end of the file. Far as I can tell, doing so wouldn't change the game or how it behaves as your just adding in your own Mesh variants that are being saved as a global.
Please note: I pulled the above snippets from vanilla FA as not all files are always represented in the FAF Client. In this case, I've confirmed that FAF client does not have a Blueprint.lua as it's using the original vanilla version.
Resin