A.I.-controlled spawned units

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

A.I.-controlled spawned units

Post by Marth8880 »

I am making the Combat Drone for my Mass Effect mod. It is basically like an A.I.-controlled remote droid which you spawn that follows you around and attacks enemies for a length of time, and then dies. I know this is possible because Sky_216 had something similar in Dark Space. It's called "Swarm Squad", which spawns several remote droids that go around and attack your enemies. I tried doing this, but all I get is a remote droid that is spawned and just sits there.


cor1n_con.lua
Hidden/Spoiler:
[code]SupportsCustomEraTeams = true
RandomSide = math.random(1,2)

if RandomSide == 1 then
CustomEraTeam1 = "Geth"
CustomEraTeam2 = "SSV Normandy"

elseif RandomSide == 2 then
CustomEraTeam1 = "Collectors"
CustomEraTeam2 = "SSV Normandy"

end
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- CIS Attacking (attacker is always #1)
REP = 2;
CIS = 1;
-- These variables do not change
ATT = 1;
DEF = 2;

DroneTeam1 = 3
CD1 = DroneTeam1

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

AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")




SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)


SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)



EnableSPHeroRules()

DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

AddAIGoal(3, "Defend", 100, 0)


-- Setup the team that will spawn in ScriptInit(), include the SetTeamAsFriend() stuff
-- Add this code into ScriptPostLoad() once for each team that can spawn stuff (changing a couple of variables each time)
-- Add an AIGoal for the spawned team somewhere in ScriptPostLoad() so the spawned character will actually do something

TroopSpawnerWeapon = "weap_inf_combatdrone_dispenser"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local DroneTeam1 = 3 -- Team the new spawned character is in (change this)
local teamSize = GetTeamSize(DroneTeam1)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(DroneTeam1, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
REP -- User team (change this)
)


end

function ScriptInit()
-- Designers, these two lines *MUST* be first.

SetPS2ModelMemory(4056000)

SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)



SetMemoryPoolSize("Music", 33)
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\common.lvl")
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\ingame.lvl")
ReadDataFile("ingame.lvl")

ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\core.lvl")


if RandomSide == 1 then
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\ME5.lvl;ME5n")
--ReadDataFile("dc:sound\\ME5.lvl;ME5cw")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\SIDE\\ssv.lvl",
"ssv_inf_soldier",
"ssv_inf_infiltrator",
"ssv_inf_adept",
"ssv_inf_engineer",
"ssv_inf_sentinel",
"ssv_inf_vanguard",
"weap_tech_combatdrone")
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\SIDE\\gth.lvl",
"gth_inf_trooper",
"gth_inf_rocketeer",
"gth_inf_sniper",
"gth_inf_shock",
"gth_inf_destroyer",
"gth_inf_prime")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")


SetupTeams{
ssv = {
team = REP,
units = 22,
reinforcements = 150,
soldier = { "ssv_inf_soldier",9, 25},
sniper = { "ssv_inf_infiltrator",1, 4},
adept = { "ssv_inf_adept",1, 4},
engineer = { "ssv_inf_engineer",1, 4},
sentinel = { "ssv_inf_sentinel",1, 4},
vanguard = { "ssv_inf_vanguard",1, 4},

},
gth = {
team = CIS,
units = 26,
reinforcements = 150,
soldier = { "gth_inf_trooper",9, 25},
assault = { "gth_inf_rocketeer",1, 4},
sniper = { "gth_inf_sniper",1, 4},
shock = { "gth_inf_shock",1, 4},
destroyer = { "gth_inf_destroyer",1, 4},
prime = { "gth_inf_prime",1, 4},
}
}

AddUnitClass(REP, "ssv_inf_adept")
AddUnitClass(REP, "ssv_inf_sentinel")
AddUnitClass(REP, "ssv_inf_vanguard")

AddUnitClass(CIS, "gth_inf_shock")
AddUnitClass(CIS, "gth_inf_destroyer")
AddUnitClass(CIS, "gth_inf_prime")

AddUnitClass(CD1, "weap_tech_combatdrone")
SetUnitCount(3, 1)

SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)

--SetHeroClass(CIS, "cis_hero_grievous")
--SetHeroClass(REP, "rep_hero_kiyadimundi")

