Jump to content

Luft08

Member
  • Content Count

    87
  • Joined

  • Last visited

  • Medals

Community Reputation

8 Neutral

About Luft08

  • Rank
    Corporal

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Any examples you can provide will be helpful. I modified and used the example provided on the wiki page. To plot the path of the convoy I execute my markPath.sqf code: if(!isServer) exitWith {}; params["_startPos", "_endPos"]; convoyPath = []; (calculatePath ["wheeled_APC","safe",_startPos,_endPos]) addEventHandler ["PathCalculated",{ { private _object = _x; if(_forEachIndex mod 15 == 0) then { private _marker = createMarker ["marker" + str _forEachIndex, _x]; _marker setMarkerType "mil_dot"; _marker setMarkerColor "ColorOrange"; convoyPath pushBack _x; }; } forEach (_this select 1); }]; Here is the test code that calls markPath.sqf: // Mark likely convoy path private _handle = [_posStart, _posEnd] execVM ("LFT_Convoy\markPath.sqf"); waitUntil {scriptDone _handle}; private _point1 = convoyPath select 0; private _point2 = convoyPath select 1; // <<<<<<<<------ Throws a zero divisor error. if(isNil "_point1" ) then { hint "Nil"; // <<<<<<<<-------------- This hint shows up. } else { hint str _point1; }; I would be grateful for any examples of working code. Thanks.
  2. The title says it all. I need to know what direction a vehicle will go when placed on a random road segment with a random road segment as a destination. I think calculatePath might be useful but I don't know how to use the "agent" after I get it.
  3. Well, thanks for your reply. Good Morning (where I am) 🙂
  4. My current convoy function looks like this: if(!isServer) exitWith {}; params["_leadVehicleType", "_endVehicleType", "_vehicleTypeArray", "_convoyStartPos", "_convoyEndPos", "_vehicleCount", "_startDir", "_side", "_maxLeadSpeed", "_vehicleSeparation", "_vehicleStorageArray"]; // create lead escort vehicle private _vehArray = [_convoyStartPos, _startDir, _leadVehicleType, _side] call BIS_fnc_spawnVehicle; _vehicleStorageArray pushBack _vehArray; private _veh = _vehArray select 0; private _leader = effectiveCommander _veh; private _group = _vehArray select 2; _group setFormation "COLUMN"; _veh limitSpeed _maxLeadSpeed; private _wp = _group addWaypoint [_convoyEndPos, 0]; _wp setWaypointBehaviour "SAFE"; _wp setWaypointType "MOVE"; // Create convoy vehicles for "_x" from 1 to _vehicleCount do { private _result = _veh distance _convoyStartPos > 20; sleep 10; private _vehType = selectRandom _vehicleTypeArray; private _vehArray = [_convoyStartPos, _startDir, _vehType, _side] call BIS_fnc_spawnVehicle; _vehicleStorageArray pushBack _vehArray; private _veh = _vehArray select 0; _veh limitSpeed _maxLeadSpeed + 5; {[_x] joinSilent _leader}forEach _vehArray # 1; }; sleep 10; _vehArray = [_convoyStartPos, _startDir, _endVehicleType, _side] call BIS_fnc_spawnVehicle; _vehicleStorageArray pushBack _vehArray; _veh = _vehArray select 0; _veh limitSpeed _maxLeadSpeed + 5; {[_x] joinSilent _leader}forEach _vehArray # 1; { private _veh = _x select 0; _veh setConvoySeparation _vehicleSeparation; } forEach _vehicleStorageArray; If you want to test it create a new mission using the Altis map and launch the convoy using something like: if(!isServer) exitWith {}; activeVehicleArray = []; private _vehicleTypeArray = ["B_Truck_01_ammo_F", "B_Truck_01_box_F", "B_Truck_01_fuel_F", "B_Truck_01_medical_F", "B_Truck_01_Repair_F", "B_Truck_01_covered_F"]; // private _startEscortType = "B_MRAP_01_gmg_F"; private _startEscortType = "B_APC_Wheeled_01_cannon_F"; private _endEscortType = "B_APC_Wheeled_01_cannon_F"; // private _endEscortType = "B_MRAP_01_gmg_F"; private _convoyStartPos = [3626.53,13169.2]; private _convoyEndPos = [14637.4,16771.7]; private _convoyVehicleCount = 8; private _convoyStartDir = 11.689; private _side = west; private _maxLeadSpeed = 15; private _vehicleSeparation = 90; [_startEscortType, _endEscortType, _vehicleTypeArray, _convoyStartPos, _convoyEndPos, _convoyVehicleCount, _convoyStartDir, _side, _maxLeadSpeed, _vehicleSeparation] execVM "launchConvoy.sqf"; I'm currently looking into the calculatePath function to determine which direction to point the vehicles. I think that would be a better way to go than waiting for each vehicle to turn around and move out of the way.
  5. Thanks for taking a look at this but wouldn't the AI controlled vehicle still turn around if say the road connected to the target segment curved around and went the opposite direction? What I'm doing is spawning a convoy one vehicle at a time at the same spawn spot and I need each vehicle to move out of the way before the next vehicle spawns and causes massive destruction. If a vehicle ever takes the time to turn around bad things happen. Since both the starting location and the ending location are random I can never be sure what the AI will do. I think there is some way to query Arma as to the AI path that will be taken but I don't know to get that information. I'm looking at the Bohemia "calculatePath" function but I don't understand how to use it.
  6. I wish to place a vehicle on a road and send it to a random road location far away. I can get the direction of the road via a function: getRoadDir = { params["_roadSeg"]; private _info = getRoadInfo _roadSeg; private _dir = (_info select 6) getDir (_info select 7); _dir }; My problem is that I need the vehicle to always immediately start moving toward its destination without an initial turn around. The "road direction" I want is either what is returned by the function or 180 degrees different and I don't know how to determine that.
  7. I'm making a mission using the GM assets. I want to simulate the cold war experience along the border. There are many guard towers and I have read that many of them were not manned but did have cardboard cutouts to fool people into thinking that they were. Is this true and if so, what percentage were empty? Does anyone know where I can get a picture of the cutouts? Also I know that there were landmines between the inner and outer fences. Can anyone point me to information that will allow me to place minefields in the proper places? Thanks.
  8. Wow, that could make things a lot easier if I can figure out how to make it work when the say3D is wrapped in an remoteExec. Would it be as easy as: _voice = [captain,["Surprise",100, 1]] remoteExec["say3D"]; I'll try it and see. Thanks!
  9. I have a group of friends that play my Arma missions. Some are jokers who will shoot the officer while he is giving the starting briefing. I have disabled damage on the officer so that the starting information (which changes from mission to mission) isn't stopped in the middle of the briefing. However, I would like to prepare a little surprise for the jokers. I have reduced the damage the officer will take by a LOT and when these jokers shoot him I want him to stop talking, pull his gun, say: "Oh, you think that's funny?" ,shoot the joker dead and say "Not laughing now are you chuckles!" I have everything working except I can't stop the officer from completing the say3D command. I read somewhere that you can attach a logic object and use the say3D command on that so that when you want the officer to stop talking you can delete the logic object. I can't seem to get this to work. I named the logic object and used that name in the say3D command but no sound. Can you use say3D with logic objects?
  10. I do have one question. How do you "match up" scopes that are in a different file? Is it something like counting the depth of the nesting? File 1: { // scope 1 _var_1 (Would having the "private" declaration not allow access in File 2, scope 2?) { // scope 2 code } } File 2: { // scope 1 (as in File 1) { // scope 2 (as in file 1) _var_1 from file 1 is visible here. } }
  11. Thanks Larrow, You have been incredibly helpful!
  12. LOL! That sounds like something I would do! 😁 Just tested this and it works!! Thanks!
  13. Ah-Hah!! This I did not know! I will try giving the gunner the waypoint. BTW did you really mean the gunner rather than the commander or driver? It will be interesting to see if the trailing vehicle stays in formation. oops... I just remembered that the addwaypoint command takes a group name. Once the vehicle is added to the convoy wouldn't the group be the same as the original waypoint assignment? So I'm not sure how to add a waypoint to the gunner specifically. Thanks.
  14. Thanks pierremgi, I'll look at your suggestions. I started with the sleep command set to 5 seconds and vehicles started blowing up if the spawned vehicle didn't start moving right away. Maybe I was doing something wrong. The reason I spawn one vehicle at a time and start it moving is pure laziness. 🙂 This was the first solution that worked (not counting the trailing escort vehicle). Thanks again for your suggestions. I didn't even know about setConvoySeparation. (So much to learn...)
  15. Thanks RCA3 but no joy. The vehicle still spawns and just sits there. Adding private to the variables already defined causes my editor to throw an error message (variable already defined in scope). I though that maybe the commander was in a different place in the array based on the vehicle type so I changed my code to use the "effectiveCommander" command but no joy there either. If you create a mission on the Altis map and put an observer at [3618.42,13130.4,0] then create the following files you will see that a blufor convoy is created but the end vehicle sits there but if you change the end escort vehicle type it will follow the convoy (It will or won't depending on the vehicle type): init.sqf: if(!isServer) exitWith {}; [] execVM "launchEastConvoy.sqf"; [] execVM "launchWestConvoy.sqf"; launchEastConvoy.sqf : if(!isServer) exitWith {}; activeVehicleArray = []; maxConvoyLeadSpeed = 15; private _vehicleTypeArray = ["O_Truck_03_device_F", "O_Truck_03_ammo_F", "O_Truck_03_fuel_F", "O_Truck_03_medical_F", "O_Truck_03_covered_F"]; private _startEscortType = "O_MRAP_02_hmg_F"; private _endEscortType = "O_MRAP_02_F"; // <<<<<<< This works okay. private _convoyStartPos = [26867.5,24474.3]; private _convoyEndPos = [14637.4,16771.7]; private _convoyVehicleCount = 3; private _convoyStartDir = 221.218; private _side = east; [_startEscortType, _endEscortType, _vehicleTypeArray, _convoyStartPos, _convoyEndPos, _convoyVehicleCount, _convoyStartDir, _side] execVM "launchConvoy.sqf"; launchWestConvoy.sqf: if(!isServer) exitWith {}; activeVehicleArray = []; maxConvoyLeadSpeed = 15; private _vehicleTypeArray = ["B_Truck_01_ammo_F", "B_Truck_01_box_F", "B_Truck_01_fuel_F", "B_Truck_01_medical_F", "B_Truck_01_Repair_F", "B_Truck_01_covered_F"]; private _startEscortType = "B_MRAP_01_gmg_F"; // private _endEscortType = "B_LSV_01_armed_F"; private _endEscortType = "B_MRAP_01_gmg_F"; private _convoyStartPos = [3626.53,13169.2]; private _convoyEndPos = [14637.4,16771.7]; private _convoyVehicleCount = 3; private _convoyStartDir = 11.689; private _side = west; [_startEscortType, _endEscortType, _vehicleTypeArray, _convoyStartPos, _convoyEndPos, _convoyVehicleCount, _convoyStartDir, _side] execVM "launchConvoy.sqf"; And finally launchConvoy.sqf: if(!isServer) exitWith {}; params["_leadVehicleType", "_endVehicleType", "_vehicleTypeArray", "_convoyStartPos", "_convoyEndPos", "_vehicleCount", "_startDir", "_side"]; // create lead escort vehicle private _vehArray = [_convoyStartPos, _startDir, _leadVehicleType, _side] call BIS_fnc_spawnVehicle; activeVehicleArray pushBack _vehArray; private _veh = _vehArray select 0; private _leader = effectiveCommander _veh; private _group = _vehArray select 2; _group setFormation "COLUMN"; _veh limitSpeed maxConvoyLeadSpeed; private _wp = _group addWaypoint [_convoyEndPos, 0]; _wp setWaypointBehaviour "SAFE"; _wp setWaypointType "MOVE"; // Create convoy vehicles for "_x" from 1 to _vehicleCount do { sleep 10; // Give time for current vehicle to get out of way before spawning next vehicle. private _vehType = selectRandom _vehicleTypeArray; // private _vehType = _vehicleTypeArray call BIS_fnc_selectRandom; private _vehArray = [_convoyStartPos, _startDir, _vehType, _side] call BIS_fnc_spawnVehicle; activeVehicleArray pushBack _vehArray; private _veh = _vehArray select 0; private _vehLeader = effectiveCommander _veh; _veh limitSpeed maxConvoyLeadSpeed + 5; [_vehLeader] joinSilent _leader; }; sleep 10; _vehArray = [_convoyStartPos, _startDir, _endVehicleType, _side] call BIS_fnc_spawnVehicle; activeVehicleArray pushBack _vehArray; _veh = _vehArray select 0; _veh limitSpeed maxConvoyLeadSpeed + 5; private _vehLeader = effectiveCommander _veh; [_vehLeader] joinSilent _leader;
×