DFBarracks - Forums




Delta Force Barracks Forums - Powered by XMB 1.9.11
Delta Force Barracks Forums
Not logged in [Login ]
Go To Bottom

Printable Version  
Author: Subject: AI folow me
BlackSoldierSLO
Grunt
*




Posts: 3
Registered: 10-2-2005
Member Is Offline


[*] posted on 10-21-2005 at 11:46 PM
AI folow me


I need help. Im making sp map and i want to my AIs folow me.


Could enyone help me?
What i have to use in events menu?
Im using nile.


Sory for my bad english
View user's profile View All Posts By User
Brad.G
DFB Staff
***


Avatar


Posts: 172
Registered: 11-7-2004
Location: Blackpool - UK
Member Is Offline

Mood: Sedated

[*] posted on 10-23-2005 at 01:28 AM


well the event would be

if never() then
ssnmin(xxxx,3)
ssnmax(xxx,200)
ssnatt(xxxx,100)
endif

of course you would have to write that for each AI in your map , or you can use niles little helper to do this.

open your map in niles little helper, and at the top , click on Briefing and wac create.

then select
"create wac scripts" from the list

now you will be greeted with a list of all of the AI in your map. at the bottom you will notice some buttpons you can click on ,

click on "select all"

now you will see

max min att which are faded out in grey. place a tick next to them to make them active ( they will now appear black )

now set the values.

max ... is the maximum distance from what they can see.

min , is the minimum distance they will get to you. so if you set this at 3 , they would stop advancing on you when they were three meters away.

att , is the distance which they would start to attack you. so for example , if you put

max 200
min 3
att 100

then the AI would see you from 200 meters away , he would start to run towards you , but wouldnt shoot at you until he is 100 meters away, and woujld stop approaching you if he managed to get to 3 meters of you.

so now you have set these settings, click on
"set all selected"

you will notice that the values you set have appeared in the columns down the middle of the AI list.

now click on "generate wac script"

a pop up window shall now be displayed saying Success the file has been generated .


it will have genrated the file to the same place where your NPJ file resides... so open thne folder where your NPJ file is, and you shall find a new file , called

yourmapname.WA_

thats not a typing error. like .wac .. but .wa_

open the .wa_ file in notepad, and copy and paste its contents in to the WAC file of your map.

congrats, your AI will now chase after you

Brad G




View user's profile Visit user's homepage View All Posts By User This user has MSN Messenger
Wraith-RD
Private
**




Posts: 21
Registered: 2-24-2005
Member Is Offline


[*] posted on 8-22-2007 at 07:13 AM
How to get AI to follow ANY player


This is a WAC script I have used several times to get AI (friendly or enemy) to follow different players in a map.