elseif RandomSide == 2 then
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\ME5.lvl;ME5n")
--ReadDataFile("dc:sound\\ME5.lvl;ME5cw")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\SIDE\\ssv.lvl",
"ssv_inf_soldier",
"ssv_inf_infiltrator",
"ssv_inf_adept",
"ssv_inf_engineer",
"ssv_inf_sentinel",
"ssv_inf_vanguard",
"weap_tech_combatdrone")
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\SIDE\\col.lvl",
"col_inf_drone",
"col_inf_assassin",
"col_inf_guardian",
"col_inf_scion",
"col_hero_harbinger")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")


SetupTeams{
ssv = {
team = REP,
units = 22,
reinforcements = 150,
soldier = { "ssv_inf_soldier",9, 25},
sniper = { "ssv_inf_infiltrator",1, 4},
adept = { "ssv_inf_adept",1, 4},
engineer = { "ssv_inf_engineer",1, 4},
sentinel = { "ssv_inf_sentinel",1, 4},
vanguard = { "ssv_inf_vanguard",1, 4},

},
gth = {
team = CIS,
units = 26,
reinforcements = 150,
soldier = { "col_inf_drone",9, 25},
assault = { "col_inf_assassin",3, 7},
support = { "col_inf_guardian",8, 14},
special = { "col_inf_scion",2, 4},
}
}

AddUnitClass(REP, "ssv_inf_adept")
AddUnitClass(REP, "ssv_inf_sentinel")
AddUnitClass(REP, "ssv_inf_vanguard")

AddUnitClass(CIS, "col_inf_guardian")
AddUnitClass(CIS, "col_inf_scion")

AddUnitClass(CD1, "weap_tech_combatdrone")
SetUnitCount(3, 1)

SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)

--SetHeroClass(CIS, "col_hero_harbinger")
--SetHeroClass(CIS, "cis_hero_grievous")
--SetHeroClass(REP, "rep_hero_kiyadimundi")

end


-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 210
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",12)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoldierAnimation", 239)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 4)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
--SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")

-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\ME5.lvl", "ME5n_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

if RandomSide == 1 then
SetAmbientMusic(REP, 1.0, "ssv_amb_start", 0,1)
SetAmbientMusic(REP, 0.9, "ssv_amb_mid", 1,1)
SetAmbientMusic(REP, 0.3, "ssv_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "ssv_amb_start", 0,1)
SetAmbientMusic(CIS, 0.9, "ssv_amb_mid", 1,1)
SetAmbientMusic(CIS, 0.3, "ssv_amb_end", 2,1)

SetVictoryMusic(REP, "ssv_amb_victory")
SetDefeatMusic (REP, "ssv_amb_defeat")
SetVictoryMusic(CIS, "ssv_amb_victory")
SetDefeatMusic (CIS, "ssv_amb_defeat")

elseif RandomSide == 2 then
SetAmbientMusic(REP, 1.0, "ssv_amb_nm2_start", 0,1)
SetAmbientMusic(REP, 0.9, "ssv_amb_nm2_mid", 1,1)
SetAmbientMusic(REP, 0.3, "ssv_amb_nm2_end", 2,1)
SetAmbientMusic(CIS, 1.0, "ssv_amb_nm2_start", 0,1)
SetAmbientMusic(CIS, 0.9, "ssv_amb_nm2_mid", 1,1)
SetAmbientMusic(CIS, 0.3, "ssv_amb_nm2_end", 2,1)

SetVictoryMusic(REP, "ssv_amb_victory")
SetDefeatMusic (REP, "ssv_amb_nm2_defeat")
SetVictoryMusic(CIS, "ssv_amb_victory")
SetDefeatMusic (CIS, "ssv_amb_defeat")
end

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "me5_shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "me5_shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "me5_shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "me5_shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "me5_shell_menu_exit")


-- Camera Stats
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);

end


[/code]
weap_tech_combatdrone_dispenser.odf
Hidden/Spoiler:
[code][WeaponClass]
ClassLabel = "dispenser"

[Properties]
OrdnanceName = "weap_tech_combatdrone"
IconTexture = "HUD_com_probedroid_health_icon"

RoundsPerClip = "1"
ReloadTime = "2.0"

