Comprehensive List of LUA codes/tips/tricks

Started by Led, June 08, 2012, 01:51:47 PM

Previous topic - Next topic
June 08, 2012, 01:51:47 PM Last Edit: June 15, 2012, 09:10:51 PM by Buckler
I have gone through all of the supplied stock LUA files.  My comments are in red.

These are LUA commands from non-historical maps.  Some commands are duplicated so that you can see the range of values that it may take.


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

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


    SetTeamAggressiveness(REP, 0.75)
    SetTeamAggressiveness(CIS, 1.0)
    SetTeamAggressiveness(ALL, 1.0)
    SetTeamAggressiveness(IMP, 1.0)
    SetTeamAggressiveness(IMP, 0.7)
    SetTeamAggressiveness(CIS, 0.9)
    SetTeamAggressiveness(REP, 0.9)

I think these are only valid in SP
--SetPlayerTeamDifficulty( 11 )
--SetEnemyTeamDifficulty( 11 )


details for using a downloadable content or addon map and side
    ReadDataFile("dc:TAT\\tat3.lvl")
    ReadDataFile("dc:SIDE\\gam.lvl",
        "gam_inf_gamorreanguard")
   
    ReadDataFile("sound\\bes.lvl;bes1gcw");


typical side loadouts, exact content may vary
    ReadDataFile("SIDE\\all.lvl",
        "all_fly_xwing",
        "all_fly_ywing",
        "all_inf_basicurban",
        "all_inf_lukeskywalker",
        "all_inf_smuggler");
    ReadDataFile("SIDE\\imp.lvl",
        "imp_fly_tiebomber",
        "imp_fly_tiefighter",
        "imp_inf_basic_tie",
        "imp_inf_dark_trooper",
        "imp_inf_darthvader");



--  Alliance Stats
      SetTeamName(ALL, "Alliance")
      SetTeamIcon(ALL, "all_icon")
      AddUnitClass(ALL, "all_inf_soldierurban",11)
      AddUnitClass(ALL, "all_inf_vanguard",5)
      AddUnitClass(ALL, "all_inf_pilot",5)
      AddUnitClass(ALL, "all_inf_marksman",4)
      AddUnitClass(ALL, "all_inf_smuggler",3)
    SetHeroClass(ALL, "all_inf_lukeskywalker")

--    Imperial Stats
      SetTeamName(IMP, "Empire")
      SetTeamIcon(IMP, "imp_icon")
      AddUnitClass(IMP, "imp_inf_storm_trooper",11)
      AddUnitClass(IMP, "imp_inf_shock_trooper",5)
      AddUnitClass(IMP, "imp_inf_pilottie",5)
      AddUnitClass(IMP, "imp_inf_scout_trooper",4)
      AddUnitClass(IMP, "imp_inf_dark_trooper",3)
    SetHeroClass(IMP, "imp_inf_darthvader")


--  Attacker Stats
    SetUnitCount(ATT, 28)
    SetReinforcementCount(ATT, 200)

these set the ticket bleed behavior
    AddBleedThreshold(ATT, 31, 0.0)
    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 2.25)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 28)
    SetReinforcementCount(DEF, 200)
    AddBleedThreshold(DEF, 31, 0.0)
    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 2.25)
    AddBleedThreshold(DEF, 1, 3.0)

    SetAttackingTeam(ATT);


a couple of example locals.  Note that Jedimales were going to be on geonosis, but were commented out
--  Local Stats
    SetTeamName (3, "locals")
    AddUnitClass (3, "ewk_inf_trooper", 4);
    AddUnitClass (3, "ewk_inf_repair", 6);
    SetUnitCount (3, 14)
    SetTeamAsFriend(3,ATT)
    SetTeamAsEnemy(3,DEF)

  SetTeamAsEnemy(DEF, 3)

--SetTeamName(4, "locals")
    --AddUnitClass(4, "rep_inf_jedimale",1)
    --AddUnitClass(4, "rep_inf_jedimaleb",1)
    --AddUnitClass(4, "rep_inf_jedimaley",1)
    --SetUnitCount(4, 3)
    --SetTeamAsFriend(4, ATT)

--  Local Stats
    SetTeamName(3, "Local")
    AddUnitClass(4, "imp_droid_probe", 1);
    SetUnitCount(4, 1)


