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?
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)
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)
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 ? ).
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 ;)
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???
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.
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;
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