SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: Ty294 on May 18, 2020, 10:31:08 AM

Title: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 18, 2020, 10:31:08 AM
Hey fellow modders, I'm having a big of an issue trying to get a custom common.lvl to load into an addon map. I've looked across several threads and messages around here and the best I've been able to come up with is you just need the line:

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

In your LUA, along with placing the modified common.lvl into "Data\_lvl_pc\COMMON"

The thing is... I've done that and then some, but it won't work. In fact, to be thorough, I have uploaded two different common files (common.lvl and sepan_common.lvl) into EVERY level of my addon folder.

SepV\Data\_lvl_pc\COMMON\eng

Every one of those five folders has the two .lvl folders in it, just to quintuply sure I have them there! Then I even put the sepan_common.lvl in the base files too, to see if I could load it from there...

Then, I added multiple lines in the LUA to try and get *any* of them to read:


---------------------------------------------------------------------------
-- 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.
---------------------------------------------------------------------------

function ScriptInit()
--  Empire Attacking (attacker is always #1)
    --local IMP = 1
    --local ALL = 2
    local CIS = 1
    local ALL = 2
    local Empire = 3
--  These variables do not change
    local ATT = 1
    local DEF = 2

    AddMissionObjective(CIS, "red", "level.SepV.objectives.1");
--    AddMissionObjective(CIS, "orange", "level.SepV.objectives.2");
    AddMissionObjective(CIS, "orange", "level.SepV.objectives.3");
--    AddMissionObjective(ALL, "red", "level.SepV.objectives.1");
    AddMissionObjective(ALL, "orange", "level.SepV.objectives.2");
    AddMissionObjective(ALL, "orange", "level.SepV.objectives.3");

    ReadDataFile("sound\\bes.lvl;bes1gcw");
    ReadDataFile("dc:sound\\SepV.lvl;SepanVgcw")

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

    ReadDataFile("SIDE\\all.lvl",
        "all_inf_basicdesert",
"all_inf_lukeskywalker",
        "all_inf_smuggler");

    ReadDataFile("SIDE\\imp.lvl",
        "imp_inf_basic_tie",
"imp_inf_darthvader",
        "imp_inf_dark_trooper",
"imp_fly_tiebomber",
        "imp_fly_tiefighter");

    ReadDataFile("dc:SIDE\\sep.lvl",
        "sep_fly_fighters",
"sep_fly_gunship",
"rip_inf_basic",
"dim_inf_basic",
"imp_inf_pilot");
   
    SetAttackingTeam(ATT);

--      Alliance Stats
    SetTeamName(ALL, "Alliance")
    SetTeamIcon(ALL, "all_icon")
    AddUnitClass(ALL, "rip_inf_pilot",10)
    AddUnitClass(ALL, "rip_inf_mechanic",5)
    AddUnitClass(ALL, "rip_inf_trooper",5)
    SetHeroClass(ALL, "all_inf_lukeskywalker")

--      Imperial Stats
    --SetTeamName(IMP, "Empire")
    --SetTeamIcon(IMP, "imp_icon")
    SetTeamName(CIS, "CIS")
    SetTeamIcon(CIS, "CIS_icon")
    AddUnitClass(CIS, "dim_inf_pilot",10)
    AddUnitClass(CIS, "dim_inf_mechanic",5)
    AddUnitClass(CIS, "dim_inf_trooper",5)
    SetHeroClass(CIS, "imp_inf_darthvader")
   
--  Attacker Stats
    SetUnitCount(ATT, 20)
    SetReinforcementCount(ATT, 200)
--    AddBleedThreshold(ATT, 31, 0.0)
--    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 0.75)
    AddBleedThreshold(ATT, 10, 1.5)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 20)
    SetReinforcementCount(DEF, 200)
--    AddBleedThreshold(DEF, 31, 0.0)
--    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 0.75)
    AddBleedThreshold(DEF, 10, 1.5)
    AddBleedThreshold(DEF, 1, 3.0)

    SetTeamName(3, "Empire")
    SetTeamIcon(3, "imp_icon")
    AddUnitClass(3, "imp_inf_pilot",8)
    AddUnitClass(3, "imp_inf_gunner",8)
    SetUnitCount(3, 16)
    SetTeamAsEnemy(3, ATT)
    SetTeamAsEnemy(3, DEF)

--  Level Stats
    ClearWalkers()
    AddWalkerType(0, 4) -- Droidekas
    AddWalkerType(1, 4) -- number of leg pairs, count
    AddWalkerType(2, 0)
    --SetMemoryPoolSize("EntityHover", 12)
    SetMemoryPoolSize("EntityFlyer", 55)
