
Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Jul 9, 2008 04:05 PM
Msg. 1 of 19
Does anyone know how to get AI to follow the player? I'm working on a single player map where, at one point, a squad of marines are rescued from covenant capture by the player, and from that point on they have to follow him to the next battle.
Here's what I've already done: I've already used (ai_follow_target_players <ai>) on the right encounter. The squads in that encounter have "automatic migration" checked, and I even made sure that their firing positions lead to the areas where they have to follow the player.
I've heard that this command for some reason doesn't work, but I refuse to believe that. This is because I've searched through the campaign scripts and this very same command was used alone to make the marines follow you in the campaign.
I've also checked the encounters and squads that were referred to by this command in the campaign maps' scenarios, and the only thing I found in common was that "automatic migration" was checked in the squads, and I've already done that and they still don't follow. Otherwise, there was nothing else apparent that was different about the settings of the encounters and squads.
There seems to be few reasons for why it won't work, so there must be something I'm missing here.
Any help would be greatly appreciated.
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: Jul 9, 2008 04:07 PM
Msg. 2 of 19
wasn't there another topic on this once?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Jul 10, 2008 03:44 PM
Msg. 3 of 19
I'm wondering specifically if is has anything to do with the BSP?
The way that the AI use path-finding to move around is when they come across a sudden change of height (for example, the edge of a road next to the edge of a barely elevated sidewalk) then they never consider just walking right on to it, even if the height difference is small enough for them to do so. They look for a place that connects the two different height levels (an inclined area) in order to get to the sidewalk in this case.
The same goes for trying to go down two height levels. AI usually don't consider jumping off of a different height, even if the distance is small enough not to hurt them. They always find an inclined area to go down to the different height.
Would that interfere with their consideration of following the player? Because the BSP that I'm using for this single player map is the Chronopolis_c3 BSP, and it has a lot of very small elevation changes, like the edges of the roads intersecting with the curbs, that could cause this problem. Though most of these height changes do have inclines to travel on (like the wide, barely-noticeable ramps in each garage from the roads) so again, I'm stuck trying to figure this out.
|
|
|

MechWarrior001
Joined: Mar 13, 2007
|
Posted: Jul 11, 2008 05:23 AM
Msg. 4 of 19
You could also have them use scripted jumps when they come across said area. Just add a trigger volume and a script. One they enter, they jump, everyone's good, they go drink some Digital Drinks.
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Jul 11, 2008 11:52 AM
Msg. 5 of 19
Quote: --- Original message by: MechWarrior001 You could also have them use scripted jumps when they come across said area. Just add a trigger volume and a script. One they enter, they jump, everyone's good, they go drink some Digital Drinks. You can't script a jump. You can add a jump into a command list, though, but that solution doesn't help because I would need to add a trigger volume to every single little jump, which is unneeded. The problem isn't that they ignore those little height changes, the problem is that they don't follow the player at all. They stay at their own choice of firing positions. I was just mentioning those areas as possibly being the reason for why they don't bother trying to follow the player.
|
|
|

Dark Ninja
Joined: May 26, 2008
The internet shows how stupid people are.
|
Posted: Jul 13, 2008 09:19 PM
Msg. 6 of 19
I have the same problem. I've done everything you've done, but in my script I also added (ai_follow_distance marines 5). I don't know if that will help you.
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Aug 7, 2008 09:54 PM
Msg. 7 of 19
I came back to say that I found out how to do it by looking at the firing position and squad setup of some encounters on b40, so problem solved.
But, I thought I should say how to do it so that other people don't have to deal with this problem. I've searched these forums, and I personally haven't found any decent explanation of how to do this.
What you do is make small groups of firing positions in the areas where you want the encounter to follow the player to. Each of these groups is then set to a unique firing position group letter, i.e. the first group of firing positions set to 'A', the group nearby set to 'B', the group near 'B' set to 'C', etc. You can make up to 26 of these groups per encounter, since you have letters A-Z to work with. It's best to have the groups linearly arranged from A to Z where possible, so that it's easier to remember which is which.
Then, you make what I call "empty squads" for each letter: each of these squads has no actor type specified, as well as no spawn points, move positions, or spawn settings. All that is specified in these squads is the initial state, return state, and "automatic migration", which HAS to be checked. Automatic migration gives the encounter's actors the freedom to switch from one squad to another at will. This is what lets them follow the player, since now they can move (migrate) to the firing position group's squad that is closest to the player.
Finally, the most important part is to specify the corresponding firing position group letter for each empty squad for each AI state (attacking, attacking guard, defending, etc.) You should name the squads by which firing position group they belong to, i.e. "squad_a" for the A group.
After you finish this, don't forget to create a normal squad or squads to actually spawn your actors in. In these squads, "automatic migration" has to be checked as well, and the firing position group letters should be set ONLY to the firing position group closest to the squad's spawn points.
Once all of this is done, you're ready to simply script in (ai_follow_target_players <ai>) and that's it. It should work.
So, basically, AI following is actually just automatic migrations to the squad that the player is closest to. Edited by Me KS on Aug 8, 2008 at 09:10 PM
|
|
|

