SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: wsa30h on July 13, 2019, 02:29:20 AM

Title: why cant local all be changed to rep ?
Post by: wsa30h on July 13, 2019, 02:29:20 AM
why cant parts of the script be changed for example this part without crashing the game? local ALL = 2  local IMP = 1 to local Rep = 2
and this part  AddUnitClass(ALL, "rep_inf_clone_trooper",27) to  this  AddUnitClass(REP, "rep_inf_clone_trooper",27)
    AddUnitClass(ALL, "rep_inf_arc_trooper",5)
    AddUnitClass(ALL, "rep_inf_clone_pilot",6)
    AddUnitClass(ALL, "rep_inf_clone_sharpshooter",6)
    AddUnitClass(ALL, "rep_inf_jet_trooper",3)
    SetHeroClass(ALL, "rep_inf_macewindu")
    AddUnitClass(ALL, "rep_inf_arc_trooper",5)
   

AddUnitClass(REP, "rep_inf_clone_pilot",6)
    AddUnitClass(REP, "rep_inf_clone_sharpshooter",6)
    AddUnitClass(REP, "rep_inf_jet_trooper",3)
    SetHeroClass(REP, "rep_inf_macewindu")
Title: Re: why cant local all be changed to rep ?
Post by: Led on July 13, 2019, 03:17:46 AM
Those lines by themselves don't tell anyone enough information to help you.

Post your lua using the "code" tags.

Most likely, you have not properly read in the data files, but know way anyone can tell.
Title: Re: why cant local all be changed to rep ?
Post by: wsa30h on July 13, 2019, 03:49:10 AM
ok so this is my whole 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 ALL = 2
    local IMP = 1
--  These variables do not change
    local ATT = 1
    local DEF = 2

    AddMissionObjective(IMP, "red", "level Korriban capture and hold command posts");
    AddMissionObjective(IMP, "orange", "level Korriban watch for rebels");
    AddMissionObjective(ALL, "red", "level Korriban watch for rebels");
    AddMissionObjective(ALL, "orange", "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("dc:sound\\012lvl;012gcw")
    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");

    SetAttackingTeam(ATT);

--      Alliance Stats
    SetTeamName(ALL, "republic")
    SetTeamIcon(ALL, "rep_icon")
   AddUnitClass(ALL, "rep_inf_clone_trooper",27)
    AddUnitClass(ALL, "rep_inf_arc_trooper",5)
    AddUnitClass(ALL, "rep_inf_clone_pilot",6)
    AddUnitClass(ALL, "rep_inf_clone_sharpshooter",6)
    AddUnitClass(ALL, "rep_inf_jet_trooper",3)
    SetHeroClass(ALL, "rep_inf_macewindu")


--      Imperial Stats
    SetTeamName(IMP, "Empire")
    SetTeamIcon(IMP, "imp_icon")
    AddUnitClass(IMP, "imp_inf_storm_trooper",27)
    AddUnitClass(IMP, "imp_inf_shock_trooper",5)
    AddUnitClass(IMP, "imp_inf_pilottie",6)
    AddUnitClass(IMP, "imp_inf_scout_trooper",6)
    AddUnitClass(IMP, "imp_inf_dark_trooper",3)
    SetHeroClass(IMP, "imp_inf_darthvader")
   
--  Attacker Stats
    SetUnitCount(ATT, 50)
    SetReinforcementCount(ATT, 800)


--  Defender Stats
    SetUnitCount(DEF, 52)
    SetReinforcementCount(DEF, 840)


--  Local Stats
    SetTeamName(3, "locals")
    AddUnitClass(3, "all_inf_soldierdesert", 15);
    AddUnitClass(3, "all_inf_vanguard", 5);
    AddUnitClass(3, "all_inf_pilot", 5);
    AddUnitClass(3, "all_inf_marksman", 5);
    AddUnitClass(3, "all_inf_smuggler", 5);
    AddUnitClass(3, "cis_inf_battledroid", 15);
    AddUnitClass(3, "cis_inf_assault", 5);
    AddUnitClass(3, "cis_inf_assassindroid", 5);
    AddUnitClass(3, "cis_inf_droideka", 3);
    SetUnitCount(3, 50)
    SetTeamAsEnemy(3, ATT)
    SetTeamAsEnemy(3, DEF)
    SetTeamAsEnemy(ATT, 3)
    SetTeamAsEnemy(DEF, 3)

--  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", 33)
    --SetMemoryPoolSize("EntityFlyer", 5)
  SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
--  SetMemoryPoolSize("EntityTauntaun", 0)
--  SetMemoryPoolSize("MountedTurret", 22)
    SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize ("EntitySoldier",500)
--    SetMemoryPoolSize("SoundSpaceRegion", 85)
    SetMemoryPoolSize("EntityMine", 40)
    SetMemoryPoolSize("Aimer", 900)
--    SetMemoryPoolSize("Obstacle", 725)
    --SetMemoryPoolSize("EntityLight", 150)
    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:korriban\\korriban.lvl")
    SetDenseEnvironment("false")
    --AddDeathRegion("Sarlac01")
   --  SetMaxFlyHeight(90)
  --  SetMaxPlayerFlyHeight(90)


--  Sound Stats
          OpenAudioStream("sound\\bes.lvl",  "bes2gcw_music");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_vo");
    OpenAudioStream("sound\\gcw.lvl",  "gcw_tac_vo");
    OpenAudioStream("sound\\cw.lvl",  "cw_vo");
    OpenAudioStream("sound\\cw.lvl",  "cw_tac_vo");
    OpenAudioStream("sound\\bes.lvl",  "bes2");
    OpenAudioStream("sound\\bes.lvl",  "bes2");
   
    SetBleedingVoiceOver(Rep, Rep, "rep_off_com_report_us_overwhelmed", 1);
    SetBleedingVoiceOver(Rep, IMP, "rep_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(IMP, Rep, "imp_off_com_report_enemy_losing",   1);
    SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1);

    SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(REP, IMP, "rep_off_victory_im", .1, 1);
    SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1);
    SetLowReinforcementsVoiceOver(IMP, REP, "imp_off_victory_im", .1, 1);

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

SetAmbientMusic(All, 1.0, "all_nab4_amb_start",  0,1);
    SetAmbientMusic(ALL, 0.99, "all_nab4_amb_middle", 1,1);
    SetAmbientMusic(ALL, 0.1,"all_nab4_amb_end",    2,1);
    SetAmbientMusic(IMP, 1.0, "imp_nab4_amb_start",  0,1);
    SetAmbientMusic(IMP, 0.99, "imp_nab4_amb_middle", 1,1);
    SetAmbientMusic(IMP, 0.1,"imp_nab4_amb_end",    2,1);


SetVictoryMusic(REP, "rep_bes_amb_victory");
    SetDefeatMusic (REP, "rep_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(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


--  Camera Stats
--Tat 3 - Jabbas' Palace
    AddCameraShot(10.793105, -0.062986, -0.603918, -0.047962, -170.583618, 118.981544, -150.443253);


end



Title: Re: why cant local all be changed to rep ?
Post by: wsa30h on July 13, 2019, 02:45:08 PM
never mind i fixed it.
EhPortal 1.34 © 2025, WebDev