--  SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
--  SetMemoryPoolSize("EntityTauntaun", 0)
--  SetMemoryPoolSize("MountedTurret", 22)
    SetMemoryPoolSize("PowerupItem", 60)
--    SetMemoryPoolSize("SoundSpaceRegion", 85)
    SetMemoryPoolSize("EntityMine", 40)
    --SetMemoryPoolSize("Aimer", 200)
--    SetMemoryPoolSize("Obstacle", 725)
    --SetMemoryPoolSize("EntityLight", 150)

SetAllowBlindJetJumps(0)
SetMemoryPoolSize("Aimer", 999)
SetAttackerSnipeRange(500)
SetDefenderSnipeRange(500)

    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:SepV\\SepV.lvl")
    ReadDataFile("dc:COMMON\\common.lvl")
    SetDenseEnvironment("false")
SetMinFlyHeight(20)
    SetMinPlayerFlyHeight(-50)
    SetMaxFlyHeight(150) --250
    SetMaxPlayerFlyHeight(150) --250
    SetAIVehicleNotifyRadius(400) --64
    SetStayInTurrets(1)

    AddDeathRegion("fall1")
    AddDeathRegion("death")

--  Sound Stats
    OpenAudioStream("sound\\bes.lvl",  "bes1gcw_music");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_vo");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_tac_vo");
    OpenAudioStream("sound\\bes.lvl",  "bes1");
    OpenAudioStream("sound\\bes.lvl",  "bes1");
    OpenAudioStream("dc:sound\\SepV.lvl",  "SepanV");
    OpenAudioStream("dc:sound\\SepV.lvl",  "SepanV");

    SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1);
    SetBleedingVoiceOver(ALL, CIS, "all_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(CIS, ALL, "imp_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(CIS, CIS, "imp_off_com_report_us_overwhelmed", 1);

    SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(ALL, CIS, "all_off_victory_im", .1, 1);
    SetLowReinforcementsVoiceOver(CIS, CIS, "imp_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(CIS, ALL, "imp_off_victory_im", .1, 1);

    SetOutOfBoundsVoiceOver(1, "Allleaving");
    SetOutOfBoundsVoiceOver(2, "Impleaving");

    SetAmbientMusic(ALL, 1.0, "all_bes_amb_start",0,1);
    SetAmbientMusic(ALL, 0.99, "all_bes_amb_middle",1,1);
    SetAmbientMusic(ALL, 0.1,"all_bes_amb_end",2,1);
    SetAmbientMusic(CIS, 1.0, "imp_bes_amb_start",0,1);
    SetAmbientMusic(CIS, 0.99, "imp_bes_amb_middle",1,1);
    SetAmbientMusic(CIS, 0.1,"imp_bes_amb_end",2,1);

--   SetAmbientMusic(IMP, 1.0, "imp_bes_amb_start",0,1);
  --  SetAmbientMusic(IMP, 0.99, "imp_bes_amb_middle",1,1);
  --  SetAmbientMusic(IMP, 0.1,"imp_bes_amb_end",2,1);

    SetVictoryMusic(ALL, "all_bes_amb_victory");
    SetDefeatMusic (ALL, "all_bes_amb_defeat");
    SetVictoryMusic(CIS, "imp_bes_amb_victory");
    SetDefeatMusic (CIS, "imp_bes_amb_defeat");

--    SetVictoryMusic(IMP, "imp_bes_amb_victory");
  --  SetDefeatMusic (IMP, "imp_bes_amb_defeat");



    SetSoundEffect("ScopeDisplayZoomIn",  "binocularzoomin");
    SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout");
    --SetSoundEffect("WeaponUnableSelect",  "com_weap_inf_weaponchange_null");
    --SetSoundEffect("WeaponModeUnableSelect",  "com_weap_inf_modechange_null");
    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(CIS, CIS, 3, "imp_bonus_imp_hero");
    SetPlanetaryBonusVoiceOver(CIS, ALL, 3, "imp_bonus_all_hero");
    --SetPlanetaryBonusVoiceOver(IMP, IMP, 4, "imp_bonus_imp_reserves");
    --SetPlanetaryBonusVoiceOver(IMP, ALL, 4, "imp_bonus_all_reserves");

    SetPlanetaryBonusVoiceOver(ALL, ALL, 3, "all_bonus_all_hero");
    SetPlanetaryBonusVoiceOver(ALL, CIS, 3, "all_bonus_imp_hero");
    --SetPlanetaryBonusVoiceOver(ALL, ALL, 4, "all_bonus_all_reserves");
    --SetPlanetaryBonusVoiceOver(ALL, IMP, 4, "all_bonus_imp_reserves");


--  Camera Stats
--Tat 3 - Jabbas' Palace
    AddCameraShot(0.685601, -0.253606, -0.639994, -0.236735, -65.939224, -0.176558, 127.400444);
    AddCameraShot(0.786944, 0.050288, -0.613719, 0.039218, -80.626396, 1.175180, 133.205551);
    AddCameraShot(0.997982, 0.061865, -0.014249, 0.000883, -65.227898, 1.322798, 123.976990);
    AddCameraShot(-0.367869, -0.027819, -0.926815, 0.070087, -19.548307, -5.736280, 163.360519);
    AddCameraShot(0.773980, -0.100127, -0.620077, -0.080217, -61.123989, -0.629283, 176.066025);
    AddCameraShot(0.978189, 0.012077, 0.207350, -0.002560, -88.388947, 5.674968, 153.745255);
    AddCameraShot(-0.144606, -0.010301, -0.986935, 0.070304, -106.872772, 2.066469, 102.783096);
    AddCameraShot(0.926756, -0.228578, -0.289446, -0.071390, -60.819584, -2.117482, 96.400620);
    AddCameraShot(0.873080, 0.134285, 0.463274, -0.071254, -52.071609, -8.430746, 67.122437);
    AddCameraShot(0.773398, -0.022789, -0.633236, -0.018659, -32.738083, -7.379394, 81.508003);
    AddCameraShot(0.090190, 0.005601, -0.993994, 0.061733, -15.379695, -9.939115, 72.110054);
    AddCameraShot(0.971737, -0.118739, -0.202524, -0.024747, -16.591295, -1.371236, 147.933029);
    AddCameraShot(0.894918, 0.098682, -0.432560, 0.047698, -20.577391, -10.683214, 128.752563);

end


And yet, nothing ever changes. I tested the common.lvl on the base game to make sure it wasn't an issue with the .lvl itself, and it works just fine. So somehow I've got a loading issue going on here, and I cannot figure out what it is. Anyone know what I'm missing?

Thanks in advance!
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: wsa30h on May 18, 2020, 10:51:02 AM
try just loading one of the common lvl's in the lua
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 18, 2020, 11:03:27 AM
Quote from: wsa30h on May 18, 2020, 10:51:02 AM
try just loading one of the common lvl's in the lua

Is "loading" done differently than how I have it put in? Or are you saying to remove the lines until I'm only attempting to load one?
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Dark_Phantom on May 18, 2020, 11:13:50 AM
From what I remember, loading in a custom common is finicky, but Sereja has successfully done it for a long time.  His directory structure is:
Addon\004\Data\_lvl_pc\COMMON\common.lvl
then he seems to call it in the same way you do - what I remember from the discussion is that it's before sides but after sounds (which is where yours is, so that's good).

However, I would try something - please backup the stock common.lvl and try to load in the new common.lvl instead.  If it is crashing then, it is a problem with your common, if not, we need to dig deeper into why this isn't loading in and what you are trying to load in.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Led on May 18, 2020, 11:17:19 AM
dont use the DC

hard code the folder structure from gamedata

I should have a tutorial in the tutorials section
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: wsa30h on May 18, 2020, 11:45:29 AM
serejas works for me i use it to load the pilot animations for the atrt and barspeeder so the only thing you can do is what dark_phantom said and test your common in place of the stock one.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 18, 2020, 01:20:58 PM
Quote from: Dark_Phantom on May 18, 2020, 11:13:50 AM
From what I remember, loading in a custom common is finicky, but Sereja has successfully done it for a long time.  His directory structure is:
Addon\004\Data\_lvl_pc\COMMON\common.lvl
then he seems to call it in the same way you do - what I remember from the discussion is that it's before sides but after sounds (which is where yours is, so that's good).

