I am working on my next mode and it should be a capture flag mode. But I have still a few problems and questions. My first problem is there are no enemies. There is only the player and the third and fourth team. But the Ai of the second team is not in game.
And my second question is it is possible to make a flag mode only for the player and not for the AI. They only should attack you and so on but the player has to take the flag and bring it to a location a few miles away.
Here is my flag lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
Conquest = ScriptCB_DoFile("ObjectiveOneFlagCTF")
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
ForceHumansOntoTeam1()
SoundEvent_SetupTeams( REP, 'rep', CIS, 'cis' )
ctf = ObjectiveOneFlagCTF:New{teamATT = 1, teamDEF = 2,
textATT = "game.modes.1flag", textDEF = "game.modes.1flag2",
captureLimit = 8, flag = "flag", flagIcon = "flag_icon",
flagIconScale = 3.0, homeRegion = "homeregion",
captureRegionATT = "team1_capture", captureRegionDEF = "team2_capture",
capRegionMarkerATT = "hud_objective_icon_circle", capRegionMarkerDEF = "hud_objective_icon_circle",
capRegionMarkerScaleATT = 3.0, capRegionMarkerScaleDEF = 3.0, multiplayerRules = true}
ctf:Start()
EnableSPHeroRules()
end
---------------------------------------------------------------------------
-- 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()
SetUberMode(1);
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(115)
SetMaxPlayerFlyHeight(115)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("dc:sound\\lc1.lvl;lc1cw")
ReadDataFile("dc:sound\\lc1.lvl;lc1gcw")
ReadDataFile("dc:sound\\lc1.lvl;lc1p")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\niko.lvl",
"niko_bellic",
"helicopter",
"veh_chopter",
"police_chopter")
ReadDataFile("dc:SIDE\\cop.lvl",
"cop_officer",
"cop_striker",
"car1",
"car2",
"car3",
"car4",
"taxi",
"police",
"cop_officer2" )
ReadDataFile("dc:SIDE\\pas.lvl",
"pas_1",
"pas_2",
"pas_3",
"pas_4",
"pas_5",
"pas_6",
"pas_7",
"bus" )
ReadDataFile("dc:SIDE\\gangsta.lvl",
"gangsta",
"boss",
"gang" )
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")
SetupTeams{
all = {
team = ALL,
units = 0,
reinforcements = -1,
soldier = { "niko_bellic",0, 0},
assault = { "",0,0},
engineer = { "",0,0},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},
},
imp = {
team = IMP,
units = 60,
reinforcements = 1000,
soldier = { "gangsta",15, 20},
assault = { "boss",15,20},
engineer = { "gang",15,20},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},
},
}
SetTeamName (3, "passants")
AddUnitClass (3, "pas_1",20,10)
AddUnitClass (3, "pas_2",20,10)
AddUnitClass (3, "pas_3",20,10)
AddUnitClass (3, "pas_4",20,10)
AddUnitClass (3, "pas_5",15,20)
AddUnitClass (3, "pas_6",15,20)
AddUnitClass (3, "pas_7",15,20)
SetUnitCount (3, 100)
AddAIGoal(3, "Deathmatch", 100)
SetTeamName (4, "cops")
AddUnitClass (4, "cop_officer",5,10)
AddUnitClass (4, "cop_striker",5,10)
AddUnitClass (4, "cop_officer2",5,10)
SetUnitCount (4, 30)
AddAIGoal(4, "Deathmatch", 100)
SetTeamAsFriend(ATT,3)
SetTeamAsFriend(3,ATT)
SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
SetTeamAsFriend(DEF,4)
SetTeamAsFriend(4,DEF)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,3)
-- Level Stats
ClearWalkers()
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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 16)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:LC1\\LC1.lvl", "LC1_1flag")
SetDenseEnvironment("false")
-- Sound Stats
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)
SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_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")
-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
end
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
Conquest = ScriptCB_DoFile("ObjectiveOneFlagCTF")
-- Empire Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2
function ScriptPostLoad()
ForceHumansOntoTeam1()
SoundEvent_SetupTeams( REP, 'rep', CIS, 'cis' )
ctf = ObjectiveOneFlagCTF:New{teamATT = 1, teamDEF = 2,
textATT = "game.modes.1flag", textDEF = "game.modes.1flag2",
captureLimit = 8, flag = "flag", flagIcon = "flag_icon",
flagIconScale = 3.0, homeRegion = "homeregion",
captureRegionATT = "team1_capture", captureRegionDEF = "team2_capture",
capRegionMarkerATT = "hud_objective_icon_circle", capRegionMarkerDEF = "hud_objective_icon_circle",
capRegionMarkerScaleATT = 3.0, capRegionMarkerScaleDEF = 3.0, multiplayerRules = true}
ctf:Start()
EnableSPHeroRules()
end
---------------------------------------------------------------------------
-- 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()
SetUberMode(1);
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(115)
SetMaxPlayerFlyHeight(115)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("dc:sound\\lc1.lvl;lc1cw")
ReadDataFile("dc:sound\\lc1.lvl;lc1gcw")
ReadDataFile("dc:sound\\lc1.lvl;lc1p")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\niko.lvl",
"niko_bellic",
"helicopter",
"veh_chopter",
"police_chopter")
ReadDataFile("dc:SIDE\\cop.lvl",
"cop_officer",
"cop_striker",
"car1",
"car2",
"car3",
"car4",
"taxi",
"police",
"cop_officer2" )
ReadDataFile("dc:SIDE\\pas.lvl",
"pas_1",
"pas_2",
"pas_3",
"pas_4",
"pas_5",
"pas_6",
"pas_7",
"bus" )
ReadDataFile("dc:SIDE\\gangsta.lvl",
"gangsta",
"boss",
"gang" )
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")
SetupTeams{
all = {
team = ALL,
units = 0,
reinforcements = -1,
soldier = { "niko_bellic",0, 0},
assault = { "",0,0},
engineer = { "",0,0},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},
},
imp = {
team = IMP,
units = 60,
reinforcements = 1000,
soldier = { "gangsta",15, 20},
assault = { "boss",15,20},
engineer = { "gang",15,20},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},
},
}
SetTeamName (3, "passants")
AddUnitClass (3, "pas_1",20,10)
AddUnitClass (3, "pas_2",20,10)
AddUnitClass (3, "pas_3",20,10)
AddUnitClass (3, "pas_4",20,10)
AddUnitClass (3, "pas_5",15,20)
AddUnitClass (3, "pas_6",15,20)
AddUnitClass (3, "pas_7",15,20)
SetUnitCount (3, 100)
AddAIGoal(3, "Deathmatch", 100)
SetTeamName (4, "cops")
AddUnitClass (4, "cop_officer",5,10)
AddUnitClass (4, "cop_striker",5,10)
AddUnitClass (4, "cop_officer2",5,10)
SetUnitCount (4, 30)
AddAIGoal(4, "Deathmatch", 100)
SetTeamAsFriend(ATT,3)
SetTeamAsFriend(3,ATT)
SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
SetTeamAsFriend(DEF,4)
SetTeamAsFriend(4,DEF)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,3)
-- Level Stats
ClearWalkers()
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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 16)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:LC1\\LC1.lvl", "LC1_1flag")
SetDenseEnvironment("false")
-- Sound Stats
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)
SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_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")
-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
end


