Forum Jump :

Author Message


Posts: 40
Rank:


Level: Member

Country: yu
Location:
Occupation: Mika666
Age:
In-game name:

 
#16 Posted at 2009-07-23 15:06        
     
Thanks again. :) Hey,do you know how to create empty unlocked vehicle on the marker? ( I know...this is other topic :D,but you help me so much). I try ( Code: LAV25="LAV25" createVehicle getMarkerPos "MARK1" ;LAV25 lock false ; ) but is still locked.What should I to do?


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#17 Posted at 2009-07-24 00:23        
     
Your code is fine but it does seem to take about 15secs for it to unlock. I have no idea why.

If you need instant access why not spawn it somewhere else a few seconds earlier and move it or just place an empty one somewhere else on the map and then move it to the location when needed.


Edit.
I've just seen another post about this and If you add
group player reveal lav25 
or
player reveal lav25
it works instantly.
This problem only seems to happen if a vehicle is created later in the game, if it's done in a gamelogic at the start it doesn't seem to happen.

This post was edited by F2kSel (2009-07-24 12:16, ago)


Advertisement


Author Message


Posts: 40
Rank:


Level: Member

Country: yu
Location:
Occupation: Mika666
Age:
In-game name:

 
#18 Posted at 2009-07-24 17:18        
     
F2kSel : ... or just place an empty one somewhere else on the map and then move it to the location when needed.


Hmmm....good idea.:satisfied What is the CODE fore that(for moving object or units from one place to another)?
P.S. Thanks by the way, it's work with ( player reveal LAV25 ):D

This post was edited by Mika666 (2009-07-24 17:38, ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#19 Posted at 2009-07-24 18:09        
     
If using a marker using name "mark1"

LAV25 setpos getmarkerPos  "mark1" ;

Or game logic using name "logic1"

LAV25 setpos getPos logic1;


Nothing to it really.


Author Message


Posts: 40
Rank:


Level: Member

Country: yu
Location:
Occupation: Mika666
Age:
In-game name:

 
#20 Posted at 2009-07-25 11:47        
     
Thanks,you help me so much.Now I can finish my missions.:)
P.S. If you have time, see my other topics ( How to create Big smoke from the object ?,Helicopter carrying tank on the rope,then rope down the tank ?, How to create random explosion effect on the battlefield ? ).


Author Message


Posts: 10
Rank:


Level: Member

Country: pl
Location: Pruszków
Occupation:
Age: 28
In-game name:

 
#21 Posted at 2010-01-22 11:48        
     
This is mine config for searchlights on choppers, just create heli and static object searchlight and name it as you like (don't forget to change names in that lines), and add it to veh init line ;)

For UH-1Y:
light enableSimulation false; light attachTo [chopp,[0,-3.3,-0.5]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]]

For MH-60s:
light enableSimulation false; light attachTo [chopp,[0,5,-0.9]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]]

For MI-8MT/MI-8MTV3/MI17:
light enableSimulation false; light attachTo [chopp,[0,6.5,-1.2]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]]

For AH-1Z:
light enableSimulation false; light attachTo [chopp,[0,3.7,-0.2]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]]

For Ka-52:
light enableSimulation false; light attachTo [chopp,[0,3.7,-0.7]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]]

Attention!!! This is look so weird when you are in chopper with attached light (you can see legs on glass, or can't see nothing). Enjoy :)


Author Message


Posts: 4
Rank:


Level: Member

Country: cn
Location:
Occupation:
Age:
In-game name:

 
#22 Posted at 2010-09-29 21:46        
     
ineed sime help this is what i did,
1. usmc/air/MH-60s = player
2. static/searchlight - playable
3.in put this - light enableSimulation false; light attachTo [chopp,[0,5,-0.9]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1, 0]] in the int of the search light.
4 im i doing this right???


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#23 Posted at 2010-09-29 22:30        
     
Your doing it right it should work. I just copied the above into an init and named the chopper chopp and the searchlight light and it worked.


Author Message


Posts: 4
Rank:


Level: Member

Country: cn
Location:
Occupation:
Age:
In-game name:

 
#24 Posted at 2010-09-29 22:59        
     
ohh thanks! anyway i can make it so it can move?


Author Message

VIPER[CWW]  

I'm a stable whore


Posts: 2126
Rank:


Level: Member

Country: en
Location:
Occupation:
Age: 28
In-game name: VIPER [RR]

 
#25 Posted at 2010-09-29 23:02        
     
There is a super easy way of enabling the searchlight on helo's that have them (mostly all i think) and thats by giving them the "SAFE" Behaviour Mode


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#26 Posted at 2010-09-30 00:39        
     
The problem with SetBehaviour "safe" is that the aircraft won't open fire on the enemy in safe mode.

You could move the light but it would involve some script, you would have to use setdir in some sort of loop.

