Page 1 of 1

problems with getting guys to follow player

Posted: Fri Mar 19, 2004 7:25 pm
by lizardkid
Okay, this has got to be easy but i can't get a small # of four guys to follow the player in this one level. the four friendlies are named friend1, 2, 3, and cappy. (real original) first time trying this.
here's that thread of the script:

$cappy.destination = $player
$friend1.destination = $player
$friend2.destination = $player
$friend3.destination = $player

$cappy.friendtype = 1
$friend1.friendtype = 1
$friend2.friendtype = 1
$friend3.friendtype = 1

$cappy.distance = 175
$friend1.distance = 200
$friend2.distance = 225
$friend3.distance = 250

so i got them to have the player as a destination for their following, set their friendlytype to 1 (follow, right?) and got their distance, all really basic stuff, but everytime i run the level, they don't do anything. and i check out the console to see if it's telling me anything worth knowing, and it tells me they can't find the start node. (same message as when you put a pathnode too far away from an AI)
:?:
help?

Posted: Fri Mar 19, 2004 8:46 pm
by jv_map
  • Did you put sufficient pathnodes in your map?
  • I thought the friendlies should be name 'friendly1' etc (for mohaa that is)
  • Do you have exec global/friendly.scr in your script? (below level waittill prespawn)
  • Do the animations work, i.e. can the friendlies do animations (like running away for grenades) or do they just stand there?

Posted: Fri Mar 19, 2004 8:53 pm
by lizardkid
I'm using SH, i'm not sure whether it needs friendly or not.
no, i didn't get any pathnodes for them, that's probably it, i didn't realize they couldn't just adjust their xy position to fit near the player. and yes, animations work, and i did put in the exec/global/friendly.scr.
thanx jv! :D

Posted: Sat Mar 20, 2004 4:27 am
by bdbodger
When you set up friendlies all the ai have the same targetname friendly and a #fnum from 1 to 9 I think it is . The global/friendly.scr finds all the ai named $friendly and uses thier #fnum to make an array so a $friendly with a #fnum of 1 becomes level.friendly1 . It may be possible after the level starts to change the targetname of the ai to something you want like level.friendly1.targetname = "cappy" or maybe level.cappy = level.friendly1 . You need pathnodes with a targetname of friendlynode and for some friendlytypes you may need to number them with set numbers . not all the nodes need to have that targetname and they can be spaced as far apart as you want but you will need normal nodes too because I believe that the nodes need to be no farther away than 320 units from each other . There is a command ai_showpath 1 you can use in the console to show the connections between the nodes in the game to make sure there are no breaks .