Jump to content
Sign in to follow this  
5urge

getting an alarm to work with a searchlight

Recommended Posts

i have a fantastic serchlight script that scans the adjacent direction for blue force (my side being russian).

whena blue force rifleman or other unit for that matter goes into the light cone of the searchlight the searchlight then tracks the unit. what i want it to make a trigger so when the opfor detects the blue force with its light i want an alarm to go off any ideas please ?

Share this post


Link to post
Share on other sites

Hi. Can you post that script? If it does what you claim it does, it might be easy enough to insert a few extra line of code into it.

Share this post


Link to post
Share on other sites
Hi. Can you post that script? If it does what you claim it does, it might be easy enough to insert a few extra line of code into it.

script is here played with the values so it looks good in game

i have 3 variable search scripts all differing in speed

_unit = _this select 0;

_left = _this select 1;

_right = _this select 2;

_dir = (getDir _Unit);

#Start

? !(alive _unit) : exit;

~0.1

_dir = _dir +0.5;

_unit setFormDir _dir;

?(_dir > _right) : goto "Next"

goto "Start"

#Next

? !(alive _unit) : exit;

~0.1

_dir = _dir -0.5;

_unit setFormDir _dir;

?(_dir < _left) : goto "Start";

goto "Next"

---------- Post added at 08:07 PM ---------- Previous post was at 08:05 PM ----------

basicly scans left and right speed of 0.5

problem i have is when it detects blue for as this is an opfor searchlight it tries to continue to scan left and right but correcting itself on the enemy

need help on this too lol

Share this post


Link to post
Share on other sites

You could try getting the light's assignedTarget. If it has one, and if it's an enemy, etc... trigger the alarm.

Share this post


Link to post
Share on other sites
You could try getting the light's assignedTarget. If it has one, and if it's an enemy, etc... trigger the alarm.

i have no clue what your on about lol sorry

---------- Post added at 20:35 ---------- Previous post was at 20:15 ----------

how would i enhance this script with the light effectivley following the enemy (exacly like a normal searchlight without any script, and use the alarm function ?)

Share this post


Link to post
Share on other sites

I think if you made a trigger over the area covered by the light and used the detected by command, that may work. There's also the "knowsabout" command which I haven't used yet.

I use a similar script to the one posted to move the searchlight but it's more random and also works with the Static Machine gunner.

The advantage of using setformdir for a Machine Gunner over using a target gamelogic is that it the unit is still free to choose it's own target and will open fire as normal. I think your problem is that it is continually being told to move.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

In the 3d editor i noticed that you can add the alarm sound effects from the sound source... is it possible to do the same in the normal 2d editor? i can't find any way to do so...

Unfortunately i can't load my mission into the 3d editor since i started it on the normal editor a few days ago... ?

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  

×