PDA

View Full Version : AI follow script



Greenglow2004
August 4th, 2007, 04:17 PM
Hey guys , ive been messing around with ai for a sp mod , and i cant seem to get the ai to follow the player.
Ive looked for a tutorial and cannot find one.

This is what ive tried

(ai_follow_target_players one)

One is the name of the encounter.
The ai just do nothing !!

Tarzan
August 4th, 2007, 11:49 PM
you need to set a follow distance too I think. I'm not too sure on that - I don't script for AI too often

Bastinka
August 5th, 2007, 01:16 AM
Do you get an error in sapien that said it failed to compile the script?

Greenglow2004
August 5th, 2007, 11:07 AM
no my scripts compile correctly. just my marines stand there are look at me. ive tryed with setting the marine follow distance and with out setting it. maybe i dont have the encounter set up correct for it.


(ai_allegiance player human)
(ai_follow_target_players one)
(ai_follow_distance one 7)

im not sure what value i should make the folow distance so i just guessed a 7

Tarzan
August 5th, 2007, 12:16 PM
I'd go with more like 2 or 2.5 on the follow distance.

Ki11a_FTW
August 5th, 2007, 05:36 PM
wrong wrong wrong. just open up b40 and see what they did with the squads

Greenglow2004
August 5th, 2007, 05:42 PM
Edit ! i didnt see your post EP_killa, i will have a look at b40. note : what i have written bellow was before i noticed your post.




i tried all different distances now and it makes no difference. they still dont follow me : \


also i have a another weird problem
i created 2 identical encounters and two identical command lists.
go to point 0 and keep moving.

there identical command lists. except the second one tells the encounter to go a different point.
the first works and the second doesn't . ive tryed changing the point and it makes no difference. im so confused : |

Greenglow2004
August 6th, 2007, 12:10 PM
well im still having problems. they still dont follow me. !!

looking at the squads in b40 didnt help much either. am i missing somthing ??
any more ideas guys ?

adumass
August 7th, 2007, 12:32 AM
well im still having problems. they still dont follow me. !!

looking at the squads in b40 didnt help much either. am i missing somthing ??
any more ideas guys ?

Check the marine encounters/squads and set yours up like theirs also check how they set up the firing positions for each squad.

Greenglow2004
August 7th, 2007, 01:28 PM
this might sound stupid but i have no idea what firing positions do, could some one explain or point me to a tutorial that explains. because i searched and i could not find a ai tut that covers them .

and the ai follow script still doesnt work. even tho ive set up my encounters and squads the same ! so maybe i do need to figure out these " fireing positions "

adumass
August 7th, 2007, 02:12 PM
this might sound stupid but i have no idea what firing positions do, could some one explain or point me to a tutorial that explains. because i searched and i could not find a ai tut that covers them .

and the ai follow script still doesnt work. even tho ive set up my encounters and squads the same ! so maybe i do need to figure out these " fireing positions "

This is why mot ai maps suck..people don't use firing positions. Firing positions are where the ai will move when in combat. They move to them to take cover, search, and to fire... You NEED them for the ai to follow you not just the encounter/squad stuff. I'm not good at explaining stuff.. but if you still need help maybe we could talk on msn or something.

Rob Oplawar
August 7th, 2007, 07:11 PM
Not sure if this is the problem or not, but you may want to keep it in mind- in my level I've had problems with the AI in the past because the pathfinding isn't very good. My AIs have previously ignored large scenery objects blocking their paths but treated other AIs as though they were 10 feet across, and refused to go through a wide hallway just because another AI was already in there, moving in the same direction (but still in-between him and his target, you see). Also I've had problems with uneven terrain, or ceilings that were just a bit too low, or even AIs that completely fail to notice that the ceiling is too low and gets stuck there.

The point being, you reeeealy have to hold the AIs hand to get them to move through your level properly.

That said, if you get the AI to actually follow the player, please let me know how you did it. At the moment I'm stuck with encouraging the player to follow the AI instead of the other way around =P

adumass
August 8th, 2007, 01:15 AM
Not sure if this is the problem or not, but you may want to keep it in mind- in my level I've had problems with the AI in the past because the pathfinding isn't very good. My AIs have previously ignored large scenery objects blocking their paths but treated other AIs as though they were 10 feet across, and refused to go through a wide hallway just because another AI was already in there, moving in the same direction (but still in-between him and his target, you see). Also I've had problems with uneven terrain, or ceilings that were just a bit too low, or even AIs that completely fail to notice that the ceiling is too low and gets stuck there.

The point being, you reeeealy have to hold the AIs hand to get them to move through your level properly.

That said, if you get the AI to actually follow the player, please let me know how you did it. At the moment I'm stuck with encouraging the player to follow the AI instead of the other way around =P

Well I think he got it working I gave him one of my scenarios with the ai set up to follow the player to look at. You just have to set up the firing positions and squads correctly. Look at the marine encounters in b40 that follow the player for an example. If you want help just pm me or message me on msn.

MNC
August 8th, 2007, 04:17 PM
I usually use command lists... Lol, didn't even know about the follow distance stuff.