PLOOP
if never() and ssnnearssn(player,AI SSN#,5) then
ssn2ssn(SSN#,player)
endif
END

Basically, if (any) Player is within 5 feet of the AI, that AI will follow that player.
If that player dies, that AI will stay attached to that player anyway, and will remain next to his dead body, or, if the player respawns,
will try to move back to that player in the most direct manner possible (straight line if possible... even if it means trying to climb over objects such as barracades)

AI will follow player up or down stairs, but NOT up or down ladders (so far as I can tell). They will also jump off buildings, etc. to reach the player if possible, so be careful.

I have used this in Hostage situations, where the Players needed to lead a friendly to a certain location to accomplish a goal.

I have also used this to have enemy AI move toward the player following a certain trigger;

PLOOP
if never() and (ssnnearssn(player,SSN#,5) and ssndead(SSN#,AI SSN#)) then //Where the player is near an object (target, waypoint, etc.) and an object is destroyed to trigger the event
ssn2ssn(SSN#,player)
endif
END

And the trigger can be anything you want to trigger the event, including target destroyed, player near object or waypoint, etc. Use your imagination.

Hope this helps someone out.

Wraith3d
View user's profile View All Posts By User
> OldMan <
Corporal
***


Avatar


Posts: 193
Registered: 1-26-2005
Member Is Offline


[*] posted on 8-22-2007 at 12:12 PM


what should do a ploop in a single player mission ? simple use for the player the player variable or ssn 10000.

sorry to say that, but your second code is 'crap'
- why should always running the ploop ?
- the ssn go to what player ?

thats coming from not understanding and from copy&past




Freiheit, ist die Freiheit der anders denkenden !
View user's profile View All Posts By User
Wraith-RD
Private
**




Posts: 21
Registered: 2-24-2005
Member Is Offline


[*] posted on 8-23-2007 at 12:21 AM


Answer Number 1;
If I'm stating that the script allows for AI to follow different players in a map, I'm obviously NOT talking about a single player mission. (in which case ssn 10000 would be used instead of PLOOP)

Answer Number 2;
The PLOOP isn't always running, it fires once, at the time the trigger happens.

Answer Number 3;
The SSN (AI) will go to whichever player fulfills the required condition of the trigger

What I believe happened is that I originally posted the second script as:

PLOOP
if never() and ssndead(SSN#,AI SSN#) then //Where an object is destroyed to trigger the event
ssn2ssn(SSN#,player)
endif
END

I had ommitted the condition in the trigger for the player (the one the AI will move toward if all conditions are met) needing to be close to the ssn (or whatever trigger you wish). I have corrected that in the post to reflect that fact. Thank you for pointing that out.




Gun control is being able to hit what you aim at...
View user's profile View All Posts By User
> OldMan <
Corporal
***


Avatar


Posts: 193
Registered: 1-26-2005
Member Is Offline


[*] posted on 8-23-2007 at 02:36 AM


like I said you don't know how it work, that show your answer, but isn't my problem



Freiheit, ist die Freiheit der anders denkenden !
View user's profile View All Posts By User
Wraith-RD
Private
**




Posts: 21
Registered: 2-24-2005
Member Is Offline


[*] posted on 8-23-2007 at 03:44 AM


Oldman.... What exactly do you have a problem with in my script?

I corrected the inadvertent ommission of the first part of the trigger requirements. This code, as it is written now, DOES work in Multi-Player, it has been tested over and over by my squad...... so what specifically do you have a problem with?

Instead of just treating me like an idiot, explain why you think it is wrong.




Gun control is being able to hit what you aim at...
View user's profile View All Posts By User
> OldMan <
Corporal
***


Avatar


Posts: 193
Registered: 1-26-2005
Member Is Offline


[*] posted on 8-23-2007 at 12:38 PM


very simple

1. the post are one year old
2. read the question again !
he did a single player map, so ploop is pointless
Quote:
Im making sp map and i want to my AIs folow me.
3. is the ploop in a condition ?? so the ploop is running all the time (I didn't mean the condition inside)
4. >>it has been tested over and over by my squad<< and then you didn't notice that the AI only follow always the last spawned player ?
5. work and work are two different things.
that also will work, but i don't think its good and anybody should do that

if never and never and never or never then
set(v1,1)
set(v1,1)
set(v1,1)
set(v1,1)
set(v1,1)
if past(5) then
set(v1,1)
endif
endif

all what I want say, its not a good script and it doesn't work like you think, so it isn't to recommend.




Freiheit, ist die Freiheit der anders denkenden !
View user's profile View All Posts By User
Wraith-RD
Private
**




Posts: 21
Registered: 2-24-2005
Member Is Offline


[*] posted on 8-23-2007 at 01:22 PM


Quote:
Originally posted by > OldMan and then you didn't notice that the AI only follow always the last spawned player ?

all what I want say, its not a good script and it doesn't work like you think, so it isn't to recommend.



If what you say is fact, how is it then that in the last map I used this script in, I had friendly AI attach to 5 of the six players in the map, including 1 to me?

If they would only attach to the last spawned player, they wouldn't have attached to me, the Host... and they wouldn't have attached to any of the other people that were playing!

So, though I respect your opinion, that's what it is, an opinion.
The FACT is, the script DOES work.

Now, if someone wants to just take your word for it that the script is "crap" as you say, they have every right to do so.
If they want to try it in their own map to see for themselves whether or not it works, that too is for them to decide.

But don't rag on me about the script being "crap", if you haven't taken the time to try it for yourself.

Last word from me on this...




Gun control is being able to hit what you aim at...
View user's profile View All Posts By User
> OldMan <
Corporal
***


Avatar


Posts: 193
Registered: 1-26-2005
Member Is Offline


[*] posted on 8-27-2007 at 03:28 AM


the big difference between us is, that I can see it by the code and you can't see it by code and try lol.

that script is crap !!! also after your alteration

PLOOP
if never() and ssndead(SSN#,AI SSN#) then //Where an object is destroyed to trigger the event
ssn2ssn(SSN#,player)
endif
END

only that condition say all 'ssndead(SSN#,AI SSN#) ' syntax ? I didn't know you can check two :o
and when you not know what 'never()' mean, then its really bad.

but it make no sense if anyone don't understand what going on and only life from copy&past. I really like that, >> but in my map it work << so be happy with it, like I say isn't my problem and other people will see how it work. I think a blind mapmaker will see that this script never attach 5 players (how), also the first one , so how stupid you think are me or the people. :D god oh god




Freiheit, ist die Freiheit der anders denkenden !
View user's profile View All Posts By User
Legionnaire=M=
Private
**


Avatar


Posts: 89
Registered: 5-11-2004
Location: Yokosuka, JAPAN
Member Is Offline


[*] posted on 8-28-2007 at 09:51 PM


Too maniac.
Me & beginner mappers get the confusion.

Request posting correct example script.
View user's profile View All Posts By User
Wraith-RD
Private
**




Posts: 21
Registered: 2-24-2005
Member Is Offline


[*] posted on 9-11-2007 at 06:20 PM
Map with WORKING script is up....


If anyone wants to see the script and how it works, I have uploaded a new COOP which uses it.

The map name is:
Operation Trinity pt.2

You'll find it under the Joint Ops: IC listings.

It has been tested by several people so far, with no problems (as far as the AI attaching to individual players).

I know this thread was initially intended to discuss getting AI to follow the player in a Single Player game, but it kinda got off to something different along the way, to which I must say sorry.

BTW; No hard feelings Oldman.... I hope you enjoy the map!




Gun control is being able to hit what you aim at...
View user's profile View All Posts By User
> OldMan <
Corporal
***


Avatar


Posts: 193
Registered: 1-26-2005
Member Is Offline


[*] posted on 10-1-2007 at 03:01 AM


you are really funny. for each bot a seperat script lol.
if you have 50 bots the you need 50 ploops and all not closed ! that mean 50 x 5 lines. 250 lines, come on isn't true ? isn't it ?
there I need 3 lines to do that. but have fun with it.
and check your wac, there is some crap in !




Freiheit, ist die Freiheit der anders denkenden !
View user's profile View All Posts By User
Ecalpon
Private
**




Posts: 79
Registered: 5-18-2003
Member Is Offline


[*] posted on 10-1-2007 at 11:43 PM


Simply add the AI to a group, then use gloop.

for example I placed my AI in a group called followme.

gloop followme
ssn2ssn(item,10000)
end
View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.11
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 15] [PHP: 54.5% - SQL: 45.5%]












Copyright © 2002 - 2008 All Rights Reserved - DFBarracks.com
Site Design by A.Bullet - ScreamingDemon.com