HeatPerShot = "1.25"
HeatRecoverRate = "0.25"
HeatThreshold = "0.05"

TriggerAll = "1"

//AnimationBank = "grenade"
OffhandWeapon = 1

ShotDelay = "1.5"
MaxItems = "1.0"
InitialSalvoDelay = "0.5"

AutoAimSize = "1.0"
MaxPressedTime = "0.0"

MinStrength = "0.3"
MaxStrength = "0.4"

TargetEnemy = "0"
TargetNeutral = "0"
TargetFriendly = "0"

TargetPerson = "0"
TargetAnimal = "0"
TargetDroid = "0"
TargetVehicle = "0"
TargetBuilding = "0"

FireSound = "com_weap_inf_remotedroid_fire"
FireEmptySound = "com_weap_inf_ammo_empty"

[/code]
weap_tech_combatdrone.odf
Hidden/Spoiler:
[code][GameObjectClass]
ClassLabel = "droid"
GeometryName = "com_weap_probedroid.msh"

[Properties]
GeometryName = "com_weap_probedroid"
ExplosionName = "weap_tech_combatdrone_exp1"
ImpactEffectWater = "com_sfx_watersplash_ord"

FLYERSECTION = "BODY"
VehicleType = "light"

PilotType = "self"

MapTexture = "troop_icon"
HealthTexture = "HUD_com_probedroid_health_icon"
MapScale = 1.0

MapViewMin = 50
MapViewMax = 50
MapSpeedMin = 0
MapSpeedMax = 100

CollisionScale = 10.0

MaxHealth = 225.0

//EnergyAutoRestore = -1.7

SetAltitude = 1.2
GravityScale = 1.0//2
LiftSpring = 10.0 //10Lighter the veh the high the number
LiftDamp = 3.0

ScanningRange = 30.0
TransmitRange = 300.0

Acceleration = 25.0
Deceleration = 3.0
Traction = 22.0
ForwardSpeed = 3.5
ReverseSpeed = 3.5
StrafeSpeed = 0.25

SpinRate = 1.5
TurnRate = 1.5
TurnFilter = 5.0
PitchRate = 2.0
PitchFilter = 5.0
BankAngle = 0.0
BankFilter = 0

MoveTension = "30.0"//how much swim the craft has from the center of the screen


LevelSpring = 5.0
LevelDamp = 3.0

EyePointOffset = "0.0 0.5 0.0"
TrackOffset = "0.0 -0.25 1.8"
TiltValue = "5.0"

DestructTrackOffset = "0.0 0.0 18.0"
DestructTiltValue = "10.0"
DestructChargeEffect = "com_sfx_weap_remotedroidcharge2"

PitchLimits = "-50.0 50.0"
YawLimits = "-0.0 0.0"
AimerPitchLimits = "-90 90"
AimerYawLimits = "-90 90"

WEAPONSECTION = 1
WeaponName = "weap_tech_combatdrone_stun"
WeaponAmmo = 0
WeaponChannel = 0

AISizeType = "HOVER"

AmbientSound = "remotedroid_engine_lp"
Ambient2Sound = "remotedroid_radio"
HurtSound = ""
DeathSound = ""

\\\\\\\\\\\\ Collision \\\\\\\\\\\\\\

