Jump to content
Sign in to follow this  
Carpaazi

Searchlight "gunner" to watch directions?

Recommended Posts

I need AI controlled searchlight to watch a certain direction with something like "setdir" command or so, that can be used via one script to use for other searchlight's aswell.

The reason i'd like this to happen with a direction, intead of "dowatch" command is quite obvious, so i don't need to place 20 objects (watchthis1,watchthis2 etc...), and make 10 different "dowatch" scripts, one for each searchlight AI's =)

anyone got any ideas how to make this happen?

I tried to play around with

unitname setdir number

but unit didn't turn the searchlight with this

Share this post


Link to post
Share on other sites

Unfortunately there's no way of being able to script the command "scan horizon".

But you won't be needing one script per search light.

I made an example mission here.

If you want to use the script in other missions, just copy "SearchlightScan.sqf"

to the root of your mission.

And then in the init of each searchlight write for example:

nil = [this,["M1","M2"],2] execVM "SearchlightScan.sqf";

Where "M1" and "M2" is the names of your markers, you can have how many as you want.

You would need a set of markers per searchlight ofc.

And 2 is the time in seconds for how long the searchlight should wait.

You will have to tweak that number abit, as it begins waiting whilst he swing s the searchlight to the other target.

I have not have time to look into if one could check if the "gunner" is ready, i.e has swung the light to the next target.

This script will work for any unit or vehicle btw.

Edited by Taurus

Share this post


Link to post
Share on other sites

Hello

Trying to get this to work. I copied and pasted exactly whats in your text, created two generic markers named M1, M2 for the light to target back and fourth, But when I try to run the map (Preview as its still a user mission and I havent saved as a mulitplayer mission yet), I get "Script Searchlightscan.sqs not found" and the lights dont move.

Now I did put the "searchlightscan.sqs" into my User mission folder, that I found in my documents.

I think im doing something silly or just dumb....any help? Verteran player from OFP days, just new to scripting events and such in maps..

Thanks

Share this post


Link to post
Share on other sites
Maybe use a mixture of Gamelogics and doWatch?

Could you explain more? I just dont understand what you mean about game logics, and dowatch

Share this post


Link to post
Share on other sites

Let me get back to you regarding this.

Its a matter of the .sqf file not being in the correct place I think.

Have you tested the sample mission, and ran it from the editor?

Share this post


Link to post
Share on other sites
Could you explain more? I just dont understand what you mean about game logics, and dowatch

After a quick test my idea was a failure. :) My idea was to make the search light operator "watch" or look at an invisible object, but he didn't.

Share this post


Link to post
Share on other sites

Your better using setformdir at least I prefer it, the only disadvantage is that it can't look up and down unless it spots an object.

I posted a simple script here.

http://forums.bistudio.com/showthread.php?t=84079

It could use a little more work, rather than turn to the new angle it should pick the angle then move to it more slowly.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Yep, one mention, I think that I found out that "setFormDir" only works for groups, when I have tested, I can't remember.

Now I'm trying to make a guy with binocular to scan horisont, it looks like the direction he watches is very narrow and cant make him rotate while with binoculars... any idea?

Share this post


Link to post
Share on other sites

Ok.

Please verify the location of the script.

It should be in

Windows Vista

%userprofile%\Documents\ArmA 2 <profile>\<player>\missions\<mission name>.<island>

Windows XP

%appdata%\Documents\ArmA 2 <profile>\<player>\missions\<mission name>.<island>

e.g.

...\Taurus\missions\MyMission.utes

Share this post


Link to post
Share on other sites
Yep, one mention, I think that I found out that "setFormDir" only works for groups, when I have tested, I can't remember.

Now I'm trying to make a guy with binocular to scan horisont, it looks like the direction he watches is very narrow and cant make him rotate while with binoculars... any idea?

No setFormDir works fine on a single or even unmanned gun or searchlight, however it won't work with binoculars as far as I can tell.

If you could stop civs diving flat at every sound you could use an invisible one moving around on waypoints with maybe the dowatch command.

Share this post


Link to post
Share on other sites
Ok.

Please verify the location of the script.

It should be in

Windows Vista

%userprofile%\Documents\ArmA 2 <profile>\<player>\missions\<mission name>.<island>

Windows XP

%appdata%\Documents\ArmA 2 <profile>\<player>\missions\<mission name>.<island>

e.g.

...\Taurus\missions\MyMission.utes

WHOA!!!

Yep..that was it..I was putting it in wrong place. Thank you SO MUCH for the help all.

This script is KILLER..it does exactly what I wanted, and adds a great level of realism to my stealth map..highly recommended

Share this post


Link to post
Share on other sites
WHOA!!!

Yep..that was it..I was putting it in wrong place. Thank you SO MUCH for the help all.

This script is KILLER..it does exactly what I wanted, and adds a great level of realism to my stealth map..highly recommended

Still playing with this one.

I have alot of searchlights on the carrier, and im wondering if there is a way to make the markers at a higher altitude, so the lights look up higher...any thoughts?

Is there a way to make the markers higher, or make the searchlights look at a game logic?

Thanks again..

Share this post


Link to post
Share on other sites
still playing with this one.

I have alot of searchlights on the carrier, and im wondering if there is a way to make the markers at a higher altitude, so the lights look up higher...any thoughts?

Is there a way to make the markers higher, or make the searchlights look at a game logic?

Thanks again..

bump!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×