DarkZealot
Joined: Jan 1, 2008
Time management: 40% Xbox, 30% PC, 30% Skating
|
Posted: Aug 7, 2008 10:16 PM
Msg. 8 of 19
Quote: --- Original message by: Me KS I came back to say that I found out how to do it by looking at the firing position and squad setup of some encounters on b40, so problem solved.
But, I thought I should say how to do it so that other people don't have to deal with this problem. I've searched these forums, and I personally haven't found any decent explanation of how to do this.
What you do is make small groups of firing positions in the areas where you want the encounter to follow the player to. Each of these groups is then set to a unique firing position group letter, i.e. the first group of firing positions set to 'A', the group nearby set to 'B', the group near 'B' set to 'C', etc. You can make up to 26 of these groups per encounter, since you have letters A-Z to work with. It's best to have the groups linearly arranged from A to Z where possible, so that it's easier to remember which is which.
Then, you make what I call "empty squads" for each letter: each of these squads has no actor type specified, as well as no spawn points, move positions, or spawn settings. All that is specified in these squads is the initial state, return state, and "automatic migration", which HAS to be checked. Automatic migration gives the encounter's actors the freedom to switch from one squad to another at will. This is what lets them follow the player, since now they can move (migrate) to the firing position group's squad that is closest to the player.
Finally, the most important part is to specify the corresponding firing position group letter for each squad for each AI state (attacking, attacking guard, defending, etc.) You should name the squads by which firing position group they belong to, i.e. "squad_a" for the A group.
Once all of this is done, you're ready to simply script in (ai_follow_target_players <ai>) and that's it. It should work.
So, basically, AI following is actually just automatic migrations to the squad that the player is closest to. Oh... well mine followed me, but I never knew that the fact I chose random letters helped. xP Great find though!
|
|
|

Ermac
Joined: Nov 24, 2006
Pops up from time to time
|
Posted: Aug 8, 2008 12:34 AM
Msg. 9 of 19
Excellent work. I've been looking for that for almost two years now. Thank you for finding it.
|
|
|

Dark Ninja
Joined: May 26, 2008
The internet shows how stupid people are.
|
Posted: Aug 8, 2008 12:00 PM
Msg. 10 of 19
It's not working for me. I put the firing positions, made empty squads, gave the squads initial and return state, checked auto migration, and entered the letter of a firing position on the empty rectangles. The script compiled fine, too. The squad that spawns the AI I have auto migration checked, it has an actor variant specified, initial and return state, and the rectangles have all the letters. What did I do wrong?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Aug 8, 2008 09:03 PM
Msg. 11 of 19
Quote: --- Original message by: Dark Ninja It's not working for me. I put the firing positions, made empty squads, gave the squads initial and return state, checked auto migration, and entered the letter of a firing position on the empty rectangles. The script compiled fine, too. The squad that spawns the AI I have auto migration checked, it has an actor variant specified, initial and return state, and the rectangles have all the letters. What did I do wrong? Oh, yeah, I forgot one specific thing. The squad(s) that actually spawn the actors within that same encounter cannot have all of the letters, because then they have no reason to migrate to the empty squads since all of the firing position groups belong to the squad they start in. You can have more than one firing position group for the spawning squads, but I would recommend no more than two for those squads. So, to fix your problem, change the firing position group letters for the squad that spawns the AI to only the firing position group that's closest to their spawn points. I'll edit my original post to add this. Also, you're welcome drillinstructor.
|
|
|

Dark Ninja
Joined: May 26, 2008
The internet shows how stupid people are.
|
Posted: Aug 8, 2008 11:01 PM
Msg. 12 of 19
They spawn in a cliff, a pelican is scripted to drop them off. The first firing position is where the pelican drops, and I only gave them one firing position letter, and didn't specify an actor varient. They move to that group of firing positions, then when I move on, they stay there.
|
|
|