Setformdir would be a better command but it won't work if you use enablesimulation false and without it operator falls to the ground.



I prefer to use
 player action ["lightOn", light];light attachTo [chopp,[0,5,-0.9]]; light setVectorDirAndUp [[0, 1.9, -1],[0, -1,0]]  
as that avoids having to have an operator. This allso allows you to turn the light off
player action ["lightOff", light]


Author Message


Posts: 4
Rank:


Level: Member

Country: cn
Location:
Occupation:
Age:
In-game name:

 
#27 Posted at 2010-09-30 21:27        
     
wounder if i could switch the mg in put a light right their

This post was edited by bikepartol (2010-09-30 22:14, ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#28 Posted at 2010-10-01 01:50        
     
You could ask in the addon section as it's more their field.

You can attach the search light to a gun but it only really works with soldiers not fixed guns which is a pity. I should say it will attach but not turn unlike when it's attached to a soldier, nor will they change elevation which would also be needed.


Author Message


Posts: 1
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#29 Posted at 2016-11-09 07:58        
     
Hi Everyone,

Similar and building on posts above using attachTo, I eventually discovered that the remote controlled drone (AR-2 Darter) is ideal for this purpose as its light is very similar to, for example, the Pawnee search light. It is also very small and so can be virtually hidden in the body of the Pawnee etc. So this is the resulting code:

(I created a script called YB_enemyHeliSearchLight.sqf containing the following code and then put it in mission root direcotry and then executed it using: null = _enemyHeliDriver execVM "YB_enemyHeliSearchLight.sqf"; where a driver / pilot of an enemy (i.e. AI) helicopter (of Pawnee body type) has been made equal to _enemyHeliDriver):

if (isServer) then
	{	private ["_driver", "_enHeli"];
		//Prepare variables:
		_driver = _this;
		_enHeli = vehicle _this;

		while {sleep 60; true} do
			{
				//Wait until it is night time:
				waitUntil {sleep 30; (dayTime > 20 || dayTime < 4)};

				//Create "search light" (UAV) and attach it to the helicopter:	
				_uav = "B_UAV_01_F" createVehicle getPos _enHeli; 
				_uav attachTo [_enHeli, [0,1.5,-0.5]]; _uav setVectorUp [0, 0.5, 1];	
				
				//Wait until helicopter takes off:
				waitUntil {sleep random 30; (getPosATL _enHeli select 2) > 5};
					
				//If still night time, turn the search light on:
				if (dayTime > 18 || dayTime < 7) then
					{
						_driver action ["lightOn", _uav];
					};
						
				//Wait until helicopter lands, is destroyed, or it is day time:
				waitUntil {sleep 3; (getPosATL _enHeli select 2) < 5 || damage _enHeli == 1 || (dayTime < 20 && dayTime > 4)};
				
				//Delete search light:
				_driver action ["lightOff", _uav];
				deleteVehicle _uav;
				
				//Rinse, repeat via the while-do loop, in case helicopter takes off again / it becomes night again etc.		
			};
	};

Hope this helps.

Cheers from Far North Queensland, Australia

PS: If you want this enemy helicopter to "stalk" / "hunt" a player, you can set a way point such as this on a regular basis:

//NB: curTargP1 needs to be first set as a player you are wanting the helicopter to pursue
//NB: _driver needs to be first set as the enemy (AI) unit piloting the helicopter

curTargPos = [	((getPos curTargP1 select 0) + (_enSpreadDist - (random _enSpreadDist * 2))), 
		((getPos curTargP1 select 1) + (_enSpreadDist - (random _enSpreadDist * 2))), 
		(getPos curTargP1 select 2)];	
			
deleteWaypoint [group _driver, 0]; //Ensure previous waypoint deleted
_heliWaypoint = group _driver addWaypoint [curTargPos, 0, 0];
_heliWaypoint setWaypointType "LOITER";
_heliWaypoint setWaypointLoiterType "CIRCLE_S";
_heliWaypoint setWaypointLoiterRadius 100;
//Make sure helicopter moves slowly and scarily!:
_heliWaypoint setWaypointSpeed "LIMITED";
_heliWaypoint setWaypointBehaviour "COMBAT";
_heliWaypoint setWaypointCombatMode "RED";
group _driver setCurrentWaypoint _heliWaypoint;


Author Message

W0lle  

call me evil


Posts: 1944
Rank:


Country: de
Location:
Occupation: CWR² Project Lead
Age: 101
In-game name:

 
#30 Posted at 2016-11-09 19:20        
     
It's good to see people still help each other here, but your example is pretty much pointless because this section is for ArmA2, while at least some of your commands work only in Alpha 3 like

_heliWaypoint setWaypointType "LOITER";
_heliWaypoint setWaypointLoiterType "CIRCLE_S";
_heliWaypoint setWaypointLoiterRadius 100;

There's also no "B_UAV_01_F" in ArmA2.