Page 1 of 1

Ai are just standing bug

Posted: Tue Jan 13, 2015 3:33 pm
by thelegend
Hey all,
At the moment I have a very weird AI bug. All units are just standing there and don't walk over the plannings. They still respect my barriers but don't follow their ways. That makes me sad :(

All units only have swords, so they can't shoot eachother. Is there a little lua magic trick which makes the units more aggresiv. Their target must be: "Go and kill the next enemy you see" and then they can only follow the plannings and kill the enemies. The just stand where they spawned.
If there is a fix for this then I were very thankful :D
Ah and here's my .lua file if it's needed:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

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

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
AddDeathRegion("deathregion1")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
end


---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()


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 -- should be ~1x #combo

ReadDataFile("ingame.lvl")

PEARL = 1
DUTCHMAN = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(60)
SetMaxPlayerFlyHeight(60)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\pearl.lvl",
"pearl_inf_crew_member_1",
"pearl_inf_crew_member_2",
"pearl_inf_crew_member_3",
"pearl_inf_gibbs",
"pearl_inf_jack_sparrow",
"pearl_inf_elizabeth_swann",
"pearl_inf_will_turner",
"pearl_inf_hector_barbossa" )

ReadDataFile("dc:SIDE\\dutchman.lvl",
"dutchman_inf_crew_member_1",
"dutchman_inf_crew_member_2",
"dutchman_inf_crew_member_3",
"dutchman_inf_davy_jones",
"dutchman_inf_palifico",
"dutchman_inf_maccus",
"dutchman_inf_hadras",
"dutchman_inf_morey" )


SetupTeams{
hero = {
team = PEARL,
units = 20,
reinforcements = -1,
soldier = { "pearl_inf_crew_member_1",2,3},
assault = { "pearl_inf_crew_member_2", 2,3},
engineer= { "pearl_inf_will_turner", 1,1},
sniper = { "pearl_inf_crew_member_3", 2,3},
officer = { "pearl_inf_elizabeth_swann", 1,1},
special = { "pearl_inf_gibbs", 1,1},
},
}

AddUnitClass(PEARL,"pearl_inf_hector_barbossa", 1,1)
AddUnitClass(PEARL,"pearl_inf_jack_sparrow", 1,1)


SetupTeams{
villain = {
team = DUTCHMAN,
units = 20,
reinforcements = -1,
soldier = { "dutchman_inf_crew_member_1", 2,3},
assault = { "dutchman_inf_crew_member_2",2,3},
engineer= { "dutchman_inf_morey", 1,1},
sniper = { "dutchman_inf_crew_member_3", 2,3},
officer = { "dutchman_inf_palifico", 1,1},
special = { "dutchman_inf_hadras", 1,1},

},
}

AddUnitClass(DUTCHMAN,"dutchman_inf_maccus", 1,1)
AddUnitClass(DUTCHMAN,"dutchman_inf_davy_jones", 1,1)


-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:AWM\\AWM.lvl", "AWM_eli")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

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

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

SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "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")

SetAttackingTeam(ATT)

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end

Re: Ai are just standing bug

Posted: Tue Jan 13, 2015 4:00 pm
by Marth8880
What did you do between the time that it was working and the time that it stopped working? What happens if you undo what you did?

Also, what does your debug log say? :o There may be memory pool issues or something. Additionally, you can open up the debugger and while in-game, press the tilde (~) and type "aimode" without quotes and hit enter. Then you can see what the AI are thinking about.

Re: Ai are just standing bug

Posted: Tue Jan 13, 2015 4:14 pm
by thelegend
Before I added plannings there was just the normal hero assault. Also all the default heroes like Luke or Han Solo were there. Then I changed the units to my custom units who all only have sabers. Then I tested it out and they didn't do anything. I even tried it with adding plannings but without any success. I will test it with the modtools.exe.

Edit: ok. I tried your command. The bots "think" about the following lines:

Code: Select all

DM
Combat
Engange
Melee
But I have no clue how It can be fixed.