However, I would try something - please backup the stock common.lvl and try to load in the new common.lvl instead.  If it is crashing then, it is a problem with your common, if not, we need to dig deeper into why this isn't loading in and what you are trying to load in.

I have tested it before that way and it does work just fine. That was my first thought was that the common.lvl was broken, but it apparently is not. Just tested it again to be thorough, and yeah, it isn't the common.lvl.

As for what I'm changing, basically I am wanting to change the faction logo .msh's, as well as possibly the faction icons that appear when you select the map (not sure if that part is possible).

I remember seeing something mentioned about faction logos in one of the threads, and something about maybe having to rework the shell or something? But I don't think it was explained how.

In order to better gauge whether what I was doing was working or not, I made one other small change, which was to override the default "ord_explosion.fx" with the one from BF2 (bigger and has more sparks), since I figured that should be an easy one to change. But either way I have not seen any change when attempting to load the custom common.

Quote from: Led on May 18, 2020, 11:17:19 AM
dont use the DC

hard code the folder structure from gamedata

I should have a tutorial in the tutorials section

So, like this?

ReadDataFile("GameData\\AddOn\\SepV\\Data\\_lvl_pc\\COMMON\\common.lvl")

or?

ReadDataFile("AddOn\\SepV\\Data\\_lvl_pc\\COMMON\\common.lvl")

