SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: VulkanMU on April 20, 2024, 11:15:49 AM

Title: Mission.lvl side import help
Post by: VulkanMU on April 20, 2024, 11:15:49 AM
Not sure exactly what I am doing wrong here. After inspecting geo3's Mission.lvl file from Execution at Geonosis mod in a hex editor, I made a similar looking command in my mods Mission.lvl. However it crashes a soon as I try to play the map. The map works if I remove the dc: rep side call. Any ideas what I am doing wrong? Obviously I am not doing something the engine is expecting.

--start header
function ScriptInit()
local CIS = 2
local REP = 1
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(REP,"red", "level.GeoM1.objectives.1");
AddMissionObjective(REP,"orange", "level.GeoM1.objectives.2");
AddMissionObjective(REP,"orange", "level.GeoM1.objectives.3");
AddMissionObjective(CIS,"red", "level.GeoM1.objectives.1");
AddMissionObjective(CIS,"orange", "level.GeoM1.objectives.2");
AddMissionObjective(CIS,"orange","level.GeoM1.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("sound\\geo.lvl;geo1cw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
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_jet_trooper",
"rep_inf_macewindu",
"rep_walk_atte")
ReadDataFile("dc:..\\..\\..\\geo2\\Data\\_LVL_PC\\Side\\rep.lvl",
"rep_inf_jedimale",                                                             
"rep_inf_jedimaleb",                                                           
"rep_inf_jedimaley")
--end sidelvls
--start loadouts
SetTeamName(CIS, "CIS")
SetTeamIcon(CIS, "cis_icon")
AddUnitClass(CIS, "cis_inf_battledroid",10)
AddUnitClass(CIS, "cis_inf_assault",1)
AddUnitClass(CIS, "cis_inf_pilotdroid",2)
AddUnitClass(CIS, "cis_inf_assassindroid",2)
AddUnitClass(CIS, "cis_inf_droideka",1)
SetHeroClass(CIS, "cis_inf_countdooku")
SetTeamName(REP, "Republic")
SetTeamIcon(REP, "rep_icon")
AddUnitClass(REP, "rep_inf_clone_trooper",10)
AddUnitClass(REP, "rep_inf_arc_trooper",1)
AddUnitClass(REP, "rep_inf_clone_pilot",2)
AddUnitClass(REP, "rep_inf_clone_sharpshooter",2)
AddUnitClass(REP, "rep_inf_jet_trooper",1)
SetHeroClass(REP, "rep_inf_macewindu")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);

SetTeamName(4, "locals")
    AddUnitClass(4, "rep_inf_jedimale",2)
    AddUnitClass(4, "rep_inf_jedimaleb",2)
    AddUnitClass(4, "rep_inf_jedimaley",2)
    SetUnitCount(4, 6)
    SetTeamAsFriend(4, ATT)
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 4)-- special -> droidekas
AddWalkerType(1, 4)-- 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)
--end memorypools
--start worldlvl
ReadDataFile("dc:GeoM1\\GeoM1.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("true")
--end denseenvironment
--start birdsandfish
--end birdsandfish
--start deathregions
--end deathregions

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
OpenAudioStream("sound\\cw.lvl","cw_tac_vo");
OpenAudioStream("sound\\tat.lvl","tat1_emt");
SetBleedingVoiceOver(CIS,CIS,"cis_off_com_report_us_overwhelmed",1);
SetBleedingVoiceOver(CIS,REP,"cis_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,CIS,"rep_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,REP,"rep_off_com_report_us_overwhelmed",1);
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1,1);
SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1,1);
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");
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);
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);
SetVictoryMusic(CIS,"cis_tat_amb_victory");
SetDefeatMusic (CIS,"cis_tat_amb_defeat");
SetVictoryMusic(REP,"rep_tat_amb_victory");
SetDefeatMusic (REP,"rep_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(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
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
--end soundconfig

--start activebonus
--end activebonus

--start camerashots
AddCameraShot(-0.404895, 0.000992, -0.914360, -0.002240, -85.539894, 20.536297, 141.699493);
AddCameraShot(0.040922, 0.004049, -0.994299, 0.098381, -139.729523, 17.546598, -34.360893);
AddCameraShot(-0.312360, 0.016223, -0.948547, -0.049263, -217.381485, 20.150953, 54.514324);
--end camerashots

--start footer
end
--end footer



Title: Re: Mission.lvl side import help
Post by: Led on April 20, 2024, 01:52:02 PM
That is often a mis-named or mis-located file name for your map or your side.  You should check them.  You are reading in two rep.lvl files.
Title: Re: Mission.lvl side import help
Post by: VulkanMU on April 20, 2024, 02:20:41 PM
Can you read from two separate side files that have the same name? Or is that an engine limit?
Title: Re: Mission.lvl side import help
Post by: Led on April 21, 2024, 08:41:45 AM
Hard to know if it is a limit, but it is easy to find out with a stock map or just try stock sides with the map.

Title: Re: Mission.lvl side import help
Post by: VulkanMU on April 21, 2024, 08:03:49 PM
I figured out what I needed. There are conflicts if you try to read any items that have the same side name and same side prefix. Example rep_inf_macewindu. Calling this class twice from two separate rep.lvl files will cause the second one to have certain graphics overwritten by the first or just not work at all. I've learn quite a bit about side.lvl and mission.lvl files over the past week. I'm thinking of putting together a tutorial on how to create a new side and add it into a shipped map as a 4th local side.
Title: Re: Mission.lvl side import help
Post by: Led on April 22, 2024, 01:42:29 AM
Thanks for the follow-up!
EhPortal 1.34 © 2024, WebDev