you can make teams friends or enemies of other teams
    SetTeamAsEnemy(3,DEF)
    SetTeamAsFriend(3,ATT)


--  Level Stats
    ClearWalkers()

I wonder what the negative number means.
    SetMemoryPoolSize ("EntityWalker",0)
    SetMemoryPoolSize("EntityWalker", -2)

Walker type 0 appears to be droidekas.  The second number in the pair is the number available.  several of the comments appear to be incorrect about the number and type of unit

    AddWalkerType(0, 16) -- droidekas
    AddWalkerType(0, 8 ) -- 8 droidekas (special case: 0 leg pairs)
    AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs) 


Walker type 1 appears to be atst
    AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs) 
    AddWalkerType(1, 3) -- 6 atsts with 1 leg pairs each
    AddWalkerType(1, 0) --
    AddWalkerType(1, 10) -- 6 atsts with 1 leg pairs each


    AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
    AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each


    AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
    AddWalkerType(3, 4) -- 2 attes with 3 leg pairs each

    SetMemoryPoolSize ("CommandWalker",0)
    SetMemoryPoolSize("CommandWalker", 2)

    SetMemoryPoolSize ("EntityFlyer",0)
    SetMemoryPoolSize("EntityFlyer", 32)

some of these are a little unusual. If you know what they are for, please share.

    SetMemoryPoolSize("FlyGotoHelper", 64)

    SetMemoryPoolSize("EntityHover", 0)
    SetMemoryPoolSize ("EntityHover",10)

    SetMemoryPoolSize("EntityCarrier", 0)

     SetMemoryPoolSize("MountedTurret", 36)
--  SetMemoryPoolSize ("MountedTurret",20)

--  SetMemoryPoolSize("CommandBuildingArmed", 2)

--  SetMemoryPoolSize("EntityBuildingArmedDynamic", 16)
    SetMemoryPoolSize("EntityBuildingArmedDynamic", 0)

    SetMemoryPoolSize("PowerupItem", 40)
    SetMemoryPoolSize("EntityMine", 40)
    SetMemoryPoolSize("Aimer", 250)

    SetMemoryPoolSize("Obstacle", 550)
   SetMemoryPoolSize("Obstacle", 750)

    SetMemoryPoolSize ("Weapon", 260)


--  SetMemoryPoolSize ("EntityTauntaun",0)
--  SetMemoryPoolSize ("EntitySoldier",0)
    SetMemoryPoolSize ("EntityDroid",10)
    SetMemoryPoolSize ("EntityCarrier",0)

   SetMemoryPoolSize("OrdnanceTowCable", 8 ) -- need extra for wrapped/fallen cables

   SetMemoryPoolSize("EntityLight", 120)

  SetMemoryPoolSize("SoundSpaceRegion", 81 )

    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("bes\\bes1.lvl")

    SetDenseEnvironment("false")
    SetDenseEnvironment("true")


    AddDeathRegion("DeathRegion");
    AddDeathRegion("DeathRegion2");


   SetStayInTurrets(1)
   SetDefenderSnipeRange(170)


--  AI
    SetMinFlyHeight(60)
    SetMaxFlyHeight(140)
    SetAllowBlindJetJumps(0)



--  Movies
--  SetVictoryMovie(ALL, "all_end_victory");
--  SetDefeatMovie(ALL, "imp_end_victory");
--  SetVictoryMovie(IMP, "imp_end_victory");
--  SetDefeatMovie(IMP, "all_end_victory");



    SetMinFlyHeight(120)
    SetMaxFlyHeight(220)
    SetMinPlayerFlyHeight(0)
    SetMaxPlayerFlyHeight(220)

    SetAIVehicleNotifyRadius(80)
    SetAIVehicleNotifyRadius(64)
    SetStayInTurrets(1)

--  Birdies
    SetNumBirdTypes(1);
    SetBirdType(0,1.0,"bird");

--  Birdies
    SetNumBirdTypes(1);
    SetBirdType(0,1.0,"bird");
    SetBirdFlockMinHeight(-28.0);


--  Birdies
    --SetNumBirdTypes(1)
    --SetBirdType(0.0,10.0,"dragon")
    --SetBirdFlockMinHeight(90.0)

--  Birdies
    SetNumBirdTypes(2);
    SetBirdType(0,1.0,"bird");
    SetBirdType(1,1.5,"bird2");