(Just tried both of those, but with no success.)
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Led on May 18, 2020, 01:26:19 PM
Here is the tutorial
https://www.swbfgamers.com/index.php?topic=4923.msg46895#msg46895

just to make sure your common works, place it in the games common folder

and use:
ReadDataFile("COMMON\\common-dot.lvl") 

but of course your your common file name
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 18, 2020, 08:13:53 PM
I'm still getting no sign of it working. Here is my updated LUA:

---------------------------------------------------------------------------
-- 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.
---------------------------------------------------------------------------

function ScriptInit()
--  Empire Attacking (attacker is always #1)
    --local IMP = 1
    --local ALL = 2
    local CIS = 1
    local ALL = 2
    local Empire = 3
--  These variables do not change
    local ATT = 1
    local DEF = 2

    AddMissionObjective(CIS, "red", "level.SepV.objectives.1");
--    AddMissionObjective(CIS, "orange", "level.SepV.objectives.2");
    AddMissionObjective(CIS, "orange", "level.SepV.objectives.3");
--    AddMissionObjective(ALL, "red", "level.SepV.objectives.1");
    AddMissionObjective(ALL, "orange", "level.SepV.objectives.2");
    AddMissionObjective(ALL, "orange", "level.SepV.objectives.3");

    ReadDataFile("sound\\bes.lvl;bes1gcw");
    ReadDataFile("dc:sound\\SepV.lvl;SepanVgcw");

    --ReadDataFile("dc:COMMON\\common.lvl")
    --ReadDataFile("GameData\\AddOn\\SepV\\Data\\_lvl_pc\\COMMON\\common.lvl")
    --ReadDataFile("AddOn\\SepV\\Data\\_lvl_pc\\COMMON\\common.lvl")
   ReadDataFile("common\\common-sepv.lvl");

    ReadDataFile("SIDE\\all.lvl",
        "all_inf_basicdesert",
"all_inf_lukeskywalker",
        "all_inf_smuggler");

    ReadDataFile("SIDE\\imp.lvl",
        "imp_inf_basic_tie",
"imp_inf_darthvader",
        "imp_inf_dark_trooper",
"imp_fly_tiebomber",
        "imp_fly_tiefighter");

    ReadDataFile("dc:SIDE\\sep.lvl",
        "sep_fly_fighters",
"sep_fly_gunship",
"rip_inf_basic",
"dim_inf_basic",
"imp_inf_pilot");


    ReadDataFile("common\\common-sepv.lvl");
   
    SetAttackingTeam(ATT);

--      Alliance Stats
    SetTeamName(ALL, "Alliance")
    SetTeamIcon(ALL, "all_icon")
    AddUnitClass(ALL, "rip_inf_pilot",10)
    AddUnitClass(ALL, "rip_inf_mechanic",5)
    AddUnitClass(ALL, "rip_inf_trooper",5)
    SetHeroClass(ALL, "all_inf_lukeskywalker")

--      Imperial Stats
    --SetTeamName(IMP, "Empire")
    --SetTeamIcon(IMP, "imp_icon")
    SetTeamName(CIS, "CIS")
    SetTeamIcon(CIS, "CIS_icon")
    AddUnitClass(CIS, "dim_inf_pilot",10)
    AddUnitClass(CIS, "dim_inf_mechanic",5)
    AddUnitClass(CIS, "dim_inf_trooper",5)
    SetHeroClass(CIS, "imp_inf_darthvader")
   
--  Attacker Stats
    SetUnitCount(ATT, 20)
    SetReinforcementCount(ATT, 200)
--    AddBleedThreshold(ATT, 31, 0.0)
--    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 0.75)
    AddBleedThreshold(ATT, 10, 1.5)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 20)
    SetReinforcementCount(DEF, 200)
