Custom common.lvl not overriding the stock common.lvl

Started by Idren, February 23, 2017, 08:01:59 PM

Previous topic - Next topic
I'm starting to get the feeling I'm starting too many new topics...?

I'm working on a single map with a custom imperial Side. I've been trying to get the icons/holograms for all the imperial stuff to change using a custom common.lvl file.  I've gotten it to work for bases but it's not working for all the rest of the instances where the hologram of the imperial icon (the .msh) is used: spawn screen, victory/defeat screen, and the player stats/awards screens.

This is also the case with the .tga imperial icon.  I think the only place it shows up is right after you select the map it shows up next to the rebel icon.

I've been able to get all of this to work by swapping out the game's common.lvl with my own, but I want to be able to do it without changing the icons for every map in the game.

Also, when running SPTest I'm getting a lot of messages like this:

     Message Severity: 2
     D:\src\FRONTLINE_PC\FrontLine\Source\FLEffect.cpp(180)
     FLEffect::Read: duplicate effect class name (7f7fc4c9)!

for effects/objects/collision meshes etc.  I'm assuming this is because I've got duplicates of what's in the game's common.lvl in my common.lvl - what's the best way around this?

Thanks so much everybody for all the continued help you've been giving!

The message severity 2 will happen regardless. It seems to be something hardcoded, so there's nothing we can do about it.

Can we see your LUA to see how you're loading it in?
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Yeah, here's my LUA:

[spoiler]---------------------------------------------------------------------------------
-- FUNCTION:   ScriptInit
-- PURPOSE:      This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES:      The name, 'ScriptInit' is a chosen convention, and each
--            mission script must contain a version of this function, as
--            it is called from C to start the mission.
---------------------------------------------------------------------------------
--start header

function ScriptInit()
local ALL = 1
local IMP = 2
local ATT = 1
local DEF = 2
--end header


--start objectives
--   These can be hard-coded: i.e. AddMissionObjective(IMP,"red", "Eliminate Enemy Forces")
AddMissionObjective(IMP,"red", "level.Tat4.objectives.1");
AddMissionObjective(IMP,"orange", "level.Tat4.objectives.2");
AddMissionObjective(IMP,"orange", "level.Tat4.objectives.3");
AddMissionObjective(ALL,"red", "level.Tat4.objectives.1");
AddMissionObjective(ALL,"orange", "level.Tat4.objectives.2");
AddMissionObjective(ALL,"orange","level.Tat4.objectives.3");
--end objectives


--start soundlvl
ReadDataFile("sound\\tat.lvl;tat1gcw");
--end soundlvl

ReadDataFile("dc:COMMON\\common.lvl");

-- Start sidelvls
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_basicdesert", --The units REQ for the level
"all_inf_lukeskywalker", --The hero's REQ for the level
"all_inf_smuggler", --The 5th troop's REQ (wookie smuggler)
"all_fly_falcon",
"all_fly_xwing");

--     ::EXAMPLE SECTION FROM STOCK GAME::
--     FOR HOTH, ALL NECESSARY .REQ files for troops/vehicles needed
--     on Hoth are added here!
--
--   ReadDataFile("SIDE\\all.lvl",
--       "all_fly_snowspeeder",       --the .REQ file for the snowspeeders
--       "all_inf_basicsnow",          --the .REQ file for the troopers w/snowy textures
--       "all_inf_lukeskywalkersnow",   --the .REQ file for luke in the snow texture
--       "all_inf_smugglersnow",       --the .REQ file for snowy looking wookies
--       "all_walk_tauntaun")          --the .REQ file for the tauntauns.
--   ReadDataFile("SIDE\\imp.lvl",
--       "imp_inf_basicsnow",         --the .REQ for basic troops w/snow textures
--       "imp_inf_dark_troopersnow",   --the .REQ for dark troopers w/snow textures
--       "imp_inf_darthvader",         --the .REQ for vader
--       "imp_walk_atat",            --the .REQ for ATATs
--       "imp_walk_atst_snow",         --the .REQ for ATST w/snow textures
--       "imp_droid_probe")         --the .REQ for probe droids (unused in final game)


ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_basic",
"imp_inf_dark_trooper",
"imp_fly_tiefighter");