Ermac
Joined: Nov 24, 2006
Pops up from time to time
|
Posted: Aug 9, 2008 01:59 AM
Msg. 13 of 19
I looked at the b40 scenario. I think you do have to specify an actor variant, or else the bipeds won't move because they have no AI at all.
When they had the Marines follow you, all the squads they were set to migrate to had Marine actor variants.
|
|
|

Origin
Joined: Jun 24, 2008
KNEE!!!
|
Posted: Aug 9, 2008 08:48 AM
Msg. 14 of 19
wow great work! this helped me alot!
but one thing comes to mind: how do you script a pelican to fly?
|
|
|

DarkZealot
Joined: Jan 1, 2008
Time management: 40% Xbox, 30% PC, 30% Skating
|
Posted: Aug 9, 2008 09:35 AM
Msg. 15 of 19
Quote: --- Original message by: Origin wow great work! this helped me alot!
but one thing comes to mind: how do you script a pelican to fly? Depends... using Bungie animations or AI (very bad thing unless you are like me who know how to tell them to drive!)?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Aug 9, 2008 11:24 AM
Msg. 16 of 19
Quote: --- Original message by: drillinstructor I looked at the b40 scenario. I think you do have to specify an actor variant, or else the bipeds won't move because they have no AI at all.
When they had the Marines follow you, all the squads they were set to migrate to had Marine actor variants. Although it's true that the campaign had the migrating squads set with an actor variant, I doubt it's needed. I've set this up myself in a different map, and I didn't set the actor variants in the migrating squads, but the following worked out fine. I'm pretty sure of this because once an actor is attached to a biped, it remains attached to it even through migrations to different squads. The actor variant specified in the squads is only there for when actors are to be spawned for that squad.
|
|
|

DarkZealot
Joined: Jan 1, 2008
Time management: 40% Xbox, 30% PC, 30% Skating
|
Posted: Aug 9, 2008 11:25 AM
Msg. 17 of 19
Quote: --- Original message by: Me KSQuote: --- Original message by: drillinstructor I looked at the b40 scenario. I think you do have to specify an actor variant, or else the bipeds won't move because they have no AI at all.
When they had the Marines follow you, all the squads they were set to migrate to had Marine actor variants. Although it's true that the campaign had the migrating squads set with an actor variant, I doubt it's needed. I've set this up myself in a different map, and I didn't set the actor variants in the migrating squads, but the following worked out fine. I'm pretty sure of this because once an actor is attached to a biped, it remains attached to it even through migrations to different squads. The actor variant specified in the squads is only there for when actors are to be spawned for that squad. I'm pretty sure you need a variant for it, like a Marine. Also, Me KS, why aren't you ever on Xfire anymore? D:
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Aug 9, 2008 11:38 AM
Msg. 18 of 19
Quote: --- Original message by: DarkZealot I'm pretty sure you need a variant for it, like a Marine. Also, Me KS, why aren't you ever on Xfire anymore? D: I meant specifically for the squads that are empty and are only used used for the AI to migrate to. You do need an actor variant for the squads that actually spawn the actors. But, if you're saying that the actor variant is needed for the migrating squads, well then I have proof if you want it. My marines don't magically lose their AI every time they try to migrate to follow me. And they do follow me. So, the only conclusion that I can make is that you don't need to specify the actor variant for the migrating squads. Feel free to do so, but I'm sure it doesn't make a difference. Also, Dark Ninja, make sure that the squad that spawns the actors has an actor variant checked. Just double-checking, since they must have had it in order to move to the firing position group once dropped off, as you said. But, are you sure it isn't an issue with path-finding? Remember that AI find their way around maps differently. They will never consider hopping off even the slightest little cliff, and they will never jump up to a different level. This means that they always look for an inclination or a ramp of some sort to go up or down to different height levels. If the AI can't find any of those when they try to follow you, then they won't move. Double-check to make sure that isn't why they don't follow you first.
|
|
|

Dark Ninja
Joined: May 26, 2008
The internet shows how stupid people are.
|
Posted: Aug 9, 2008 11:50 AM
Msg. 19 of 19
One works, the others don't. The one that works and the one that doesn't are both on the same pelican. I used the level a30.
The one that worked had the marine assault rifle actor specified, the ones that didn't had the spartans actor. That might have been the problem, I changed it. Edited by Dark Ninja on Aug 9, 2008 at 11:53 AM
EDIT: Nope, still doesn't work. Marines follow, but odst's and spartans don't. Edited by Dark Ninja on Aug 9, 2008 at 09:52 PM
|
|
|
| |
|
|
 |
|