BuildingCollision = "p_buildingsphere"
VehicleCollision = "p_buildingsphere"
OrdnanceCollision = "p_sphere"
SoldierCollision = "p_sphere"[/code]
BFront2.log
Hidden/Spoiler:
Opened logfile BFront2.log 2012-01-28 2359
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BF9\data\_LVL_PC\core.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Skipping DT's extra missions
Cannot find ..\..\addon\BDT\data\_LVL_PC\SIDE\lead.lvl. Skipping ETR's extra Dark Times missions

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Skipping DT's extra missions

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\BDT\data\_LVL_PC\dtshell.lvl
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Skipping DT's extra missions
Cannot find ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Skipping DT's extra missions
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Closed any open movie
ifs_missionselect_pcMulti_ChangeMovieFile(): Opening movie: MOVIES\pre-movie.mvs
ifs_missionselect_pcMulti_ChangeMovieFile(): Finished opening movie
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode1
cur_button = nil
Checkbox for check_era14 clicked
this.CurButton = check_era14
cur_button = nil
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 05C0454C
The key, value is: change table: 06024088
The key, value is: era_g 1
The key, value is: mode_eli_g 1
The key is mapluafile, the formated value is: cor1<A>_<B>
The key, value is: bSelected 1
The key, value is: movieName preview-loop
The key, value is: movieFile MOVIES\pre-movie
The key, value is: era_n 1
The key, value is: mode_con_c 1
The key, value is: era_c 1
The key, value is: mode_con_n 1
The key, value is: mode_ctf_g 1
The key, value is: mode_con_g 1
The key, value is: mode_c_c 1
The key, value is: mode_ctf_c 1
custom_printTable(): Returning
custom_printTable(): table: 05C06B4C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_n Era = era_n subst = n
Adding map: cor1n_con idx: 1
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Same as last movie
this.CurButton = Launch
cur_button = nil

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedSegment.cpp(332)
pcShaderSegment: no shader for rendertype * [0x2f0c9f3d]

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedSegment.cpp(332)
pcShaderSegment: no shader for rendertype * [0x2f0c9f3d]

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "com_sfx_lightningball1" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: d6b3a2f1

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (b3503fc5)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (aef1787b)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (89f5bb6a)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (e281a8fd)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "com_item_powerup_dual" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: ffcad4d6

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "item_powerup_health25" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: 5c303a79

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "item_powerup_offense" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: afffa9dc

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "item_powerup_defense" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: be94427e

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameModel.cpp(221)
Model "item_powerup_energy" already loaded in ather level file

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\CollisionMesh.cpp(550)
Duplicate collision mesh name exists in another level file: bd0a38d2

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture hud_target_hint_offscreen

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture hud_target_hint_offscreen

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture btn_directional_pad_LR
game_interface: Entered
utility_functions2: Listening on AddUnitClass() calls
utility_functions2: Listening on SetHeroClass() calls
utility_functions2: Listening on ReadDataFile() calls
game_interface: Reading in custom strings
game_interface: No user_script_0.lvl
game_interface: No user_script_1.lvl
game_interface: No user_script_2.lvl
game_interface: No user_script_3.lvl
game_interface: No user_script_4.lvl
game_interface: No user_script_5.lvl
game_interface: No user_script_6.lvl
game_interface: No user_script_7.lvl
game_interface: No user_script_8.lvl
game_interface: No user_script_9.lvl
game_interface: Found user_script_10.lvl
user_script_10: Entered
user_script_10: Replacing v1.3 (r117)'s AddUnitClass as it should've had a return value. This fixes the Leia bug.
user_script_10: No user_script_11.lvl. Will stop searching for any more user scripts.
user_script_10: Exited
ifs_sideselect_fnBuildScreen()
game_interface: Exited

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 34

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 35

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 36

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 37

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 38

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 39

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 40

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 41

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "Music" is full; raise count to at least 42

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_hostile_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_bacta_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_mechanic_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_ammo_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_transport_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_backup_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_clear_area_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\VOHelper.cpp(183)
VOSound (rep1_inf_pc_com_defend_inVehicle): unknown modifier "InVehicle"

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm8_avenger_assault_rifle' [60fdd6b8] uses 2.00 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm8_avenger_assault_rifle' [60fdd6b8] uses 2.00 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm8_avenger_assault_rifle_bump' [e462e535] uses 2.00 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm8_avenger_assault_rifle_bump' [e462e535] uses 2.00 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm_100_grenade_launcher' [3339751e] uses 1.33 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'm_100_grenade_launcher' [3339751e] uses 1.33 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'armor_diffuse_so' [1b270e64] uses 1.33 MB

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Graphics\PC\pcRedTexture.cpp(553)
Texture 'armor_diffuse_so' [1b270e64] uses 1.33 MB

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\EntitySoldier.cpp(10471)
Soldier N7_soldier has geometry collision

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (c65b5b3c)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (80aa98dc)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (c65b5b3c)!

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FLEffect.cpp(214)
FLEffect::Read: duplicate effect class name (80aa98dc)!
uf_updateClassIndex(): Added class: col_inf_drone
uf_updateClassIndex(): Added class: col_inf_assassin
uf_updateClassIndex(): Added class: col_inf_scion
uf_updateClassIndex(): Added class: ssv_inf_soldier
uf_updateClassIndex(): Added class: ssv_inf_infiltrator
uf_updateClassIndex(): Added class: ssv_inf_engineer
uf_updateClassIndex(): Added class: ssv_inf_adept
uf_updateClassIndex(): Added class: ssv_inf_sentinel
uf_updateClassIndex(): Added class: ssv_inf_vanguard
uf_updateClassIndex(): Added class: col_inf_guardian
uf_updateClassIndex(): Already know class: col_inf_scion
uf_updateClassIndex(): Added class: weap_tech_combatdrone
utility_functions2: ReadDataFile(): This map's code, mode: cor cor1_conquest

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\EntityProp.cpp(875)
EntityProp 'Cor1_bldg_War_Room' AttachOdf 'cor1_light_war_room_1' odf not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=6425d425: trying to replace "cor1_prop_piller_1" with "cor1_prop_piller_10"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=d9fee2d6: trying to replace "com_item_healthrecharge" with "com_item_healthrecharge0"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=4e0d396c: trying to replace "com_item_weaponrecharge" with "com_item_weaponrecharge0"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.cor1.locals not localized

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.cor1.locals not localized

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "0" not found
ifs_sideselect_fnEnter(): Map supports custom era teams
ifs_sideselect_fnEnter(): The award settings file exists
ifs_sideselect_fnEnter(): Starting to remove award effects...
ifs_sideselect_fnEnter(): Finished removing award effects.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(82)
Weapon 'weap_tech_combatdrone_dispenser' is not localized for stats page

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(82)
Weapon 'weap_tech_combatdrone_stun' is not localized for stats page

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Controllable.cpp(383)
trying to AddController to a Controllable that already has one.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(668)
EntityClass "weap_inf_combatdrone_dispenser" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Controllable.cpp(383)
trying to AddController to a Controllable that already has one.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(668)
EntityClass "weap_inf_combatdrone_dispenser" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Controllable.cpp(383)
trying to AddController to a Controllable that already has one.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(668)
EntityClass "weap_inf_combatdrone_dispenser" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Controllable.cpp(383)
trying to AddController to a Controllable that already has one.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(668)
EntityClass "weap_inf_combatdrone_dispenser" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Controllable.cpp(383)
trying to AddController to a Controllable that already has one.

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(668)
EntityClass "weap_inf_combatdrone_dispenser" not found
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: A.I.-controlled spawned units

