View Full Version : getting an alarm to work with a searchlight
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 ?
Big Dawg KS
Jul 29 2009, 18:52
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.
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
Big Dawg KS
Jul 29 2009, 19:11
You could try getting the light's assignedTarget. If it has one, and if it's an enemy, etc... trigger the alarm.
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 ?)
F2k Sel
Jul 30 2009, 13:53
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.
Cossack8559
Aug 7 2009, 00:43
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... ?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.