--   ReadDataFile("***\\***\\***.lvl", "***_***_***")
--   by default looks in SWBF's main folder locations.
--  in order to change this to look in the AddOn folder
--  for assets, you have to start the command w/"dc:" for
--  "downloadable content" - this specifies that the assets
--  should be looked for in the AddOn folder of SWBF's GameData stuff.
--
-- ::EXAMPLE from TATOOINE: JABBA'S PALACE (TAT3)
--ReadDataFile("dc:SIDE\\gam.lvl",      --the side's .lvl file
--     "gam_inf_gamorreanguard")       --the necessary .REQ for the side (gammoreans)

--end sidelvls

--ReadDataFile("dc:COMMON\\common.lvl") - reads from DataMODID\Data\_lvl_pc\Common\common.lvl;

--start loadouts
--This section specifies the Team Name, Icon, and ODFs for the units.
--ALL UNITS MUST BE THE SAME ONES REFERENCED BY THE ABOVE .REQ FILES!!!
--(you don't have to add vehicles here)
--
--ALLIANCE
SetTeamName(ALL, "Alliance")
SetTeamIcon(ALL, "all_icon")
AddUnitClass(ALL, "all_inf_soldierdesert",10)
AddUnitClass(ALL, "all_inf_vanguard",1)
AddUnitClass(ALL, "all_inf_pilot",2)
AddUnitClass(ALL, "all_inf_marksman",2)
AddUnitClass(ALL, "all_inf_smuggler",1)
SetHeroClass(ALL, "all_inf_lukeskywalker")
--EMPIRE
SetTeamName(IMP, "Empire")
SetTeamIcon(IMP, "ord_icon")
AddUnitClass(IMP, "imp_inf_storm_trooper",10)
AddUnitClass(IMP, "imp_inf_shock_trooper",1)
AddUnitClass(IMP, "imp_inf_pilottie",2)
AddUnitClass(IMP, "imp_inf_scout_trooper",2)
AddUnitClass(IMP, "imp_inf_dark_trooper",1)
--end loadouts



--start teamstats
--   This section specifies how many troops are allowed on the battlefield
--   at a time.  For example, HOTH uses 28 units allowed for both ATT (attacking team)
--   and DEF (defending team)
--   SetUnitCount(team, number of units allowed at a time)
--   NOTE: The value entered here (16) MUST match the value of all above
--        AddUnitClass(team, odf, unitcount) unitcounts added together.
--        so the Alliance added 10 soldiers, 1 vanguard, 2 pilots, 2 marksmen,
--        and 1 wookie smuggler.  10+1+2+2+1 = 16, so the Alliance's SetUnitCount()
--        below must be: SetUnitCount(ATT, 16) because the Alliance is ATT
--       (attacking)/(team 1)
--
--   SetReinforcementCount(team, number of troops at the start)
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats




--start alliances
--   This section defines the relationship between the teams.
--   Typically this shouldn't need to be modified - unless adding
--   a 3rd side like gammoreans/geonosians in which case you do some
--   Team relationship setting.
--
--   EXAMPLE:
--  --Local Stats
--   --SetTeamName(3, "locals")
         --SetTeamName(team, name) sets team 3's name to "locals"
--   --AddUnitClass(3, "geo_inf_geonosian", 7) AddUnitClass(team,odf,allowed num/unit)
--          --AddUnitClass(team, odf, allowed #/unit)
--   --SetUnitCount(3, 7)
         --SetUnitCount(team, # of total allowed units/map at a time)
--   --SetTeamAsFriend(3, DEF)
         --SetTeamAsFriend(team, friendly team)

-- These values ENSURE very explicitly that the Attackers
-- don't attack tehir teammates, that Attackers attack
-- Defenders, that Defenders don't attack their teammates,
-- and that Defenders attack Attackers.
-- Then the Attacking Team is set as Team 1 (ATT).
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);
--end alliances


--start memorypools
ClearWalkers()
AddWalkerType(0, 0)-- special -> droidekas
AddWalkerType(1, 0)-- 1x2 (1 pair of legs)
AddWalkerType(2, 0)-- 2x2 (2 pairs of legs)
AddWalkerType(3, 0)-- 3x2 (3 pairs of legs)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
SetMemoryPoolSize("EntityFlyer", 10)
--end memorypools


--start worldlvl
--   This ReadDataFile() loads the WORLD.lvl file. (The one created
--  in ZeroEdit which is munged into the .lvl file).
--  This .lvl file MUST be read AFTER all the sides are
--  COMPLETELY DONE being set up (above).
--  i.e. side.lvls loaded, units added,
--  unit counts/reinforcements specified,
--  team relationships set, and memorypools added for vehicles
--  mines, etc.

ReadDataFile("dc:Tat4\\Tat4.lvl")
--end worldlvl


--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay


--start flyheight
SetMaxFlyHeight(90)
SetMaxPlayerFlyHeight(90)
--end flyheight


--start ainotify
--end ainotify


--start stayinturrets
--end stayinturrets


--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment


--start birdsandfish
--end birdsandfish


--start deathregions
AddDeathRegion("DeathRegion")
--end deathregions

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatgcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\gcw.lvl","gcw_vo");
OpenAudioStream("sound\\gcw.lvl","gcw_tac_vo");
OpenAudioStream("sound\\tat.lvl","tat1_emt");
SetBleedingVoiceOver(ALL,ALL,"all_off_com_report_us_overwhelmed",1);
SetBleedingVoiceOver(ALL,IMP,"all_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(IMP,ALL,"imp_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(IMP,IMP,"imp_off_com_report_us_overwhelmed",1);
SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1,1);
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1,1);
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");
SetAmbientMusic(ALL,1.0,"all_tat_amb_start",0,1);
SetAmbientMusic(ALL,0.99,"all_tat_amb_middle",1,1);
SetAmbientMusic(ALL,0.1,"all_tat_amb_end",2,1);
SetAmbientMusic(IMP,1.0,"imp_tat_amb_start",0,1);
SetAmbientMusic(IMP,0.99,"imp_tat_amb_middle",1,1);
SetAmbientMusic(IMP,0.1,"imp_tat_amb_end",2,1);
SetVictoryMusic(ALL,"all_tat_amb_victory");
SetDefeatMusic (ALL,"all_tat_amb_defeat");
SetVictoryMusic(IMP,"imp_tat_amb_victory");
SetDefeatMusic (IMP,"imp_tat_amb_defeat");
SetSoundEffect("ScopeDisplayZoomIn","binocularzoomin");
SetSoundEffect("ScopeDisplayZoomOut","binocularzoomout");
SetSoundEffect("SpawnDisplayUnitChange","shell_select_unit");
SetSoundEffect("SpawnDisplayUnitAccept","shell_menu_enter");
SetSoundEffect("SpawnDisplaySpawnPointChange","shell_select_change");
SetSoundEffect("SpawnDisplaySpawnPointAccept","shell_menu_enter");
SetSoundEffect("SpawnDisplayBack","shell_menu_exit");
SetPlanetaryBonusVoiceOver(IMP,IMP,0,"imp_bonus_imp_medical");
SetPlanetaryBonusVoiceOver(IMP,ALL,0,"imp_bonus_all_medical");
SetPlanetaryBonusVoiceOver(IMP,IMP,1,"");
SetPlanetaryBonusVoiceOver(IMP,ALL,1,"");
SetPlanetaryBonusVoiceOver(IMP,IMP,2,"imp_bonus_imp_sensors");
SetPlanetaryBonusVoiceOver(IMP,ALL,2,"imp_bonus_all_sensors");
SetPlanetaryBonusVoiceOver(IMP,IMP,3,"imp_bonus_imp_hero");
SetPlanetaryBonusVoiceOver(IMP,ALL,3,"imp_bonus_all_hero");
SetPlanetaryBonusVoiceOver(IMP,IMP,4,"imp_bonus_imp_reserves");
SetPlanetaryBonusVoiceOver(IMP,ALL,4,"imp_bonus_all_reserves");
SetPlanetaryBonusVoiceOver(IMP,IMP,5,"imp_bonus_imp_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(IMP,ALL,5,"imp_bonus_all_sabotage");
SetPlanetaryBonusVoiceOver(IMP,IMP,6,"");
SetPlanetaryBonusVoiceOver(IMP,ALL,6,"");
SetPlanetaryBonusVoiceOver(IMP,IMP,7,"imp_bonus_imp_training");--advanced training
SetPlanetaryBonusVoiceOver(IMP,ALL,7,"imp_bonus_all_training");--advanced training
SetPlanetaryBonusVoiceOver(ALL,ALL,0,"all_bonus_all_medical");
SetPlanetaryBonusVoiceOver(ALL,IMP,0,"all_bonus_imp_medical");
SetPlanetaryBonusVoiceOver(ALL,ALL,1,"");
SetPlanetaryBonusVoiceOver(ALL,IMP,1,"");
SetPlanetaryBonusVoiceOver(ALL,ALL,2,"all_bonus_all_sensors");
SetPlanetaryBonusVoiceOver(ALL,IMP,2,"all_bonus_imp_sensors");
SetPlanetaryBonusVoiceOver(ALL,ALL,3,"all_bonus_all_hero");
SetPlanetaryBonusVoiceOver(ALL,IMP,3,"all_bonus_imp_hero");
SetPlanetaryBonusVoiceOver(ALL,ALL,4,"all_bonus_all_reserves");
SetPlanetaryBonusVoiceOver(ALL,IMP,4,"all_bonus_imp_reserves");
SetPlanetaryBonusVoiceOver(ALL,ALL,5,"all_bonus_all_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(ALL,IMP,5,"all_bonus_imp_sabotage");
SetPlanetaryBonusVoiceOver(ALL,ALL,6,"");
SetPlanetaryBonusVoiceOver(ALL,IMP,6,"");
SetPlanetaryBonusVoiceOver(ALL,ALL,7,"all_bonus_all_training");--advanced training
SetPlanetaryBonusVoiceOver(ALL,IMP,7,"all_bonus_imp_training");--advanced training
--end soundconfig

--start activebonus
--end activebonus

--start camerashots
--   These camera coordinates are found using the freeCamera in SPTest.
--   using the "dumpcamera" command (not sure of the exact wordage) SPTest
--  creates a camera coordinates file - you can copy/paste these coordinates
--  here to set up the VICTORY/DEFEAT screenshots that appear at the end of a mission.
--  I believe they also appear in the background of the Spawn Screen.
   AddCameraShot(-0.095777, 0.014938, -0.983401, -0.153379, 136.105103, 6.695038, 45.282383);
   AddCameraShot(-0.019187, 0.003187, -0.986296, -0.163836, 14.197001, 4.032150, 57.600346);
   AddCameraShot(0.941011, 0.103629, 0.320182, -0.035260, 23.043026, 1.548243, 88.652977);
--end camerashots

--start footer
end
--end footer[/spoiler]

I've got my custom common.lvl in Tat4\Data\_lvl_pc\Common\common.lvl

It's loading in - I have custom controlzones, and have them calling on a different image geometry file (not imp_icon.msh that the stock bases uses - but I think after looking through some LUAs that the shell is using the stock imp_icon.msh.  Is there a way to use a custom shell.lvl for a single map?