Home   Help Search Login Register  

Author Topic: AI  (Read 874 times)

0 Members and 1 Guest are viewing this topic.

Sol Fire

  • Guest
AI
« on: 28 Jan 2003, 04:34:41 »
is there a way to make AI to run around a map Randomly

i want to make a Hunting mission where a AI runs around the map Randomly so it never goes the same way all the time like it will with Waypoints

that way its a challenge to find the AI all the time

dont know if its possible but if so can someone please tell me how?

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:AI
« Reply #1 on: 28 Jan 2003, 05:09:54 »
Hi,

basicallly it can be done by this script:
(of course a lot of features can be included but i want to keep it easy)

; get the target of the script
_Prey = this select 0

#Loop
; set the "waypoint" in a 250m radius
_Prey doMove [xpos + ((random 500) -250),  zpos+ ((random 500) -250)]
; wait 30 seconds
~30
; next "waypoint"
goto "Loop"


The Script should be called by [Soldier] exec "This-script.sqs"

Greetings Kuro

Sol Fire

  • Guest
Re:AI
« Reply #2 on: 28 Jan 2003, 05:57:38 »
thanks Kuro.. i'll try it out

what kind of "Features" were you talking about though?

Sol Fire

  • Guest
Re:AI
« Reply #3 on: 28 Jan 2003, 07:14:12 »
could you gimme a "Walkthrough" on how to set this up? (make the script etc....) cause i get a error on the top of the screen when i preview and the guy just sits in the same spot i put him

Liquid_Silence

  • Guest
Re:AI
« Reply #4 on: 28 Jan 2003, 13:35:28 »
here's an edited version of his script that should work:

Code: [Select]
_prey = _this select 0

#loop
_pPos = getPos _prey
_prey doMove [(pPos select 0) + (random 500) - 250,  (pPos select 1) + (random 500) - 250]
~5
if (alive soldier) then {goto "loop"}

Jester

  • Guest
Re:AI
« Reply #5 on: 28 Jan 2003, 16:28:32 »
Could you just make the placement radius 550 x 550 and that way he will never really start the game in the same place twice. I do that with my Snipe Hunt mission so when I play it SP I really never know where he is. Just a thought. CHEERS ;D

Silver Fox

  • Guest
Re:AI
« Reply #6 on: 28 Jan 2003, 18:29:07 »
Yeah but if he wants his guy to run around he's just gonna go to the first waypoint  then the second etc etc etc.

I recommend you use the script above by Liquid_Silence

Look like it should do it  ;)
« Last Edit: 28 Jan 2003, 18:29:38 by Silver Fox »

Sol Fire

  • Guest
Re:AI
« Reply #7 on: 29 Jan 2003, 00:10:28 »
thanks guys this will really help me with the mission cause if i had to resort to Waypoinst it wouldnt be fun cause all i have to do is go where i set a Waypoint and wait for him.. with this all i know is where the AI starts off but with me starting at the bottom of the map i have to walk around so i will never know where he went by the time i get to where he starts at so this will be a challenge for hunting him down

thanks again :'( im so overwhelmed with tears im so happy... lol


Jester

  • Guest
Re:AI
« Reply #8 on: 29 Jan 2003, 01:56:58 »
Whats cool is that if you use that script along with the radius and use the dotarget for the sniper it might make a rather awesome STEALTH snipe VS. Snipe mission.

4 on 4         on a remote wooded area. Just a thought......... :o

Tom Berenger Beware !
« Last Edit: 29 Jan 2003, 01:58:34 by Jester »

Sol Fire

  • Guest
Re:AI
« Reply #9 on: 29 Jan 2003, 08:39:46 »
im trying to make a COOP hunting mission where you have to walk around the map hunting down an AI that moves along Randomly wich means he can even come up behind you if your not careful..still having trouble with the script though

i make it and put it in the folder where my mission.sqm is but when i have the soldier activate it he just stands around not doing what the script should be making him so i try getting a trigger to activate it or a waypoint to activate the script and he still stands in one place like the script isnt even activating or it activates but i get an error

i have the script in the right spot.. how should i try activating it cause i cant get it to work

hope someone can tell me i really need to know

Liquid_Silence

  • Guest
Re:AI
« Reply #10 on: 29 Jan 2003, 11:59:49 »
I'll make an example mission for you since I'm bored ;D be back soon...

EDIT: Uh, I'll just past the fixed script instead (a couple of stupid little mistakes :) )

Code: [Select]
_prey = _this select 0

#loop
_pPos = getPos _prey
_prey doMove [(_pPos select 0) + (random 500) - 250,  (_pPos select 1) + (random 500) - 250]
@ unitReady _prey
~5
if (alive _prey) then {goto "loop"}

Just copy and paste to an sqs file then exec that sqs file using the name of the prey as an argument...

« Last Edit: 29 Jan 2003, 13:19:41 by Liquid_Silence »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI
« Reply #11 on: 29 Jan 2003, 14:26:54 »
You could achieve a random effect without scripts.

1) as has already been suggested give the AI moron a placement radius equal to the size of the map (or the area you want)

2)  give each of his waypoints a placement radius equal to the size of the map

3) make the last waypoint CYCLE so that he keeps moving if you don't find him  ;)

You won't know where he started or where his waypoints are.  That should do the trick.
Plenty of reviewed ArmA missions for you to play

Sol Fire

  • Guest
Re:AI
« Reply #12 on: 30 Jan 2003, 22:54:13 »
thanks guys i have it working now