Post by fasty »

I got this working once, but I don't have the time and patience to go through the files and compare yours to mine. I will post mine and you can look through them if you want to.

LUA:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
THR = 3;
FOU = 4;
FIV = 5;
SIX = 6;

-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()



AllowAISpawn(REP, false)
AllowAISpawn(CIS, true)

ScriptCB_SetGameRules("campaign")
SetClassProperty("cis_hero_b", "PointsToUnlock", 10)
SetClassProperty("cis_hero_c", "PointsToUnlock", 1000)



--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

ClearAIGoals( 1 )
ClearAIGoals( 2 )
ClearAIGoals( 3 )
ClearAIGoals( 4 )
ClearAIGoals( 5 )
ClearAIGoals( 6 )


AddAIGoal(1, "Conquest", 1000);
AddAIGoal(2, "Conquest", 1000);
AddAIGoal(3, "Conquest", 1000);
AddAIGoal(4, "Conquest", 1000);
AddAIGoal(5, "Conquest", 1000);
AddAIGoal(6, "Conquest", 1000);



--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()



EnableSPHeroRules()





TroopSpawnerWeapon = "hvb_summon_ord"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 3 --Team the new spawned character is in
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
REP --User team (change this)
)

TroopSpawnerWeapon = "hvb_summon_ord"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon) then
local SupportTeam = 4 --Team the new spawned character is in
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
CIS --User team (change this)
)


TroopSpawnerWeapon2 = "hvb_summon_ord2"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon2) then
local SupportTeam = 5 --Team the new spawned character is in
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
CIS --User team (change this)
)



TroopSpawnerWeapon2 = "hvb_summon_ord2"

