Page 1 of 1

AI won't shoot enemy

Posted: Fri Mar 25, 2016 12:08 pm
by Benoz
Hello community,

I'm facing a few problems on my custom mode I made. So I made an order 66 mode where you play the 327th Star Corps vs. Aayla Secura on Felucia.
First of all is there a way to only spawn 1 Aayla Secura? This is my SetupTeams LUA:

Code: Select all

jed = {
            team = JED,
            units = 1,
            reinforcements = -1,
			soldier = { "rep_hero_aayla_jedihunt", 1, 2}
	
        }, 
Now when I play as Clone Troopers everything works fine (there's only 1 Aayla Secura AI walking around)
But when I play as Aayla then there's always a second Aayla AI. I already tried setting the PlayerMax variable to 1 like this:

Code: Select all

jed = {
            team = JED,
            units = 1,
            reinforcements = -1,
			soldier = { "rep_hero_aayla_jedihunt", 1, 1}
	
        }, 
but then when I play as Clone Troopers no Aayla AI spawns at all.

But the bigger problem is this one:
When I play the new game mode (i just replaced it as the elimination mode) the Clones won't even attack Aayla Secura (whether it's me or the AI).
They just walk around doing nothing and they only shoot when I'm directly in front of them as Aayla Secura.

I set the AIs' objective to ObjectiveTDM and the AIGoal to "Deathmatch" and I didn't mess with the ObjectiveTDM. Here's the complete LUA:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("setup_teams")


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

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

SetProperty("cp1-1", "Team", "1")
SetProperty("cp2-1", "Team", "1")
SetProperty("cp3-1", "Team", "1")
SetProperty("cp4-1", "Team", "1")
SetProperty("cp5-1", "Team", "1")
SetProperty("cp6-1", "Team", "2")
SetProperty("cp1-1", "CaptureRegion", "nil")
SetProperty("cp2-1", "CaptureRegion", "nil")
SetProperty("cp3-1", "CaptureRegion", "nil")
SetProperty("cp4-1", "CaptureRegion", "nil")
SetProperty("cp5-1", "CaptureRegion", "nil")
SetProperty("cp6-1", "CaptureRegion", "nil")
SetProperty("cp1-1", "HUDIndexDisplay", "")
SetProperty("cp2-1", "HUDIndexDisplay", "")
SetProperty("cp3-1", "HUDIndexDisplay", "")
SetProperty("cp4-1", "HUDIndexDisplay", "")
SetProperty("cp5-1", "HUDIndexDisplay", "")
SetProperty("cp6-1", "HUDIndexDisplay", "")
KillObject("cp5-1")
KillObject("cp2-1")
KillObject("cp3-1")
KillObject("cp4-1")
SetClassProperty("com_bldg_major_controlzone", "SwitchClassRadius", 10.0)

SetClassProperty("rep_hero_aayla_jedihunt", "MaxHealth", "10000")
SetClassProperty("rep_hero_aayla_jedihunt", "AddHealth", "20")
SetClassProperty("rep_inf_commander_bly", "PointsToUnlock", "18")

SetAIDifficulty(5, 1)

-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
pointsPerKillATT =50,
pointsPerKillDEF = 1,
multiplayerRules = true }

TDM:Start()

TDM.OnStart = function(self)
AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end

EnableSPHeroRules()

end


function ScriptInit()
StealArtistHeap(132*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(3200000)
ReadDataFile("ingame.lvl")

SetMemoryPoolSize("Music", 39)

ReadDataFile("sound\\fel.lvl;fel1cw")

SetMaxFlyHeight(53)
SetMaxPlayerFlyHeight (53)
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_fel_rifleman_jedihunt",
"rep_inf_fel_sniper_jedihunt",
"rep_inf_commander_bly",
"rep_hero_aayla_jedihunt")

SetupTeams{

jed = {
team = JED,
units = 1,
reinforcements = -1,
soldier = { "rep_hero_aayla_jedihunt", 1, 2}

},

order = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "rep_inf_fel_rifleman_jedihunt", 12, 24},
sniper = { "rep_inf_fel_sniper_jedihunt", 8, 16},
commander = { "rep_inf_commander_bly", 1, 1}
}

}

SetTeamAsEnemy(ATT, DEF)
SetTeamAsEnemy(DEF, ATT)

-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 8)
-- AddWalkerType(5, 2) -- 2 attes with 2 leg pairs each
-- AddWalkerType(3, 1) -- 3 acklays with 3 leg pairs each
AddWalkerType(1, 2)
AddWalkerType(0, 4)
local weaponCnt = 260
SetMemoryPoolSize("Aimer", 20)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 200)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityHover", 3)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntitySoundStream", 1)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("EntityWalker", 5)
SetMemoryPoolSize("MountedTurret", 6)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("PathNode", 512)
SetMemoryPoolSize("TreeGridStack", 280)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("fel\\fel1.lvl", "fel1_conquest")
SetDenseEnvironment("false")
SetAIViewMultiplier(0.65)
--AddDeathRegion("Sarlac01")

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

end


[/code]
I cut the Sound section from the LUA since it's not relevant.
I hope somebody can help me quick, because I really need that game mode working in time.
Thanks in advance!

-The66Order66

Re: AI won't shoot enemy

Posted: Fri Mar 25, 2016 2:19 pm
by AnthonyBF2
You can set that team string for aayla to look like {"rep_hero_aalya",0,0} - 0,0 determines min and max bots allowed for this character. 0 and 0 sets no bots.

Re: AI won't shoot enemy

Posted: Fri Mar 25, 2016 6:05 pm
by Benoz
anthonybf2 wrote:You can set that team string for aayla to look like {"rep_hero_aalya",0,0} - 0,0 determines min and max bots allowed for this character. 0 and 0 sets no bots.
Yeah I know that but when I play on the Clone Trooper side I want to fight against an AI Aayla. So when I put 0-0 no enemy would spawn at all.
About problem #2: I even followed the instructions of AQT from this post viewtopic.php?f=27&t=30729&p=509558&hil ... nt#p509558
but the Clone Troopers just run around

Re: AI won't shoot enemy

Posted: Fri Mar 25, 2016 7:19 pm
by AnthonyBF2
If you want only 1 Aayla, set the min and max numbers to 1 and 1 inside of setup teams. Also, set units to 1 for the Aayla side.

Re: AI won't shoot enemy

Posted: Mon Mar 28, 2016 12:45 pm
by Benoz
anthonybf2 wrote:If you want only 1 Aayla, set the min and max numbers to 1 and 1 inside of setup teams. Also, set units to 1 for the Aayla side.
I know that, but I already wrote when I set max and min to 1:
when I play as Clone Troopers no Aayla AI spawns at all
So it won't work then. But I actually want to focus on the bug where no AIs shoot the jedi. I tried ClearAIGoal and AddAIGoal(1, "Destroy", 100, GetTeamMember(2, 0)) but it wont work.

EDIT
Bump - can somebody help me please?