AI become smarter

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
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

AI become smarter

Post by agentsmith38 »

I've noticed that AI become slightly smarter when you ask them to follow you, they tend to use the HintNodes alot more, they shoot a bit more accurately, they use sprint when you run and they engage their enemies at a slightly longer distance.

Is there a possible way to make the AI do all that (Or some of that) without asking them to follow you ?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: AI become smarter

Post by DarthD.U.C.K. »

here are a few topics discussing ways to make the ai "smarter"
http://www.gametoast.com/forums/viewtop ... 15#p292315
http://www.gametoast.com/forums/viewtop ... 82#p384982
http://www.gametoast.com/forums/viewtopic.php?p=407096
it would be probably nice to have one topic with all ways
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

Re: AI become smarter

Post by agentsmith38 »

DarthD.U.C.K. wrote:here are a few topics discussing ways to make the ai "smarter"
http://www.gametoast.com/forums/viewtop ... 15#p292315
http://www.gametoast.com/forums/viewtop ... 82#p384982
http://www.gametoast.com/forums/viewtopic.php?p=407096
it would be probably nice to have one topic with all ways

Ah, why thank you very much, my good man.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: AI become smarter

Post by DarthD.U.C.K. »

you are welcome :D
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

Re: AI become smarter

Post by agentsmith38 »

I looked at one of the threads and tried adding in this -

SetPlayerTeamDifficulty(15)
SetEnemyTeamDifficulty(15)

To my LUA, but it keeps crashing as soon as it starts, am I doing something wrong?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: AI become smarter

Post by DarthD.U.C.K. »

do the logs complain about anything?
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

Re: AI become smarter

Post by agentsmith38 »

DarthD.U.C.K. wrote:do the logs complain about anything?
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
.\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
this.CurButton = nil
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode1
cur_button = nil
custom_AddMapNew()
custom_printTable(): table: 052B3164
The key, value is: era_c 1
The key, value is: mode_con_c 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key is mapluafile, the formated value is: TFP<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 04E96B4C
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_c Era = era_c subst = c
Adding map: TFPc_con idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil

Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `SetPlayerTeamDifficulty' (a nil value)
stack traceback:
(none): in function `ScriptInit'


Thats all thats in my log
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: AI become smarter

Post by DarthD.U.C.K. »

that looks like you put the command in the wrong place, did ypu put it in the scripostload function?
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

Re: AI become smarter

Post by agentsmith38 »

DarthD.U.C.K. wrote:that looks like you put the command in the wrong place, did ypu put it in the scripostload function?
I placed mine under function ScriptInit()
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: AI become smarter

Post by DarthD.U.C.K. »

then try to put it under/in scriptpostload.
User avatar
agentsmith38
Command Sergeant Major
Command Sergeant Major
Posts: 283
Joined: Thu May 27, 2010 9:47 am
Projects :: The Final Push Future - Omaha Beach
Games I'm Playing :: ArmA 2 OA
xbox live or psn: No gamertag set
Location: In the Trenches, getting ready to go over the top..

Re: AI become smarter

Post by agentsmith38 »

DarthD.U.C.K. wrote:then try to put it under/in scriptpostload.
I tried it, my map didn't crash, but now AI don't spawn.

my error log showed this:


Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `SetPlayerTeamDifficulty' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'



I placed it in my LUA like this:

function ScriptPostLoad()

SetPlayerTeamDifficulty(20)
SetEnemyTeamDifficulty(20)


--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"}
Post Reply