OnCharacterDispenseControllableTeam(
function(character,controlled)
if GetEntityClass(controlled) == GetEntityClassPtr(TroopSpawnerWeapon2) then
local SupportTeam = 6 --Team the new spawned character is in
local teamSize = GetTeamSize(SupportTeam)
for i = 0, teamSize-1 do
local characterIndex = GetTeamMember(SupportTeam, i)
local charUnit = GetCharacterUnit(characterIndex)
if not charUnit then
local destination = GetEntityMatrix(GetCharacterUnit(character))
SpawnCharacter(characterIndex,destination)
end
end
end
end,
REP --User team (change this)
)



end

function ScriptInit()

AISnipeSuitabilityDist(300)

ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("ingame.lvl")


SetMaxFlyHeight(500)
SetMaxPlayerFlyHeight (500)

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\\lol.lvl;lolgcw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\hvb.lvl",
"cis_hero_a",
"cis_hero_b",
"cis_hero_c",
"rep_inf_ep2_rifleman",
"cis_inf_rifleman",
"cis_hero_clone",
"cis_hero_droid",
"cis_hero_jangofett")



SetupTeams{
rep = {
team = REP,
units = 1,
reinforcements = 1,
soldier = { "cis_hero_clone",1, 1},
assault = { "cis_hero_b",1, 1},

},
cis = {
team = CIS,
units = 1,
reinforcements = 1,
soldier = { "cis_hero_droid",1, 2},
assault = { "cis_hero_b",1, 2},

}
}


SetTeamName (3, "rep")
AddUnitClass (3, "rep_inf_ep2_rifleman", 10)
SetUnitCount (3, 10)
SetReinforcementCount (3, -1)

SetTeamAsFriend(3,1)
SetTeamAsFriend(1,3)
SetTeamAsEnemy(3,2)
SetTeamAsEnemy(2,3)

SetTeamName (4, "cis")
AddUnitClass (4, "cis_inf_rifleman", 10)
SetUnitCount (4, 10)

SetTeamAsEnemy(4,1)
SetTeamAsEnemy(1,4)
SetTeamAsFriend(4,2)
SetTeamAsFriend(2,4)

SetTeamName (5, "rep")
AddUnitClass (5, "cis_hero_jangofett", 20)
SetUnitCount (5, 20)

SetTeamAsEnemy(5,1)
SetTeamAsEnemy(1,5)
SetTeamAsFriend(5,2)
SetTeamAsFriend(2,5)

SetTeamName (6, "rep")
AddUnitClass (6, "cis_hero_jangofett", 20)
SetUnitCount (6, 20)


SetTeamAsEnemy(6,2)
SetTeamAsEnemy(2,6)
SetTeamAsFriend(6,1)
SetTeamAsFriend(1,6)

SetTeamAsFriend(6,3)
SetTeamAsFriend(3,6)

SetTeamAsFriend(5,4)
SetTeamAsFriend(4,5)

SetTeamAsEnemy(5,6)
SetTeamAsEnemy(6,5)



-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- 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", 32)
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("SoldierAnimation", 1500)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:001\\001.lvl", "001_conquest")
ReadDataFile("dc:001\\001.lvl", "001_conquest")
SetDenseEnvironment("false")



-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
OpenAudioStream("dc:sound\\lol.lvl", "lolgcw_music")
voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")


SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "cis_kam_amb_start", 0,1);
SetAmbientMusic(CIS, 1.0, "cis_kam_amb_start", 0,1);

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
AddCameraShot(0.287655, -0.066444, -0.930915, -0.215026, -217.519547, 96.101807, 35.219997);
AddCameraShot(0.876678, -0.253234, 0.392968, 0.113511, -31.795605, 81.145271, 235.748810);
AddCameraShot(0.519309, -0.052835, 0.848571, 0.086335, -14.514286, 15.541163, 149.851517);
AddCameraShot(0.956666, -0.093086, -0.274610, -0.026720, -207.755035, 15.541163, 243.969788);
AddCameraShot(0.646976, -0.056024, -0.757615, -0.065604, -282.635925, 15.541163, 107.756104);
AddCameraShot(-0.216655, 0.020280, -0.971789, -0.090967, -55.691074, 15.541163, -35.326435);
AddCameraShot(0.929067, -0.009482, 0.369771, 0.003774, -183.885178, 59.157894, 288.408081);

end
hvb_summon:
Hidden/Spoiler:
[WeaponClass]

