Page 1 of 1

AI become smarter

Posted: Mon Feb 07, 2011 9:12 am
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 ?

Re: AI become smarter

Posted: Mon Feb 07, 2011 11:26 am
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

Re: AI become smarter

Posted: Mon Feb 07, 2011 11:33 am
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.

Re: AI become smarter

Posted: Mon Feb 07, 2011 11:35 am
by DarthD.U.C.K.
you are welcome :D

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:22 pm
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?

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:25 pm
by DarthD.U.C.K.
do the logs complain about anything?

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:26 pm
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

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:29 pm
by DarthD.U.C.K.
that looks like you put the command in the wrong place, did ypu put it in the scripostload function?

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:32 pm
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()

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:33 pm
by DarthD.U.C.K.
then try to put it under/in scriptpostload.

Re: AI become smarter

Posted: Mon Feb 07, 2011 4:37 pm
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"}