--    AddBleedThreshold(DEF, 31, 0.0)
--    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 0.75)
    AddBleedThreshold(DEF, 10, 1.5)
    AddBleedThreshold(DEF, 1, 3.0)

    SetTeamName(3, "Empire")
    SetTeamIcon(3, "imp_icon")
    AddUnitClass(3, "imp_inf_pilot",8)
    AddUnitClass(3, "imp_inf_gunner",8)
    SetUnitCount(3, 16)
    SetTeamAsEnemy(3, ATT)
    SetTeamAsEnemy(3, DEF)

--  Level Stats
    ClearWalkers()
    AddWalkerType(0, 4) -- Droidekas
    AddWalkerType(1, 4) -- number of leg pairs, count
    AddWalkerType(2, 0)
    --SetMemoryPoolSize("EntityHover", 12)
    SetMemoryPoolSize("EntityFlyer", 55)
--  SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
--  SetMemoryPoolSize("EntityTauntaun", 0)
--  SetMemoryPoolSize("MountedTurret", 22)
    SetMemoryPoolSize("PowerupItem", 60)
--    SetMemoryPoolSize("SoundSpaceRegion", 85)
    SetMemoryPoolSize("EntityMine", 40)
    --SetMemoryPoolSize("Aimer", 200)
--    SetMemoryPoolSize("Obstacle", 725)
    --SetMemoryPoolSize("EntityLight", 150)

SetAllowBlindJetJumps(0)
SetMemoryPoolSize("Aimer", 999)
SetAttackerSnipeRange(500)
SetDefenderSnipeRange(500)

    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:SepV\\SepV.lvl")
    ReadDataFile("dc:COMMON\\common.lvl")
    SetDenseEnvironment("false")
SetMinFlyHeight(20)
    SetMinPlayerFlyHeight(-50)
    SetMaxFlyHeight(150) --250
    SetMaxPlayerFlyHeight(150) --250
    SetAIVehicleNotifyRadius(400) --64
    SetStayInTurrets(1)

    AddDeathRegion("fall1")
    AddDeathRegion("death")