ClassLabel = "remote"

[Properties]


RoundsPerClip = "1"
ReloadTime = "0.5"
HeatRecoverRate = "0.0"
HeatThreshold = "0.1"

MinRange = "0"
OptimalRange = "220"
MaxRange = "300"
AIUseBubbleCircle = "1"
AIBubbleSizeMultiplier = "200.0"

ReticuleInAimingOnly = 1
SniperScope = 1
ZoomFirstPerson = 1

ZoomMin = "20.0"
ZoomMax = "65.0"
ZoomRate = "2.5"

TargetEnemy = "1"
TargetNeutral = "1"
TargetFriendly = "0"

AITargetEnemy = "1"
AITargetNeutral = "1"
AITargetFriendly = "0"

FireAnim = "0"

InstantPlayFireAnim = "0"

AnimationBank = "tool"

SwitchImmediately = "1"

OffhandWeapon = 0

SwitchImmediately = "0"

ModeTexture = "HUD_weap_semiauto"
OrdnanceName = "hvb_summon_ord"
ScopeTexture = "weapon_scope4"
TriggerSingle = "1"
ShotDelay = "0.5"
HeatPerShot = "0.0"
MaxPressedTime = "0.0"

LockOnRange = "220.0"
LockTime = "1.0"
AutoAimSize = "2.0"

SalvoCount = "1"
SalvoDelay = "0.3"
InitialSalvoDelay = "0.0"
SalvoTime = "0.0"
hvb_summon_ord:
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "droid"
GeometryName = "com_weap_probedroid.msh"

[Properties]
ExplosionName = "all_weap_inf_remotedroid_exp1"
GeometryName = "com_weap_probedroid"
ImpactEffectWater = "com_sfx_watersplash_ord"

FLYERSECTION = "BODY"
VehicleType = "light"

PilotType = "remote"

MapTexture = "troop_icon"
HealthTexture = "HUD_com_probedroid_health_icon"
MapScale = 1.0

MapViewMin = 50
MapViewMax = 50
MapSpeedMin = 0
MapSpeedMax = 100

CollisionScale = 10.0

MaxHealth = 100.0
AddHealth = -1.0

EnergyAutoRestore = -99999.9

SetAltitude = 2000.0
GravityScale = 1.0//2
LiftSpring = 10.0 //10Lighter the veh the high the number
LiftDamp = 3.0

ScanningRange = 30.0
TransmitRange = 300.0

Acceleration = 25.0
Deceleration = 3.0
Traction = 22.0
ForwardSpeed = 3.5
ReverseSpeed = 3.5
StrafeSpeed = 0.25

SpinRate = 1.5
TurnRate = 1.5
TurnFilter = 5.0
PitchRate = 2.0
PitchFilter = 5.0
BankAngle = 0.0
BankFilter = 0

MoveTension = "30.0"//how much swim the craft has from the center of the screen


LevelSpring = 5.0
LevelDamp = 3.0

EyePointOffset = "0.0 0.5 0.0"
TrackOffset = "0.0 -0.25 1.8"
TiltValue = "5.0"

DestructTrackOffset = "0.0 0.0 18.0"
DestructTiltValue = "10.0"
DestructChargeEffect = "com_sfx_weap_remotedroidcharge2"

PitchLimits = "-50.0 50.0"
YawLimits = "-0.0 0.0"
AimerPitchLimits = "-90 90"
AimerYawLimits = "-90 90"

WEAPONSECTION = 1
WeaponName = "com_weap_null"
WeaponAmmo = 0
WeaponChannel = 0

AISizeType = "SOLDIER"

AmbientSound = "remotedroid_engine_lp"
Ambient2Sound = "remotedroid_radio"
HurtSound = ""
DeathSound = ""

\\\\\\\\\\\\ Collision \\\\\\\\\\\\\\

BuildingCollision = "p_buildingsphere"
VehicleCollision = "p_buildingsphere"
OrdnanceCollision = "p_sphere"
SoldierCollision = "p_sphere"
The gameplay was each team had a "summoner" that could bring forth an army of ai to use against the enemy, and you would watch your armies fight. You only got ammo for the summon weapon every couple minutes and the players had no weapons on their own. It was pretty fun. :D
Post Reply