Home   Help Search Login Register  

Author Topic: How to force AI "scan horizon"?  (Read 3134 times)

0 Members and 1 Guest are viewing this topic.

McHale

  • Guest
How to force AI "scan horizon"?
« on: 19 Jan 2003, 00:11:57 »
Is it possible? I want to make a spotter for a machine gun nest. Also, would it be possible to force the guy to use binocular? Please help.  :-*

McHale

  • Guest
Re:How to force AI "scan horizon"?
« Reply #1 on: 19 Jan 2003, 06:28:30 »
I found out how to make AI do binoculars, but getting them to scan horizon eludes me :(

Surely one of you freaking geniuses know how to do it?  : ???

Fox2

  • Guest
Re:How to force AI "scan horizon"?
« Reply #2 on: 19 Jan 2003, 20:01:55 »
aP DoWatch "Everyone"?

hehehe

You could make a script, now that I think about it...

Make 4 game logics, named "North1", "South1", "East1", and "West1"

Then...in your script, make a loop...


#loop

<nameofunit> DoWatch (getpos North1)

~10

<nameofunit> DoWatch (getpos East1)

~10

<nameofunit> DoWatch (getpos South1)


~10

<nameofunit> DoWatch (getpos West1)

? (StopWatchin) : exit

goto "loop"


This will make your unit spin about in the space of 40 seconds. Combine this with your binocular command, and he'll scan the horizon in a clockwise manner. Alternatively, if you wanted to just have him watch a certain "cone" of the horizon, just make two game logics and place them where the edge of the cone lies. He'll look between the two points, going back and forth. Try messing around with the delay I put there ("~10") until it suits your needs.

Also, I put that IF statement there at the bottom of the script so if you wanted him to stop looking around (such as when he sees an enemy), just set StopWatchin to true.

McHale

  • Guest
Re:How to force AI "scan horizon"?
« Reply #3 on: 19 Jan 2003, 23:37:54 »
I found an easier  way:

heading = random 360;
soldier_guy setFormDir heading;

Just need to put that on a trigger that cycles every 5 seconds. Thanks.



teeBore

  • Guest
Re:How to force AI "scan horizon"?
« Reply #4 on: 05 Feb 2003, 15:55:45 »
I found out how to make AI do binoculars, but getting them to scan horizon eludes me :(

Heh well finding out how to make AI do binoculars eludes me, so do you think you could help me out?

Surely one of you freaking geniuses know how to do it?  : ???

General Goober

  • Guest
Re:How to force AI "scan horizon"?
« Reply #5 on: 06 Feb 2003, 07:39:42 »
Would someone like to post here an *.sqm script so everyone knows how you guys did this.  As a newbie I have had difficulty working it out the way it was explained here.  Would appreciate any help on this. thanks

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to force AI "scan horizon"?
« Reply #6 on: 06 Feb 2003, 14:42:28 »
General Goober, just keep working your way through the Ed Depot tutorials in Getting Started and References  :)    If you see a command you don't understand, look it up in both the official and unofficial command references.       If you haven't already done it, you must read snYpir's excellent "OFPEC Guide: Mission Editing" and follow the advice it contains.   ;)
Plenty of reviewed ArmA missions for you to play

General Goober

  • Guest
Re:How to force AI "scan horizon"?
« Reply #7 on: 06 Feb 2003, 15:02:08 »
Thanks for that I spent a great deal of time today going through everything I could get my hands on.  Script I found sorted everything out for me.

General Goober

  • Guest
Re:How to force AI "scan horizon"?
« Reply #8 on: 07 Feb 2003, 01:12:54 »
McHale,

 how do you get those binos to work?  If you also now know how to constantly cycle scanning the horizon. I would also appreciate it. thanks


McHale

  • Guest
Re:How to force AI "scan horizon"?
« Reply #9 on: 07 Feb 2003, 03:31:30 »
teeBore: yeah I figured it out myself after I asked the question

I don't think the binoculars increase the AI's line of sight, so there's no point working out how to script it. Although you'd use "playmode"? if that helps.

Anyway the SQS file should go like this:


#start

nameOfGuy setFormDir random 360;

~6

goto "start"



Save that as an SQS file(in the mission's folder). and put the following string into the initialization field of one of your objects in the editor

[]exec "nameOfFile.sqs"


Thats how i did it anyway
« Last Edit: 07 Feb 2003, 03:36:36 by McHale »

General Goober

  • Guest
Re:How to force AI "scan horizon"?
« Reply #10 on: 07 Feb 2003, 05:45:01 »
Without looking at this yet.  Does the unit keep looking through the binos.  I only seem to get him to look once and put them away.

For example, I used at waypoints. (only way I could get it to work)

man1 switchmove "binoctocombat"
others I used were "standtobinocstand"

Can you put some time limit on it?

teeBore

  • Guest
Re:How to force AI "scan horizon"?
« Reply #11 on: 07 Feb 2003, 06:32:59 »
teeBore: yeah I figured it out myself after I asked the question

I don't think the binoculars increase the AI's line of sight, so there's no point working out how to script it. Although you'd use "playmode"? if that helps.

Anyway the SQS file should go like this:


#start

nameOfGuy setFormDir random 360;

~6

goto "start"



Save that as an SQS file(in the mission's folder). and put the following string into the initialization field of one of your objects in the editor

[]exec "nameOfFile.sqs"


Thats how i did it anyway

Im not sure you quite understand what I mean, (no offense), I basically was asking what General Goober was asking in the post just before this one.