problems with getting guys to follow player

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

problems with getting guys to follow player

Post 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?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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?
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
Post Reply