--  Sound Stats
    OpenAudioStream("sound\\bes.lvl",  "bes1gcw_music");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_vo");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_tac_vo");
    OpenAudioStream("sound\\bes.lvl",  "bes1");
    OpenAudioStream("sound\\bes.lvl",  "bes1");
    OpenAudioStream("dc:sound\\SepV.lvl",  "SepanV");
    OpenAudioStream("dc:sound\\SepV.lvl",  "SepanV");

    SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1);
    SetBleedingVoiceOver(ALL, CIS, "all_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(CIS, ALL, "imp_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(CIS, CIS, "imp_off_com_report_us_overwhelmed", 1);

    SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(ALL, CIS, "all_off_victory_im", .1, 1);
    SetLowReinforcementsVoiceOver(CIS, CIS, "imp_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(CIS, ALL, "imp_off_victory_im", .1, 1);

    SetOutOfBoundsVoiceOver(1, "Allleaving");
    SetOutOfBoundsVoiceOver(2, "Impleaving");

    SetAmbientMusic(ALL, 1.0, "all_bes_amb_start",0,1);
    SetAmbientMusic(ALL, 0.99, "all_bes_amb_middle",1,1);
    SetAmbientMusic(ALL, 0.1,"all_bes_amb_end",2,1);
    SetAmbientMusic(CIS, 1.0, "imp_bes_amb_start",0,1);
    SetAmbientMusic(CIS, 0.99, "imp_bes_amb_middle",1,1);
    SetAmbientMusic(CIS, 0.1,"imp_bes_amb_end",2,1);

--   SetAmbientMusic(IMP, 1.0, "imp_bes_amb_start",0,1);
  --  SetAmbientMusic(IMP, 0.99, "imp_bes_amb_middle",1,1);
  --  SetAmbientMusic(IMP, 0.1,"imp_bes_amb_end",2,1);

    SetVictoryMusic(ALL, "all_bes_amb_victory");
    SetDefeatMusic (ALL, "all_bes_amb_defeat");
    SetVictoryMusic(CIS, "imp_bes_amb_victory");
    SetDefeatMusic (CIS, "imp_bes_amb_defeat");

--    SetVictoryMusic(IMP, "imp_bes_amb_victory");
  --  SetDefeatMusic (IMP, "imp_bes_amb_defeat");



    SetSoundEffect("ScopeDisplayZoomIn",  "binocularzoomin");
    SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout");
    --SetSoundEffect("WeaponUnableSelect",  "com_weap_inf_weaponchange_null");
    --SetSoundEffect("WeaponModeUnableSelect",  "com_weap_inf_modechange_null");
    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(CIS, CIS, 3, "imp_bonus_imp_hero");
    SetPlanetaryBonusVoiceOver(CIS, ALL, 3, "imp_bonus_all_hero");
    --SetPlanetaryBonusVoiceOver(IMP, IMP, 4, "imp_bonus_imp_reserves");
    --SetPlanetaryBonusVoiceOver(IMP, ALL, 4, "imp_bonus_all_reserves");

    SetPlanetaryBonusVoiceOver(ALL, ALL, 3, "all_bonus_all_hero");
    SetPlanetaryBonusVoiceOver(ALL, CIS, 3, "all_bonus_imp_hero");
    --SetPlanetaryBonusVoiceOver(ALL, ALL, 4, "all_bonus_all_reserves");
    --SetPlanetaryBonusVoiceOver(ALL, IMP, 4, "all_bonus_imp_reserves");


--  Camera Stats
--Tat 3 - Jabbas' Palace
    AddCameraShot(0.685601, -0.253606, -0.639994, -0.236735, -65.939224, -0.176558, 127.400444);
    AddCameraShot(0.786944, 0.050288, -0.613719, 0.039218, -80.626396, 1.175180, 133.205551);
    AddCameraShot(0.997982, 0.061865, -0.014249, 0.000883, -65.227898, 1.322798, 123.976990);
    AddCameraShot(-0.367869, -0.027819, -0.926815, 0.070087, -19.548307, -5.736280, 163.360519);
    AddCameraShot(0.773980, -0.100127, -0.620077, -0.080217, -61.123989, -0.629283, 176.066025);
    AddCameraShot(0.978189, 0.012077, 0.207350, -0.002560, -88.388947, 5.674968, 153.745255);
    AddCameraShot(-0.144606, -0.010301, -0.986935, 0.070304, -106.872772, 2.066469, 102.783096);
    AddCameraShot(0.926756, -0.228578, -0.289446, -0.071390, -60.819584, -2.117482, 96.400620);
    AddCameraShot(0.873080, 0.134285, 0.463274, -0.071254, -52.071609, -8.430746, 67.122437);
    AddCameraShot(0.773398, -0.022789, -0.633236, -0.018659, -32.738083, -7.379394, 81.508003);
    AddCameraShot(0.090190, 0.005601, -0.993994, 0.061733, -15.379695, -9.939115, 72.110054);
    AddCameraShot(0.971737, -0.118739, -0.202524, -0.024747, -16.591295, -1.371236, 147.933029);
    AddCameraShot(0.894918, 0.098682, -0.432560, 0.047698, -20.577391, -10.683214, 128.752563);

end


Here's where I put the files:

(https://i.ibb.co/Gspv6v9/1.png) (https://ibb.co/jVfvNvz)
(https://i.ibb.co/m87WRz5/2.png) (https://ibb.co/2NB4FK3)

(Never mind the --common.lvl, that is the latest Steam one, which I replaced with a 1.2 version so I could get the Freecam back.)

I noticed in the tutorial thread that the other thread it links to mentions a common.req file, though that is just for the BF2 loading screen. Is there another element like that which I am missing here though? Some minor addition to another file somewhere?

Also, if anyone is willing to take a few minutes to test it to see if they can get it to work, here (https://www.dropbox.com/s/z5juc8cfzlpvkn9/common-sepv.lvl?dl=0) is my common.lvl file. The changes you should see are the Rebel and CIS icons replaced with a wrench icon (just borrowed one of the other holo icons from the assets for testing purposes) and the main ordnance impact replaced with the larger BF2 version.

I appreciate all the help guys!
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: wsa30h on May 19, 2020, 02:03:04 AM
it looks like it should work. quick question does the empire icon work when you have them set as team 3 ?
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 19, 2020, 05:37:57 AM
Quote from: wsa30h on May 19, 2020, 02:03:04 AMquick question does the empire icon work when you have them set as team 3 ?

It does, yes.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: wsa30h on May 19, 2020, 08:11:50 AM
thanks also dont forget your third faction can have an invisible reinforcement counter  SetReinforcementCount(3, 350)
just change the 350 to whatever you want.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 19, 2020, 10:58:00 AM
Quote from: wsa30h on May 19, 2020, 08:11:50 AM
thanks also dont forget your third faction can have an invisible reinforcement counter  SetReinforcementCount(3, 350)
just change the 350 to whatever you want.

Oh, didn't know that one. Thanks! Might come up in a future project, though for this map the Empire is supposed to have unlimited reinforcement count, so I won't be adding it here.




Update on the other front, turns out it is an issue with my common. The way I found out was I downloaded one of Sereja's asset folders, borrowed his common, then threw it into my map's folder, and just added the old "ReadDataFile("dc:COMMON\\common.lvl")" back into the LUA. All of a sudden my pistol animation was replaced with the Han Solo-style pistol animation that Sereja's maps use!

I have to guess that this means that my common is lacking something. It works just fine if I replace the base common in Gamedata, but it won't override the base common when in a mod folder. I will play around with it a bit, but if anyone has any idea what this could be...?
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Dark_Phantom on May 19, 2020, 11:56:56 AM
I am pretty sure he uses the common.lvl builder that this site uses, I don't know if you are using anything different:
http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1541
(I combined common and shell for convenience, but looking back I may separate again in a future update)
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 19, 2020, 05:19:28 PM
Quote from: Dark_Phantom on May 19, 2020, 11:56:56 AM
I am pretty sure he uses the common.lvl builder that this site uses, I don't know if you are using anything different:
http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1541
(I combined common and shell for convenience, but looking back I may separate again in a future update)

I was using the battlebelk interface tool, also found here. However, I just tried the one you suggested just now... same result. Am I supposed to do something with the shell? Or edit one of the files under LUA? (I noticed the battlebelk version of the tool does not have that folder in the "Custom" section.)

I may have to message Sereja to see if he did anything else differently, if nobody else knows.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Led on May 19, 2020, 05:35:55 PM
Suggest you use full mod tools, understand what all is in the stock common.  Use all stock common items, add new items one at a time, check your req files. 

Check for crash/no crash after each change.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Dark_Phantom on May 19, 2020, 09:14:58 PM
The structure of that tool is that you replace stuff in custom, like scripts (I mean, you could replace Data, but think of that as like your backup).
Listen to Led - work through it slowly, don't go replacing many things at once so hopefully the problem can be found.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 20, 2020, 06:20:30 AM
Quote from: Led on May 19, 2020, 05:35:55 PM
Suggest you use full mod tools, understand what all is in the stock common.  Use all stock common items, add new items one at a time, check your req files. 

Check for crash/no crash after each change.
Quote from: Dark_Phantom on May 19, 2020, 09:14:58 PM
The structure of that tool is that you replace stuff in custom, like scripts (I mean, you could replace Data, but think of that as like your backup).
Listen to Led - work through it slowly, don't go replacing many things at once so hopefully the problem can be found.

Again, appreciate your guys help and sorry if I'm straining your patience; this issue gets more and more baffling for me.

So, for one, I have not had a crashing issue at all. The problem is merely that it won't affect anything in the mod map. But as I have established (and tested again to be sure and confirm), Sereja's common will load into my mod map, so my LUA must be correct.

However, if I try to do the same thing with loading my common into the mod map, nothing happens.

But at the same time, I have replaced the base game common.lvl with my common, and have attempted it with a few smaller versions, and it works every time in that circumstance.

So, I just tried another experiment... I replaced the base common.lvl with my common.

D:\SteamLibrary\steamapps\common\Star Wars Battlefront (Classic 2004)\GameData\Data\_LVL_PC\Common\ENG\common.lvl

And took the original common.lvl and put it in my mod map directory.

D:\SteamLibrary\steamapps\common\Star Wars Battlefront (Classic 2004)\GameData\AddOn\SepV\Data\_lvl_pc\COMMON\common.lvl

And it also does not work!

This leads me to suspect that there must be something specific and special in Sereja's common.lvl that gets it to load into the map...

That, or he did not attempt to override any of the interface/msh/odf items in common and just did the pistol animation. Truth be told I don't know the full extent of what his common affects other than the pistol animation...

My attempted changes have been:

Effects:

Replace headshot.fx, lightsabre_deflect.fx, lightsabre_hit.fx, ord_explosion.fx
Add com_sfx_laser_orange.tga, com_sfx_smoke3.tga (to provide textures to new ord_explosion.fx)

Interface:

Replace all_icon.tga, cis_icon.tga, HUD_all_icon.tga, HUD_cis_icon.tga

MSH:

Replace com_icon_alliance.msh, com_icon_CIS.msh

ODF:

Replace com_bldg_controlzone.odf


Again, all changes work if I put the common.lvl directly into the base game, they just won't override if I attempt to load them into a mod map. And likewise, the regular common won't override this changes if I reverse their places.

I'm going to message Sereja on the matter, though I'm not sure how soon I'll get a reply since it appears he's been away a while.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Dark_Phantom on May 20, 2020, 08:17:06 AM
fx and .tga files should replace correctly I believe.
However, you can't override msh and odf using a custom common.  This could be enough to cause a crash but I didn't think it would.

Edit: I guess I should explain:
fx and textures seem to be more flexible and allowed to be loaded in at any trigger.  Take for example the sky changer - which overwrites the sky (usually just through a tga).  However, classes (odf) and geometries (msh) really do not take kindly to being switched out. As in, if you try to replace a class on the spawn screen using the sky changer method or swap in a new geometry for a field object like a pillar, I am pretty sure the game crashes (and if it doesn't it does nothing, it's been a while).  The common.lvl load in falls along the same theory - if you try to replace a static class that has already been called into the map, it will crash.  If it is the same, I think it just ignores it or it loads it again but since there isn't a difference it doesn't crash. This is just the way that the game engine handles these things.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 20, 2020, 09:24:18 AM
Quote from: Dark_Phantom on May 20, 2020, 08:17:06 AM
fx and .tga files should replace correctly I believe.
However, you can't override msh and odf using a custom common.  This could be enough to cause a crash but I didn't think it would.

Edit: I guess I should explain:
fx and textures seem to be more flexible and allowed to be loaded in at any trigger.  Take for example the sky changer - which overwrites the sky (usually just through a tga).  However, classes (odf) and geometries (msh) really do not take kindly to being switched out. As in, if you try to replace a class on the spawn screen using the sky changer method or swap in a new geometry for a field object like a pillar, I am pretty sure the game crashes (and if it doesn't it does nothing, it's been a while).  The common.lvl load in falls along the same theory - if you try to replace a static class that has already been called into the map, it will crash.  If it is the same, I think it just ignores it or it loads it again but since there isn't a difference it doesn't crash. This is just the way that the game engine handles these things.

Ah, I see.

I attempted it again with only FX/TGAs and still got no results though, so I have to imagine I'm doing something else wrong.

HOWEVER, that is largely irrelevant now I would think, since my primary goal was to replace the faction icons. If what you are saying is correct, then am I correct in assuming they cannot be overridden on an per-addon-map basis at all? Essentially the only way to replace them is via the base game common, which of course you don't want to really have to mess with if it's just for an addon map.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Dark_Phantom on May 20, 2020, 12:23:42 PM
Pretty much. Interesting that the fx and tgas aren't working still though.  Animations can also be changed, as you can see from Sereja's common mod, but the msh files are most likely never going to work using this method.

If you use a common.lvl generated from my version of the tool, does it seem to work correctly?
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 20, 2020, 12:56:42 PM
Quote from: Dark_Phantom on May 20, 2020, 12:23:42 PM
Pretty much. Interesting that the fx and tgas aren't working still though.  Animations can also be changed, as you can see from Sereja's common mod, but the msh files are most likely never going to work using this method.

If you use a common.lvl generated from my version of the tool, does it seem to work correctly?

Not for pulling it into the addon map, no. It's the same result as the version generated with the Battlebelk version; it works when replacing the main common, but just won't load into mod map.

It would be nice to get it working, but as I indicated, the main reason I wanted it was to attempt to replace/remove the icons for each faction, which apparently I cannot do. So, it is not that big a priority anymore I'm afraid. lol

On a positive note, I tested something completely unrelated, and while it also won't solve my problem, it does present a potentially intriguing discovery (assuming other people have not already discovered it, which is possible, I've clearly missed a lot in eight+ years). But that's another matter.

I appreciate the help, in any case. Guess I'll just have to deal with the fact that two non-mainline factions are gonna have mainline faction logos in the selection page. Oh well! lol
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Led on May 20, 2020, 02:27:48 PM
I have seen maps with custom holograms.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 21, 2020, 05:21:15 AM
Quote from: Led on May 20, 2020, 02:27:48 PM
I have seen maps with custom holograms.

Did they include in the unit selection screen?

I know it is possible to use custom holos if you make your own controlzone/commandpost .odfs to use on your map. You can just override what meshes are loaded in.

If you've seen versions with custom icons even for the unit selection screen though, I'd love to know which maps they were so I can try to search out assets or reach out to the modders who made them if possible.
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Led on May 21, 2020, 02:52:01 PM
I think it was just on the CP. 
Title: Re: ReadDataFile("dc:COMMON\\common.lvl") -- What am I doing wrong?
Post by: Ty294 on May 22, 2020, 06:03:34 AM
Quote from: Led on May 21, 2020, 02:52:01 PM
I think it was just on the CP.

Gotcha. Well, seeing as that is the best I can do, I will use that method.

Thanks again to everyone!
EhPortal 1.34 © 2024, WebDev