Jump to content
Sign in to follow this  
Winters1807

OPFOR searchlights

Recommended Posts

I am having problems gettin the OPFOR units to get on empty search lights, i know they only come with BLUEFOR units, and i was wondering if there is anyway to set the lights as friendly.

At the moment, when i tell the AI to get on the search lights, they just shoot them, any help would be appreciated.

Thanks

Share this post


Link to post
Share on other sites

Make sure they weren't manned by the enemy before you try to get them in, that could often cause them to still see the vehicle as enemy.

Share this post


Link to post
Share on other sites

Put this in the units init line perhaps?

lampgunner1 moveingunner searchli1

where lampgunner1 = the name of your unit who you want to man the gun

and

searchli1 = the name of the search light, when you preview the mission the AI will start manning the searchlight

Share this post


Link to post
Share on other sites

is it possible to put the manned searchlight in a tower?

Share this post


Link to post
Share on other sites

Here's my script, including comments, that will solve all you guy's problems in this thread:

randomwatch.sqs -

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;watch script for searchlights 0.2

;written by Blanco

; SATEXAS 69's NOTES:

; To use for OPFOR:

; Make an empty searchlight, give it a NAME (IE: search1)

;    Searchlight INIT: [this] exec "randomwatch.sqs"

; Add soldier, put this in his INIT:

;    soldier1 moveingunner search1  (where SOLDIER1 is name of soldier and SEARCH1 is light's name)

; Light will run until lens is shot out - man will rotate it until he's killed.

; To put searchlight in a tower/stand, use the "posed" object (may need advanced editor tools to see this)

; To put man in tower, ADD this to his INIT line:

;     this setpos [(getpos this select 0),(getpos this select 1),3.9]

_unit = _this select 0

_dis = 200

#loop

?!alive _unit : exit

_dir = random 360

;hint format ["Bearing is %1 in %2 steps",_dir,_steps]

_steps = random 350 + 10

_steps = _steps - _steps %1

;hint "Heading for a new direction"

~2

_x = 0

_i = -1

_maxheight = 45

_minheight = 2

_inc = -0.2

_height = (5 + random 55)

;hint format ["Pitch = %1",_height]

~1

?random 2 < 1 : _i = 1

?random 2 < 1 : _inc = 0.2

#steps

?!alive gunner _unit : goto "unitdied"

_dir = _dir + _i

?_dir < 0: _dir = _dir +360

?_dir > 360: _dir = _dir -360

_upos = getpos _unit

_cposx = _upos select 0

_cposy = _upos select 1

_cposz = _upos select 2

_height = (_height - _inc)

?(_height > _maxheight) : _inc = 0.2

?(_height < _minheight) : _inc = -0.2

?alive _unit : _unit doWatch [_cposx + ((sin _dir) * _dis), _cposy + ((cos _dir) * _dis),(_height - _inc)]

;hint format ["Bearing is %1\n%2 Steps to go\nPitch is %3",_dir,_steps,(_height - _inc)]

~0.2

_steps = _steps - 1

?_steps > 0 : goto "steps"

goto "loop"

#unitdied

;hint "unitdied"

_gl = "logic" createvehicle [0,0,0]

_gl moveingunner _unit

@!alive _unit

deletevehicle _gl

exit

Share this post


Link to post
Share on other sites

Heres the excellent Searchlight SQS, modded a little to take a max an min dir, ie 300 to 60 would cover the north, it aint perfect but with your help im sure it could be.

Orig script by satexas69

Hope it helps someone like it helped me.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;watch script for searchlights 0.3

;written by Blanco

;modded by Cloughy

_unit = _this select 0

_dirMin = _this select 1

_dirMax = _this select 2

_dis = 200

?_dirMax = 0 && _dirMin = 0: _dirMax = 360

#loop

?!alive _unit : exit

?_dirMin > _dirMax :_dirMax = _dirMax + 360; _dir = (random (_dirMax - _dirMin)) + _dirMin; _steps = random (_dirMax - _dirMin); goto "dirsorted"

?_dirMax > _dirMin : _dir = (random (_dirMax - _dirMin)) + _dirMin; _steps = random (_dirMax - _dirMin)

#dirsorted

?_dir < 0: _dir = _dir +360

?_dir > 360: _dir = _dir -360

;hint format ["Dir: %1",_dir]

_steps = _steps - _steps %1

;hint format ["Dir is %1 in %2 steps",_dir,_steps]

~2

;hint "Heading for a new direction"

_x = 0

_i = -1

_maxheight = 45

_minheight = 2

_inc = -0.2

_height = (2 + random 43)

;hint format ["height = %1",_height]

~1

?random 2 < 1 : _i = 1

?random 2 < 1 : _inc = 0.2

#steps

?!alive gunner _unit : goto "unitdied"

_dir = _dir + _i

?_dir < 0: _dir = _dir +360

?_dir > 360: _dir = _dir -360

_upos = getpos _unit

_cposx = _upos select 0

_cposy = _upos select 1

_cposz = _upos select 2

_height = (_height - _inc)

?(_height > _maxheight) : _inc = 0.2

?(_height < _minheight) : _inc = -0.2

?alive _unit : _unit doWatch [_cposx + ((sin _dir) * _dis), _cposy + ((cos _dir) * _dis),(_height - _inc)]

;hint format ["Direction is %1\n%2 Steps to go\nHeight is %3",_dir,_steps,(_height - _inc)]

~0.2

_steps = _steps - 1

?_steps > 0 : goto "steps"

goto "loop"

#unitdied

;hint "unitdied"

_gl = "logic" createvehicle [0,0,0]

_gl moveingunner _unit

@!alive _unit

deletevehicle _gl

exit

Cheers

GC

Share this post


Link to post
Share on other sites

I've been trying to get working searchlights in ArmA. I tried using this script but it gives me an error "_dirmax=_this |#| select 2".

I don't know enough about scripting to know how to correct it.

Also, will/would it work for MP?

Thanks

Share this post


Link to post
Share on other sites
Quote[/b] ]Here's my script, including comments, that will solve all you guy's problems in this thread:

