why does my script cause sliding soldiers and the game to crash ?

Started by wsa30h, July 18, 2019, 01:41:56 AM

Previous topic - Next topic
---------------------------------------------------------------------------
-- 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()
--  REP Attacking (attacker is always #1)
    local REP = 2;
    local CIS = 1;
--  These variables do not change
    local ATT = 1;
    local DEF = 2;

SetTeamAggressiveness(CIS, 0.95)
SetTeamAggressiveness(REP, 0.95)
SetMaxFlyHeight(100);

        AddMissionObjective(CIS, "orange", "level Korriban capture and hold command posts");
    AddMissionObjective(CIS, "red", "level Korriban eliminate the republic and local rebels");
    AddMissionObjective(REP, "orange", "level Korriban defeat the empire to start a galaxy wide rebellion");
    AddMissionObjective(REP, "red", "level Korriban capture and hold command posts");

    ReadDataFile("sound\\bes.lvl;bes2cw")
    ReadDataFile("dc:sound\\hot.lvl;hot1gcw")
        ReadDataFile("dc:sound\\tat.lvl;tat1cw")
    ReadDataFile("dc:sound\\kas.lvl;kas1cw")
    ReadDataFile("dc:sound\\nab.lvl;nab1gcw")
      ReadDataFile("sound\\bes.lvl;bes2gcw") 
    ReadDataFile("SIDE\\rep.lvl",
      "rep_bldg_forwardcenter",
        "rep_fly_assault_dome",
        "rep_fly_gunship",
        "rep_fly_gunship_dome",
        "rep_fly_jedifighter_dome",
        "rep_inf_basic",
        "rep_inf_macewindu",
        "rep_inf_jet_trooper",
        "rep_hover_fightertank",
        "rep_hover_speederbike",
        "rep_walk_atte")
    ReadDataFile("SIDE\\imp.lvl",
        "imp_inf_basic_tie",
   "imp_inf_darthvader",
        "imp_walk_atst",
        "imp_hover_fightertank",
        "imp_walk_atat",
        "imp_hover_speederbike",
        "imp_inf_dark_trooper");

           ReadDataFile("SIDE\\all.lvl",
        "all_fly_xwing",
        "all_hover_combatspeeder",
        "all_inf_basicdesert",
        "all_inf_lukeskywalker",
        "all_inf_smuggler")
         ReadDataFile("SIDE\\cis.lvl",
       "cis_fly_droidfighter",
       "cis_fly_maf",
       "cis_hover_aat",
       "cis_hover_stap",
        "cis_inf_basic",
        "cis_inf_countdooku",
        "cis_tread_hailfire",
        "cis_walk_spider",
        "cis_inf_droideka");




--  Republic Stats
    SetTeamName(REP, "Republic");
    SetTeamIcon(REP, "rep_icon");
    AddUnitClass(REP, "rep_inf_clone_trooper",11)
    AddUnitClass(REP, "rep_inf_arc_trooper",3)
    AddUnitClass(REP, "rep_inf_clone_pilot",4)
    AddUnitClass(REP, "rep_inf_clone_sharpshooter",4)
    AddUnitClass(REP, "rep_inf_jet_trooper",3)
    SetHeroClass(REP, "rep_inf_macewindu")
    SetAttackingTeam(ATT);

--  CIS Stats
    SetTeamName(CIS, "IMP");
    SetTeamIcon(CIS, "imp_icon");
    AddUnitClass(CIS, "imp_inf_storm_trooper",11)
    AddUnitClass(CIS, "imp_inf_shock_trooper",5)
    AddUnitClass(CIS, "imp_inf_pilottie",6)
    AddUnitClass(CIS, "imp_inf_scout_trooper",6)
    AddUnitClass(CIS, "imp_inf_dark_trooper",3)
    SetHeroClass(CIS, "imp_inf_darthvader")

--  Attacker Stats
    SetUnitCount(ATT, 40)
    SetReinforcementCount(ATT, 560)
   

--  Defender Stats
    SetUnitCount(DEF, 50)
    SetReinforcementCount(DEF, 640)
   
   --  Local Stats
    SetTeamName(3, "locals")
    AddUnitClass(3, "all_inf_soldierdesert", 15);
    AddUnitClass(3, "all_inf_vanguard", 2);
    AddUnitClass(3, "all_inf_pilot", 2);
    AddUnitClass(3, "all_inf_marksman", 2);
    AddUnitClass(3, "all_inf_smuggler", 5);
    SetUnitCount(3, 25)
    SetTeamAsEnemy(3, ATT)
    SetTeamAsEnemy(3, DEF)
     SetTeamAsFriend(3,4)
     SetTeamAsFriend(4,3)


     --  local Stats
    SetTeamName(4, "rebels")
    AddUnitClass(4, "cis_inf_battledroid", 15);
    AddUnitClass(4, "cis_inf_assault", 5);
    AddUnitClass(4, "cis_inf_assassindroid", 2);
    AddUnitClass(4, "cis_inf_droideka", 3);
    SetUnitCount(4, 25)
    SetTeamAsEnemy(3, ATT)
    SetTeamAsEnemy(3, DEF)
   

--  Level Stats
    ClearWalkers()
    AddWalkerType(0, 3) -- Droidekas
    AddWalkerType(3, 3) -- 3 attes with 3 leg pairs each
    AddWalkerType(1, 8) -- 6 atsts with 1 leg pairs each
    AddWalkerType(2, 1) -- 2 atats with 2 leg pairs each
    SetMemoryPoolSize("CommandWalker", 4)
SetMemoryPoolSize("EntityHover", 40)
    SetMemoryPoolSize("EntityCloth", 41)
    SetMemoryPoolSize("EntityFlyer", 6)
--  SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
--  SetMemoryPoolSize("EntityTauntaun", 0)
  SetMemoryPoolSize("MountedTurret", 48)
-- SetMemoryPoolSize("SoundSpaceRegion", 81)
    SetMemoryPoolSize("PowerupItem", 60)
    SetMemoryPoolSize("EntityMine", 40)
    SetMemoryPoolSize("Aimer", 200)
    SetMemoryPoolSize("Obstacle", 725)
    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:korriban\\korriban.lvl")
    SetDenseEnvironment("true")




   

--  Sound
     OpenAudioStream("sound\\tat.lvl",  "tatcw_music");
    OpenAudioStream("sound\\cw.lvl",  "cw_tac_vo");
    OpenAudioStream("sound\\cw.lvl",  "cw_vo");
       OpenAudioStream("sound\\gcw.lvl",  "gcw_tac_vo");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_vo");
    OpenAudioStream("sound\\bes.lvl",  "bes2");
   

    SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1);
    SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1);
    SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1);
    SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1);

    SetAmbientMusic(REP, 1.0, "rep_tat_amb_start",  0,1);
    SetAmbientMusic(REP, 0.99, "rep_tat_amb_middle", 1,1);
    SetAmbientMusic(REP, 0.1,"rep_tat_amb_end",    2,1);
    SetAmbientMusic(CIS, 1.0, "cis_tat_amb_start",  0,1);
    SetAmbientMusic(CIS, 0.99, "cis_tat_amb_middle", 1,1);
    SetAmbientMusic(CIS, 0.1,"cis_tat_amb_end",    2,1);
   
    SetVictoryMusic(REP, "rep_tat_amb_victory");
    SetDefeatMusic (REP, "rep_tat_amb_defeat");
    SetVictoryMusic(CIS, "cis_tat_amb_victory");
    SetDefeatMusic (CIS, "cis_tat_amb_defeat");

    SetOutOfBoundsVoiceOver(2, "repleaving");
    SetOutOfBoundsVoiceOver(1, "cisleaving");

    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, 0, "CIS_bonus_CIS_medical");
    SetPlanetaryBonusVoiceOver(CIS, REP, 0, "CIS_bonus_REP_medical");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 1, "");
    SetPlanetaryBonusVoiceOver(CIS, REP, 1, "");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 2, "CIS_bonus_CIS_sensors");
    SetPlanetaryBonusVoiceOver(CIS, REP, 2, "CIS_bonus_REP_sensors");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 3, "CIS_bonus_CIS_hero");
    SetPlanetaryBonusVoiceOver(CIS, REP, 3, "CIS_bonus_REP_hero");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 4, "CIS_bonus_CIS_reserves");
    SetPlanetaryBonusVoiceOver(CIS, REP, 4, "CIS_bonus_REP_reserves");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 5, "CIS_bonus_CIS_sabotage");--sabotage
    SetPlanetaryBonusVoiceOver(CIS, REP, 5, "CIS_bonus_REP_sabotage");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 6, "");
    SetPlanetaryBonusVoiceOver(CIS, REP, 6, "");
    SetPlanetaryBonusVoiceOver(CIS, CIS, 7, "CIS_bonus_CIS_training");--advanced training
    SetPlanetaryBonusVoiceOver(CIS, REP, 7, "CIS_bonus_REP_training");--advanced training

    SetPlanetaryBonusVoiceOver(REP, REP, 0, "REP_bonus_REP_medical");
    SetPlanetaryBonusVoiceOver(REP, CIS, 0, "REP_bonus_CIS_medical");
    SetPlanetaryBonusVoiceOver(REP, REP, 1, "");
    SetPlanetaryBonusVoiceOver(REP, CIS, 1, "");
    SetPlanetaryBonusVoiceOver(REP, REP, 2, "REP_bonus_REP_sensors");
    SetPlanetaryBonusVoiceOver(REP, CIS, 2, "REP_bonus_CIS_sensors");
    SetPlanetaryBonusVoiceOver(REP, REP, 3, "REP_bonus_REP_hero");
    SetPlanetaryBonusVoiceOver(REP, CIS, 3, "REP_bonus_CIS_hero");
    SetPlanetaryBonusVoiceOver(REP, REP, 4, "REP_bonus_REP_reserves");
    SetPlanetaryBonusVoiceOver(REP, CIS, 4, "REP_bonus_CIS_reserves");
    SetPlanetaryBonusVoiceOver(REP, REP, 5, "REP_bonus_REP_sabotage");--sabotage
    SetPlanetaryBonusVoiceOver(REP, CIS, 5, "REP_bonus_CIS_sabotage");
    SetPlanetaryBonusVoiceOver(REP, REP, 6, "");
    SetPlanetaryBonusVoiceOver(REP, CIS, 6, "");
    SetPlanetaryBonusVoiceOver(REP, REP, 7, "REP_bonus_REP_training");--advanced training
    SetPlanetaryBonusVoiceOver(REP, CIS, 7, "REP_bonus_CIS_training");--advanced training

--  Camera Stats
--Bespin 2
--Courtyard   
   AddCameraShot(0.613493, -0.007088, 0.789616, 0.009122, -203.110870, 2.347373, 227.966812);
--Carbon Chamber
AddCameraShot(0.731491, -0.195120, -0.631264, -0.168385, 93.467842, 21.624365, 146.393112);
--Wind Tunnel
      AddCameraShot(-0.175554, 0.013309, -0.981563, -0.074414, 31.551453, 14.149174, 253.044556);


end

mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh

are these files in addon?

ReadDataFile("dc:sound\\hot.lvl;hot1gcw")
        ReadDataFile("dc:sound\\tat.lvl;tat1cw")
    ReadDataFile("dc:sound\\kas.lvl;kas1cw")
    ReadDataFile("dc:sound\\nab.lvl;nab1gcw")
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

yes
sometimes it works and sometimes it crashed seemed to wrok when i deleted the bfront error log.
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh