Page 1 of 1

Make a new Side?

Posted: Fri Aug 13, 2010 4:08 pm
by deagle
Hi,

what's the easiest way to make a new side for a map? For example, my side is called JediMasters, how can I get them work, that is loaded in my map? I know, it is something in the mission scripts, but don't know exactly how.

If I make a new Side, all folders are blank. Is there a way to use some Assets like the luke skywalker or mace windu? Or better, how can I currectly copy and paste assests that they will be munged?

Thanks in advance!

Re: Make a new Side?

Posted: Sat Aug 14, 2010 11:59 am
by Jendo7
I think you need to read this topic.

http://www.gametoast.com/forums/viewtop ... 27&t=12729

It's for BF2 but it's basically the same for BF1, or look at the sides folder in DataMod1 that has GAM as an example, and the scripts here: DataMod1/Common/Scripts/MOD/mod1a.lua for loading a side in your map.

This tutorial will help you further:

http://starwarsbattlefront.filefront.co ... rial;46828

Re: Make a new Side?

Posted: Sun Aug 15, 2010 5:32 am
by deagle
Hey, thanks for your reply!

I've followed the tutorial and made my side, but the map always crashs during loading. I was a bit confused about edit the lua's, and thats it where the errors come from:

Code: Select all

Message Severity: 3
.\source\LuaCallbacks_Mission.cpp(195)
Lua ReadDataFile: Could not open SIDE\forcejedi.lvl

Message Severity: 3
.\source\LuaScript.cpp(1951)
error: bad argument sent to Lua API function
stack traceback:
   1:  function `AddUnitClass' [C]
   2:  function `ScriptInit' [(none)]

Message Severity: 3
.\source\Team.cpp(166)
AddUnitClass lua script command specifies too many units for team !
And here is my lua gcw script:

Code: Select all

-- Start sidelvls
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler");
ReadDataFile("SIDE\\forcejedi.lvl");
--end sidelvls
--start loadouts
SetTeamName(ALL, "Alliance")
SetTeamIcon(ALL, "all_icon")
AddUnitClass(ALL, "all_inf_soldierdesert",10)
AddUnitClass(ALL, "all_inf_vanguard",1)
AddUnitClass(ALL, "all_inf_pilot",2)
AddUnitClass(ALL, "all_inf_marksman",2)
AddUnitClass(ALL, "all_inf_smuggler",1)
SetHeroClass(ALL, "all_inf_lukeskywalker")

SetTeamName(IMP, "Empire")
SetTeamIcon(IMP, "imp_icon")
AddUnitClass(ForceJedi, "rep_hero_anakin",1)
AddUnitClass(ForceJedi, "rep_hero_kiyadimundi",2)
AddUnitClass(ForceJedi, "rep_hero_macewindu",2)
AddUnitClass(ForceJedi, "rep_hero_obiwan",1)
AddUnitClass(ForceJedi, "rep_hero_yoda",1)
SetHeroClass(ForceJedi, "rep_hero_obiwan")
I think there are many things wrong, but I don't know how to fix them :|

Does somebody has an idea?

Re: Make a new Side?

Posted: Sun Aug 15, 2010 7:22 am
by Jendo7
For one, you need to put the prefix "dc" before ReadDataFile("SIDE\\forcejedi.lvl"); so it looks like this:

ReadDataFile("dc:SIDE\\forcejedi.lvl",
"rep_hero_anakin",
"rep_hero_kiyadimundi",
"rep_hero_macewindu",
"rep_hero_obiwan",
"rep_hero_yoda",
"rep_hero_obiwan");

Plus you have specified two many units for your custom team. It should look like this:

SetTeamName(IMP, "Empire")
SetTeamIcon(IMP, "imp_icon")
AddUnitClass(IMP, "rep_hero_anakin",1)
AddUnitClass(IMP, "rep_hero_kiyadimundi",2)
AddUnitClass(IMP, "rep_hero_macewindu",2)
AddUnitClass(IMP, "rep_hero_obiwan",1)
AddUnitClass(IMP, "rep_hero_yoda",1)
SetHeroClass(IMP, "rep_hero_obiwan")

... and there is no scriptInit function

All in all, it should look something like this:
Hidden/Spoiler:
[code]---------------------------------------------------------------------------
-- 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, "orange", "level.rhenvar1.objectives.1");
AddMissionObjective(IMP, "red", "level.rhenvar1.objectives.2");
-- AddMissionObjective(IMP, "red", "level.rhenvar1.objectives.3");
AddMissionObjective(ALL, "orange", "level.rhenvar1.objectives.1");
-- AddMissionObjective(ALL, "red", "level.rhenvar1.objectives.2");
AddMissionObjective(ALL, "red", "level.rhenvar1.objectives.3");

ReadDataFile("sound\\rhn.lvl;rhn1gcw");
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler");
ReadDataFile("dc:SIDE\\forcejedi.lvl",
"rep_hero_anakin",
"rep_hero_kiyadimundi",
"rep_hero_macewindu",
"rep_hero_obiwan",
"rep_hero_yoda",
"rep_hero_obiwan");

-- Alliance Stats
SetTeamName(ALL, "Alliance")
SetTeamIcon(ALL, "all_icon")
AddUnitClass(ALL, "all_inf_soldierdesert",10)
AddUnitClass(ALL, "all_inf_vanguard",1)
AddUnitClass(ALL, "all_inf_pilot",2)
AddUnitClass(ALL, "all_inf_marksman",2)
AddUnitClass(ALL, "all_inf_smuggler",1)
SetHeroClass(ALL, "all_inf_lukeskywalker")

-- Imperial Stats
SetTeamName(IMP, "Empire");
SetTeamIcon(IMP, "imp_icon");
AddUnitClass(IMP, "rep_hero_anakin",1)
AddUnitClass(IMP, "rep_hero_kiyadimundi",2)
AddUnitClass(IMP, "rep_hero_macewindu",2)
AddUnitClass(IMP, "rep_hero_obiwan",1)
AddUnitClass(IMP, "rep_hero_yoda",1)
SetHeroClass(IMP, "rep_hero_obiwan")

-- Attacker Stats
SetUnitCount(ATT, 25)
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, 25)
SetReinforcementCount(DEF, 200)
AddBleedThreshold(DEF, 31, 0.0)
AddBleedThreshold(DEF, 21, 0.75)
AddBleedThreshold(DEF, 11, 2.25)
AddBleedThreshold(DEF, 1, 3.0)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 16) -- 16 droidekas
SetMemoryPoolSize("MountedTurret", 24)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("RHN\\RHN1.lvl")
SetDenseEnvironment("true")
AddDeathRegion("FalltoDeath");
SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight(30)

-- Sound Stats
OpenAudioStream("sound\\rhn.lvl", "rhngcw_music");
OpenAudioStream("sound\\gcw.lvl", "gcw_vo");
OpenAudioStream("sound\\gcw.lvl", "gcw_tac_vo");
OpenAudioStream("sound\\rhn.lvl", "rhn");
OpenAudioStream("sound\\rhn.lvl", "rhn");

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(2, "Allleaving");
SetOutOfBoundsVoiceOver(1, "Impleaving");

SetAmbientMusic(ALL, 1.0, "all_RHN_amb_start", 0,1);
SetAmbientMusic(ALL, 0.99, "all_RHN_amb_middle", 1,1);
SetAmbientMusic(ALL, 0.1,"all_RHN_amb_end", 2,1);
SetAmbientMusic(IMP, 1.0, "imp_RHN_amb_start", 0,1);
SetAmbientMusic(IMP, 0.99, "imp_RHN_amb_middle", 1,1);
SetAmbientMusic(IMP, 0.1,"imp_RHN_amb_end", 2,1);
SetVictoryMusic(ALL, "all_rhn_amb_victory");
SetDefeatMusic (ALL, "all_rhn_amb_defeat");
SetVictoryMusic(IMP, "imp_rhn_amb_victory");
SetDefeatMusic (IMP, "imp_rhn_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
--Rhen Var 1 Harbor
--Ice Cave
AddCameraShot(0.237977, 0.038345, -0.958155, 0.154386, -231.233429, 9.040294, 33.124115);
--Building
AddCameraShot(0.931093, 0.004173, -0.364754, 0.001635, -111.028969, 7.049152, 58.597565);
--Overhead
AddCameraShot(0.912982, -0.196456, -0.349585, -0.075224, -152.503891, 46.803139, 144.810410);


End


[/code]


You really should take time to read the documentation in the BFbuilder, and the tuts that I pointed you too. You will understand everything more clearly if you take your time , and do one section at a time.

Anyway, I hope that helps

Another problem why your map crashes is probably because BF1 can't take all those jedi animations which are mainly for BF2.
You might be better off buying BF2 and modding that instead.

Re: Make a new Side?

Posted: Sun Aug 15, 2010 1:09 pm
by deagle
Thanks, the side works now!

All hero's are working for swbf1 aswell.

I already have swbf2, but I like number one more ;)

Re: Make a new Side?

Posted: Sun Aug 15, 2010 2:43 pm
by Jendo7
True, you can't beat it :)