It´s not your script. Blanco has written it. The only thing you added are the comments and the hint.

This is what I call bad style mad_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]Here's my script, including comments, that will solve all you guy's problems in this thread:

It´s not your script. Blanco has written it. The only thing you added are the comments and the hint.

This is what I call bad style  mad_o.gif

Are you serious? Dude, what part of the script that I posted did you NOT find Blanco's name in?

You can call it bad style and be angry all you want, but you can't read.

Let me assist you some. In the post I posted, it clearly states in the top of the script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;written by Blanco

Sheesh!

Share this post


Link to post
Share on other sites
Quote[/b] ]but you can't read.

Let me assist you some. In the post I posted, it clearly states in the top of the script:

So shouldnt it be :

Here's Blanco´s script , including my comments, that will solve all you guy's problems in this thread

Apart from:

Quote[/b] ]Here's my script, including comments, that will solve all you guy's problems in this thread

huh.gif

I´m simply fed of people promoting others work as their own. Even if you added credit in the script, which you didn´t btw as it was in the original version, by the nature of your post one could think that you have written the script, while you just have added some notes.

You don´t think that the impression arises that you have done the script ?

Quote[/b] ]Orig script by satexas69

No ?

Share this post


Link to post
Share on other sites

I'm a complete noob to mission/script editing and even I didn't get confused about who originally wrote it (thanks Blanco).

I also appreciate that someone took the time to add the extra notes in regards on how they might get it to work ...ala Satexas69. Stuff like that helps us new to editing while doing a Search for relevant information.

So Satexas worded his post wrong, at least he got it right in the "code sample" which IMO is where it really counts.