--  Fishies
    SetNumFishTypes(1);
    SetFishType(0,0.8,"fish");


    --ActivateBonus(CIS, "SNEAK_ATTACK")
    --ActivateBonus(REP, "SNEAK_ATTACK")

    --SetSoundEffect("BirdScatter",         "birdsFlySeq1");


--  Sound
    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");

    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(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(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(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");
--  SetSoundEffect("BirdScatter",         "birdsFlySeq1");


    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

    --ScriptCB_SndBusFade("Root", 3.0, 1.0, 0.0);



--  Camera Stats
--Bes1 Platforms
--Platform Sky
AddCameraShot(0.793105, -0.062986, -0.603918, -0.047962, -170.583618, 118.981544, -150.443253);
--Control Room
AddCameraShot(0.189716, 0.000944, -0.981826, 0.004887, -27.594292, 100.583740, -176.478012);
--Extractor
AddCameraShot(0.492401, 0.010387, -0.870113, 0.018354, 19.590666, 100.493599, -47.846901);

end



Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

June 08, 2012, 01:51:58 PM #1 Last Edit: June 08, 2012, 08:20:17 PM by Buckler
These are LUA commands for historical maps.  Some commands are duplicated so that you can see the range of values that it may take.  This is currently a work in progress.


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

       SetHistorical()

   SetPlayerTeamDifficultyEasy (1)
     SetEnemyTeamDifficultyEasy (4)

     SetPlayerTeamDifficultyMedium (2)
     SetEnemyTeamDifficultyMedium (3)
        SetPlayerTeamDifficultyMedium (2)
        SetEnemyTeamDifficultyMedium (-4)     
        SetPlayerTeamDifficultyEasy (14)
        SetEnemyTeamDifficultyEasy (-3)

        SetPlayerTeamDifficultyMedium (-1)
        SetEnemyTeamDifficultyMedium (6)
--     SetPlayerTeamDifficultyHard (-10)
--     SetEnemyTeamDifficultyHard (12)

     SetPlayerTeamDifficultyHard (0)
        SetEnemyTeamDifficultyHard (3)
-----------------------------------------------
   SetPlayerTeamDifficultyEasy (2)
   SetEnemyTeamDifficultyEasy (6)

   SetPlayerTeamDifficultyMedium (2)
   SetEnemyTeamDifficultyMedium (2)

   SetPlayerTeamDifficultyHard (0)
   SetEnemyTeamDifficultyHard (1)
----------------------------------------------
  SetPlayerTeamDifficultyEasy (4)
  SetEnemyTeamDifficultyEasy (-3)

  SetPlayerTeamDifficultyMedium (2)
  SetEnemyTeamDifficultyMedium (-4)

--  SetPlayerTeamDifficultyHard (0)
--  SetEnemyTeamDifficultyHard (0)


     AddMissionObjective(IMP, "orange", "level.bes1.objectives.1");
     AddMissionObjective(ALL, "orange", "level.bes1.objectives.1");

    ReadDataFile("sound\\bes.lvl;bes1gcw");
    ReadDataFile("SIDE\\all.lvl",
        "all_fly_xwing",
        "all_fly_ywing",
        "all_inf_basicurban",
        "all_inf_lukeskywalker",
        "all_inf_smuggler");
    ReadDataFile("SIDE\\imp.lvl",
        "imp_fly_tiebomber",
        "imp_fly_tiefighter",
        "imp_inf_basic_tie",
        "imp_inf_dark_trooper",
        "imp_inf_darthvader");

--  Alliance Stats
      SetTeamName(ALL, "Alliance")
      SetTeamIcon(ALL, "all_icon")
      AddUnitClass(ALL, "all_inf_soldierurban",11)
      AddUnitClass(ALL, "all_inf_vanguard",5)
      AddUnitClass(ALL, "all_inf_pilot",5)
      AddUnitClass(ALL, "all_inf_marksman",4)
      AddUnitClass(ALL, "all_inf_smuggler",3)
      SetHeroClass(ALL, "all_inf_lukeskywalker")

--    Imperial Stats
      SetTeamName(IMP, "Empire")
      SetTeamIcon(IMP, "imp_icon")
      AddUnitClass(IMP, "imp_inf_storm_trooper",11)
      AddUnitClass(IMP, "imp_inf_shock_trooper",5)
      AddUnitClass(IMP, "imp_inf_pilottie",5)
      AddUnitClass(IMP, "imp_inf_scout_trooper",4)
      AddUnitClass(IMP, "imp_inf_dark_trooper",3)
    SetHeroClass(IMP, "imp_inf_darthvader")

--  Attacker Stats
    SetUnitCount(ATT, 28)
    SetReinforcementCount(ATT, 200)
    AddBleedThreshold(ATT, 31, 0.0)
    AddBleedThreshold(ATT, 21, 0.75)
    AddBleedThreshold(ATT, 11, 2.25)
    AddBleedThreshold(ATT, 1, 3.0)

--  Defender Stats
    SetUnitCount(DEF, 28)
    SetReinforcementCount(DEF, 250)
    AddBleedThreshold(DEF, 31, 0.0)
    AddBleedThreshold(DEF, 21, 0.75)
    AddBleedThreshold(DEF, 11, 2.25)
    AddBleedThreshold(DEF, 1, 3.0)

--  Level Stats
    ClearWalkers()

     SetMemoryPoolSize("EntityWalker", -2)
    AddWalkerType(0, 8 ) -- 8 droidekas (special case: 0 leg pairs)
    AddWalkerType(2, 2) -- 2 spider walkers with 2 leg pairs each
    AddWalkerType(3, 2) -- 2 attes with 3 leg pairs each
    SetMemoryPoolSize("CommandWalker", 2)

    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)
    AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs)

    SetMemoryPoolSize ("CommandWalker",0)

    SetMemoryPoolSize("EntityFlyer", 32)
    SetMemoryPoolSize ("EntityFlyer",0)


    SetMemoryPoolSize("EntityWalker", -2)

    AddWalkerType(0, 16 ) -- droidekas
    AddWalkerType(0, 0) -- 0 droidekas
    AddWalkerType(1, 10) -- 6 atsts with 1 leg pairs each
    AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
    SetMemoryPoolSize("CommandWalker", 2)
    SetMemoryPoolSize("EntityFlyer", 4)
    SetMemoryPoolSize("MountedTurret", 48)
    SetMemoryPoolSize("PowerupItem", 60)
    SetMemoryPoolSize("EntityMine", 40)
    SetMemoryPoolSize("OrdnanceTowCable", 8 ) -- need extra for wrapped/fallen cables
    SetMemoryPoolSize("EntityLight", 120)




    SetMemoryPoolSize("FlyGotoHelper", 64)
    SetMemoryPoolSize("EntityHover", 0)
    SetMemoryPoolSize ("EntityHover",10)


--  SetMemoryPoolSize ("EntityTauntaun",0)
--  SetMemoryPoolSize ("EntitySoldier",0)


    SetMemoryPoolSize ("EntityDroid",10)
    SetMemoryPoolSize("EntityCarrier", 0)


    SetMemoryPoolSize("MountedTurret", 36)
--  SetMemoryPoolSize ("MountedTurret",20)

--  SetMemoryPoolSize("CommandBuildingArmed", 2)
    SetMemoryPoolSize("EntityBuildingArmedDynamic", 0)
    SetMemoryPoolSize("PowerupItem", 40)
    SetMemoryPoolSize("EntityMine", 40)
    SetMemoryPoolSize("Aimer", 250)
    SetMemoryPoolSize("Obstacle", 550)

    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("bes\\bes1.lvl")
    SetDenseEnvironment("false")


--  Local Stats
--  SetTeamName (3, "locals")
--  AddUnitClass (3, "bes_inf_jawa", 14);
--  SetUnitCount (3, 14)
--  SetTeamAsFriend(3,ATT)
--  SetTeamAsFriend(3,DEF)

-  Local Stats
    SetTeamName (3, "locals")
    AddUnitClass (3, "ewk_inf_trooper", 4);
    AddUnitClass (3, "ewk_inf_repair", 6);
    SetUnitCount (3, 14)
    SetTeamAsFriend(3,ATT)
    SetTeamAsEnemy(3,DEF)

   --SetTeamName(4, "locals")
    --AddUnitClass(4, "rep_inf_jedimale",1)
    --AddUnitClass(4, "rep_inf_jedimaleb",1)
    --AddUnitClass(4, "rep_inf_jedimaley",1)
    --SetUnitCount(4, 3)
    --SetTeamAsFriend(4, ATT)

--  Local Stats
--  SetTeamName(3, "Local")
--  AddUnitClass(3, "snw_inf_wampa", 1);
--  SetUnitCount(3, 1)
--  SetTeamAsEnemy(3,ATT)
--  SetTeamAsEnemy(3,DEF)


    AddDeathRegion("DeathRegion");
    AddDeathRegion("DeathRegion2");



    SetMinFlyHeight(120)
    SetMaxFlyHeight(220)
    SetMinPlayerFlyHeight(0)
    SetMaxPlayerFlyHeight(220)


--  AI
    SetAIVehicleNotifyRadius(80)
    SetAIVehicleNotifyRadius(64)
    SetStayInTurrets(1)

    SetDefenderSnipeRange(170)

--  Birdies
    --SetNumBirdTypes(1)
    --SetBirdType(0.0,10.0,"dragon")
    --SetBirdFlockMinHeight(90.0)

--  Fishies
    SetNumFishTypes(1);
    SetFishType(0,0.8,"fish");

--  AI
    SetMinFlyHeight(60)
    SetMaxFlyHeight(140)
    SetAllowBlindJetJumps(0)

  ActivateBonus(IMP, "HERO")

   ActivateBonus(CIS, "HERO")


    --SetSoundEffect("BirdScatter",         "birdsFlySeq1");
--  Movies
--  SetVictoryMovie(ALL, "all_end_victory");
--  SetDefeatMovie(ALL, "imp_end_victory");
--  SetVictoryMovie(IMP, "imp_end_victory");
--  SetDefeatMovie(IMP, "all_end_victory");



--  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");

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

    SetAttackingTeam(ATT);

--  Camera Stats
--Bes1 Platforms
--Platform Sky
AddCameraShot(0.793105, -0.062986, -0.603918, -0.047962, -170.583618, 118.981544, -150.443253);
--Control Room
AddCameraShot(0.189716, 0.000944, -0.981826, 0.004887, -27.594292, 100.583740, -176.478012);
--Extractor
AddCameraShot(0.492401, 0.010387, -0.870113, 0.018354, 19.590666, 100.493599, -47.846901);

end

Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet


June 08, 2012, 01:52:14 PM #3 Last Edit: June 08, 2012, 03:06:36 PM by Buckler
LUA scripting language info:

random, etc.

http://www.swbfgamers.com/index.php?topic=4503.0
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

June 08, 2012, 01:52:24 PM #4 Last Edit: December 19, 2012, 07:31:08 PM by Buckler
additional LUA codes


--ActivateBonus(ALL, "HERO")
--ActivateBonus(ALL, "MEDICAL_SUPPLIES")
--ActivateBonus(ALL, "SURPLUS_SUPPLIES") crashes MP game if only server has command
--ActivateBonus(ALL, "SENSOR_BOOST") no known affect in MP game if only server has command
--ActivateBonus(ALL, "RESERVES")
--ActivateBonus(ALL, "SABOTAGE")
--ActivateBonus(ALL, "SNEAK_ATTACK")


Fred's link:
http://www.secretsociety.com/forum/display_message.asp?mid=592

Here is some information on bonuses:
http://strategywiki.org/wiki/Star_Wars:_Battlefront/Galactic_Conquest

Quote
Galactic Conquest is a special mode that lets you choose a faction and lead it to victory by conquering all of the planets on a map. Each planet, when conquered, has a special bonus that can help you. You can only use one bonus per battle. Every four victories, you are also allowed to use a bonus that either automatically gains you the planet or destroys the planet. When you conquer all the planets on the map, you must defeat the enemy in their base planet in order to have conquered the galaxy.
[edit] Planets
Planet    Bonus    Description
Bespin    Sabotage    This bonus makes your enemy's vehicles spawn heavily damaged. This is a good bonus to pursue early, and is best used on maps heavy with vehicles, such as Hoth or Kashyyk.
Naboo    Bacta Tanks    This bonus allows troops to regenerate their health gradually. This is the most useful bonus, but winning the battles here will be hard without Bespin's Sabotage.
Rhen Var    Orbital Sensors    This bonus will disable your enemy's minimap, making it hard for your opponent to play out some killer tactics. This bonus isn't really great, so just save it for last.
Kashyyk    Reinforcements    This bonus gives you an extra 50 or so troops when your troops have fallen low. This is a pretty useful bonus that can help you gain an edge during a battle.
Tatooine    Jedi Hero    This bonus allows your faction's Jedi hero to come into play. Since your Jedi hero isn't the smartest troop, you are better off going for Sabotage or Bacta Tanks.
Yavin 4    Elite Training    This bonus gives your units better marksmanship and accuracy. Whether it actually does is a matter of contention. This is good early on but should be replaced by Sabotage or Bacta Tanks later on.
Geonosis    Blockade    CIS only. This bonus will destroy any planet.
Kamino    Insurrection    Republic only. This is a special bonus that can only be activated every four victories. It will automatically claim a planet as your own.
Endor    Death Star    Empire only. This bonus will destroy any planet.
Hoth    Overthrow    Rebellion only. This bonus will automatically claim a planet as your own.
[edit] Conquests

To start a Galactic Conquest game, you first choose which conquest you are playing. The conquest you choose will dictate your faction and the planets you start with.
Game    Faction    Starting planets
Birth of the Rebellion    Rebellion    Hoth, Yavin 4
Dark Side Rising    Empire    Endor, Bespin
Attack of the Clones    Republic    Kamino, Kashyyk
Revenge of the Sith    CIS    Geonosis, Rhen Var
The Galactic Civil War    Rebellion or Empire    Rebellion: Hoth, Rhen Var, Yavin 4
Empire: Endor, Kashyyk, Naboo
A Galaxy Divided    Rebellion or Empire    Rebellion: Hoth, Bespin, Yavin 4
Empire: Endor, Kashyyyk, and Tatooine
The Clone Wars    Republic or CIS    Republic: Kamino, Tatooine, and Yavin 4
CIS: Bespin, Geonosis, and Rhen Var
Balance of the Force    Republic or CIS    Republic: Bespin, Kamino, and Kashyyyk
CIS: Geonosis, Naboo, and Rhen Var
[edit] Tips

    The order of importance for bonuses from highest to lowest (excluding base bonuses) should be as follows: Bacta Tanks (Naboo), Sabotage (Bespin), Reinforcements (Kashyyk), Elite Training (Yavin 4), Jedi Hero (Tatooine), and Orbital Sensors (Rhen Var).
    Use Sabotage in maps with many vehicles. This includes the maps in Naboo, Kashyyk, Geonosis, Hoth, Endor, Rhen Var: Harbor, and Tatooine: Dune Sea.
    When in doubt, Bacta Tanks, Elite Training, or Reinforcements are some of the best bonuses in the absence of Sabotage. They are also particularly effective in maps with minimal vehicles.
    When using a base bonus that destroys a planet, aim for a planet with a not-as-effective bonus. Rhen Var and Tatooine are prime targets, or Yavin 4 if it is difficult to capture.
    When using a base bonus that automatically gains a planet, aim for a planet with a useful bonus. Naboo, Bespin, and Kashyyk are great targets.
    Base bonuses cannot be used on your enemy's base.














[22:28] {PLA}Sleepkiller: Here is one that cna be needed if you have lots of foliage in your world
[22:28] {PLA}Sleepkiller: SetMemoryPoolSize("TreeGridStack", 100)



Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

To make a no-vehicle map:

zero the memory pools (don't delete the lines)
(an alternative is to hex edit the lvl files)

credits to phobos:




[22:45] [FC]Ldr.Rage:
--  Level Stats
    ClearWalkers()
    AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
    AddWalkerType(1, 0) -- 8 droidekas (special case: 0 leg pairs)
    AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
    AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
--  SetMemoryPoolSize ("MountedTurret",20)
--  SetMemoryPoolSize ("EntityTauntaun",0)
--  SetMemoryPoolSize ("EntitySoldier",0)
    SetMemoryPoolSize ("EntityHover",0)
    SetMemoryPoolSize ("EntityFlyer",0)
    SetMemoryPoolSize ("EntityDroid",10)
    SetMemoryPoolSize ("EntityCarrier",0)
   SetMemoryPoolSize("PowerupItem", 80)
    SetMemoryPoolSize("EntityMine", 80)
    SetMemoryPoolSize("Obstacle", 750)
    SetMemoryPoolSize ("Weapon", 260)





Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet