exec global/friendly.scr
main:
level waittill prespawn
fadein 2 0 0 0 1
wait 2
level.script = maps/test_grb1.scr
level.friendly1 thread global/friendly.scr::friendlythink
level.friendly1.friendtype = 1
I read the front end comments in the global/friendly.scr file, and the two
above lines are what it said to put into the main script file. Notice at this
point I have not added any min/max dist parameters etc.. I just want to
see if the AI character would even attempt to follow me.
OK. In the map, I surrounded the AI character ( ai_allied_1st-ranger_sergeant ) with info_pathnodes about 64 grids apart and extending for a couple hundred grid width.
The information I put in for the AI is:
target name friendly
testanim follow
#set 1 and of course the other stuff that gets assigned to the AI character such as angles blah, blah. I did not click any of the little boxes in the Entity Screen such as NO_STATION, detail etc.. So the Spawn Flag is still set to zero (0).
DO NOTICE THE KEY: #set VALUE 1. Now I also tried the stuff WITH NO SUCCESS when I entered KEY: set VALUE 1. So that is not an issue here.
Based on what I read in the global/friendly.scr this is basically all one should have to do, or so it seems to me.
But when I fire the map up, the sergeant will not follow me around.
The following is what I see in the console just after the map loads up:
level.friendly0 thread global/friendly.scr::friendlythink (maps/test_grb1.scr, 20)
level.friendly0 ^
^~^~^ Script Error: command 'thread' applied to NIL
level.friendly0.friendtype = 1 (maps/test_grb1.scr, 21)
level.friendly0^
^~^~^ Script Error: Cannot cast 'NIL' to listener
Now.................as I look in the global/friendly.scr file I do notice that there are reference to "NIL" in some IF STATEMENTS. For whatever that
is worth.
Any clues as to what I am doing wrong or not doing? OR IS IT AS USUAL,
A PROBLEM WITH RUNNING IN TEST MODE, AND THEREFORE NOT HAVING SCRIPT CODE PLACED INTO THE global/friendly.scr file etc., that references my particular map (test_grb1).
Let me qualify this question a bit. In the friendly.scr file there is a lot of code which is enclosed in IF statements that test for the STANDARD MOHAA MISSIONS, e.g. m4l1, m5l1 etc..
Now readers, the AI character is fully AI active, that is he will tell me to shoot at enemies, and he will move along the info_pathnodes I placed in the map IF I NUDGE HIM ALONG. So it is not an issue with not having info_pathnodes set close enought to him.
And finally, has anyone gotten AI characters to follow the player in Single Player MOHAA maps they built?
thanks for any help....