Anyway, I got the searchlights to somewhat function using GAMELOGIC Triggers and a DoWatch script that I found elsewhere (no, I didn't write and take no credit at all for it).

Share this post


Link to post
Share on other sites

Dear Mr. Balschoiw,

I can't believe you caused a "storm in a teacup" type situation due to your objection the way I worded something while HELPING people.

For god's sakes Mr. Pompous, I didn't advertise it, I didn't boast about my new code - I simply responded in a help thread AND when I made my modifications, I very clearly left the original author INTACT.

Afterall, making sure the original author get's the credit, and thus I'm not "stealing" or "plagerizing" is what REALLY matters.

But here you are, in all your glory, acting like a pompous "" to a guy that HELPS people with their problems in a forum. That's right, HELPING.

Wow.

Share this post


Link to post
Share on other sites
You want to start flaming now ?

That's not flaming sir. Do I need to define that too?

How about you quit being sensitive to the english language on how I'm helping people (and your not) and just go away?

You've now successfully ruined a thread on your silly tirade. Congrats. Way to go! Horray for you!

------

To recap:

People are asking for help with searchlights and searchlights in towers. I HELP by responding with:

"Here's my script...." and give the script with the original author's name intact. To me, I read that as "Here's the one I'm using in all the missions I've created and released to the public" - but you read it as if I was trying to steal credit for some guys work although somehow being stupid enough to leave the author's name as "Written by".

So get off my ass and make yourself useful - by maybe helping people which I was doing before you felt the need to act like this.

Share this post


Link to post
Share on other sites

Take it easy guys here's the author smile_o.gif

satexas69 wrote:

"here's my script..." but the credits are still on top of the script.

He only thing he added are some notes, the debug hints are mine actually.

Imo satexas69 meant with "this is my script" = "This is the script i'm using right now." I believe him.

If he had the intention to steal it, he would remove the credits no?

However, Cloughy who modded the script thought is was satexas69 script and here's Balschoiw right that he created the impression it's his script.

I always say, everybody learns from everybody, only a few here are real geniuses and I'm not one of them. The cos & sin stuff was actually taken from other scripts, because I'm bad in trigometry. tounge2.gif

So I don't blame noone here, it's just a stupid misunderstanding, a slip of the tongue.

Anyway, the script is a port of one of my old OFP searchlights scripts

It's a simplified version tho, because the OFPscript had more features then just moving that lightspot around.

The guy who manned the spot was able to follow a spotted enemy and he could even detect friendly corpses and raise the alarm. When the player runs, walk or crouchwalk through the light within a distance of 150m he will be spotted and followed, but if he goes prone and stays still, he's able to avoid detection. (if this happens farther then 50m from the spotlight)

In OFP it was a M2 MG, because we didn't have a fully working searchlight.

Unfortunate, I don't have that script anymore (a HD crash), but it was my intention to port all these features to Arma, but I don't have the time anymore. I hope someone else will...

Good job Cloughy, people asked me several times to do the same, but again I don't have the time...

I think I have the sqf conversion of the original somewhere, but I can't find it back right now.

Found it, it was Sickboy who did the conversion :

http://www.flashpoint1985.com/cgi-bin....y981183

Share this post


Link to post
Share on other sites

I found that OFP script back deep in the OFPEC archives and I modified it for Arma. It still needs a lot of work, but the searchlight operator can spot and follow the player and you can avoid detection when you go prone and stay still.

Copy/Paste from OFPEC:

Quote[/b] ]

Hi, I improved my searchlight script.

In this version the searchlight operator can spot you when you run through the lightbeam and when he does, he will follow you whereever you are.

You can avoid detection when you go prone and stay still but only when you're farther then 50m and shorter then 200m away from the searchlight.

When you're farther then 200m away, the operator will stop following you and continue his search routine. When you're closer then 50m, the operator will always spot you when he sees you running, walking, crawling,...in the lightbeam.

The spot stays on when the operator dies, but it wont move anymore. The spot turns out when you destroy the lens.

When you're spotted a bolean "detected" become true. Via this bolean you can send reinforcements, reveal the position to the enemy, sync it with a sniper... and so on.

Things to do (if I can)

- Predifined search arc

- I need a line of sight script/function, because the operator can still spot and follow you when you're hiding behind a large building, tree or any other object. I 've already started a topic about this problem

- sqf conversion and simplified code.

If you like the idea and script, feel free to modify.

Demo mission below, no addons needed.

Download Demomission

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  

×