-
Content Count
17 -
Joined
-
Last visited
-
Medals
-
JTK HALO Script by Kempco
louderthanu replied to Kempco's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
No, it is a multiplayer "sandbox" mission that incorporates friendly ai. Guess this fine set of scripts isn't going to work in my case. Thanks! TAW_louderthanu -
JTK HALO Script by Kempco
louderthanu replied to Kempco's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Love your script- great cut-scenes! On a dedicated server with v1.6- NO ACE, NO OPTIONAL ADD-ONS: 1. When a player has ai units in thier group that were spawned in and joined to the player's group after mission start- they are NOT automatically boarded onto the C130 when the player gets in. 2. The "reset" still does not function for me (v1.6). After clicking trough the dialog, the C130J engines continue to run, the pilot remains in the a/c moving the rudder back and forth. The arrows disappear and the ramp closes however. After a "reset" the "Configure" addaction never re-appears., even after leaving the trigger area and coming back. There was this error in the server's rpt log: 2013/02/24, 13:49:57 Error in expression <; sleep 0.5; }; }; [_aircraft,_static,JTK_HALO_Helper_Arrows] spawn { _aircraf> Error position: <JTK_HALO_Helper_Arrows] spawn { _aircraf> Error Undefined variable in expression: jtk_halo_helper_arrows There was no relevant error in the client's .rpt file Thank you for your hard work and help with these issues! TAW_louderthanu -
AI Piloted Helicopter And MoveTo Command
louderthanu replied to louderthanu's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Anyone? -
AI Piloted Helicopter And MoveTo Command
louderthanu replied to louderthanu's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sure! There is "dead" code in there, but you'll get the idea: _pos = [0,0,0]; _lzPos = [0,0,0]; _lzIP = [0,0,0]; _playerPos = [0,0,0]; _vehPos = [0,0,0]; _heliSpawn = [0,0,0]; _crewSpawn = [0,0,0]; _grp = objNull; _puTrig = 0; _distance1 = 0; _distance2 = 0; _destroyed = 0; _dead = 0; _canceled = 0; fnc_airLift = { _canceled = 0; _destroyed = 0; _dead = 0; _player = _this select 0; _lzPos = _this select 1; _playerPos = getPos vehicle player; _heliSpawn = getMarkerPos "airdrop_spawn"; _crewSpawn = [(_heliSpawn select 0)+5, (_heliSpawn select 1)+5, 0]; _heliType = "CH_47F_EP1"; _crewType = "USMC_Soldier_Pilot"; //map marker _lzmarker = createMarker ["lzmarker", _lzPos]; _lzmarker setMarkerShape "ICON"; "lzmarker" setMarkerType "hd_destroy"; "lzmarker" setMarkerText "Airlift LZ"; "lzmarker" setMarkerColor "ColorOrange"; //spawn lift chopper crew _grp = creategroup WEST; _pilot1 = _grp createUnit [_crewType, _crewSpawn, [], 0, "FORM"]; _pilot1 setRank "LIEUTENANT"; _gunner1 = _grp createUnit [_crewType, _crewSpawn, [], 0, "FORM"]; _gunner2 = _grp createUnit [_crewType, _crewSpawn, [], 0, "FORM"]; _gunner3 = _grp createUnit [_crewType, _crewSpawn, [], 0, "FORM"]; { _x addEventHandler ["killed", {handle = [_this select 0] execVM "data\scripts\bury.sqf"}]; } foreach units _grp; //spawn lift chopper _heli = createVehicle [_heliType, _heliSpawn, [], 0, "FLY"]; _heli allowDamage false; _pilot1 moveindriver _heli; _pilot1 setCaptive true; _pilot1 allowDamage false; _pilot1 setRank "LIEUTENANT"; _gunner1 MoveInTurret [_heli,[0]]; _gunner2 MoveInTurret [_heli,[1]]; _gunner3 MoveInTurret [_heli,[2]]; _gunner1 allowDamage false; _gunner2 allowDamage false; _gunner3 allowDamage false; //lift chopper map marker _sumark = [_heli] execVM "scripts\loud\loudAirlift\loudAirlift_HeliMarker.sqf"; _grp setBehaviour "CARELESS"; _grp setCombatMode "GREEN"; //hold fire, defend only; _heli engineOn true; _heli flyInHeight 75; _veh = vehicle player; _vehPos = getPos vehicle player; _ip = [(_vehPos select 0)-500, (_vehPos select 1)-500, 0]; _pilot1 doMove _ip; //disable vehicle //_veh setFuel 0; //_veh lock true; //**** from spawn to ip for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do { _distance1 = (position _heli) distance (getPos vehicle player); if (_distance1 >= 600) then { hintSilent parseText format["<t color='#e5b348'>Airlift:</t> Lift Chopper is %1m from pickup lz!<br/><br/><t color='#ff0000'>DO NOT LEAVE YOUR VEHICLE!!!</t>", round((position _heli) distance (getPos vehicle player))]; }; if (_distance1 <= 600) then {_rloop=1;}; if (vehicle player == player) then {_canceled = 1;_rloop=1;}; if (!alive _heli || !alive _pilot1) then {_destroyed = 1;_rloop=1;}; if (!alive player) then {_dead = 1;_rloop=1;}; }; if (_canceled == 1) then {[] call fnc_cancelAirlift}; if (_destroyed == 1) then {[] call fnc_heliDead}; if (_dead == 1) then {[] call fnc_playerDead}; //update position _vehPos = getPos vehicle player; if (_canceled == 0) then { //pop smoke _k = "SmokeShellGreen" createVehicle _vehPos; _k setPos (getPos _veh); _k attachTo [_veh,[0,0,0.2]]; }; // go to pickup _heli limitSpeed 40; _pickup = [(_vehPos select 0), (_vehPos select 1), 0]; _heli flyInHeight 40; _pilot1 doMove _pickup; //**** from ip to pickup for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do { _distance1 = (position _heli) distance (getPos vehicle player); if (_distance1 >= 125 && speed _heli > 1) then { hintSilent parseText format["<t color='#e5b348'>Airlift:</t> Lift Chopper is %1m from pickup lz!<br/><br/><t color='#ff0000'>DO NOT LEAVE YOUR VEHICLE!!!</t>", round((position _heli) distance (getPos vehicle player))]; }; if (_distance1 <= 125) then {_rloop=1;}; if (vehicle player == player) then {_canceled = 1;_rloop=1;}; if (!alive _heli || !alive _pilot1) then {_destroyed = 1;_rloop=1;}; if (!alive player) then {_dead = 1;_rloop=1;}; }; if (_canceled == 1) then {[] call fnc_cancelAirlift}; if (_destroyed == 1) then {[] call fnc_heliDead}; if (_dead == 1) then {[] call fnc_playerDead}; if (_canceled == 0) then { //pick up vehicle _veh allowdamage false; _veh attachTo [_heli,[0,0,-10]]; _veh setDir 360; _veh setPos getPos _veh; if (alive _k) then {deleteVehicle _k}; }; //go to lz_ip _lzIP = [(_lzPos select 0)-500,(_lzPos select 1)-500,0]; _heli flyInHeight 75; _pilot1 doMove _lzIP; //**** from pickup to lz for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do { _distance1 = (position _heli) distance (_lzPos); if (_distance1 >= 600) then { hintSilent parseText format["<t color='#e5b348'>Airlift:</t> Lift Chopper is %1m from dropoff lz", round((position _heli) distance _lzPos)]; }; if (_distance1 <= 600) then {_rloop=1;}; if (vehicle player == player) then {_canceled = 1;_rloop=1;}; if (!alive _heli || !alive _pilot1) then {_destroyed = 1;_rloop=1;}; if (!alive player) then {_dead = 1;_rloop=1;}; }; if (_canceled == 1) then {[] call fnc_cancelAirlift}; if (_destroyed == 1) then {[] call fnc_heliDead}; if (_dead == 1) then {[] call fnc_playerDead}; if (_canceled == 0) then { //pop smoke at lz _k2 = "SmokeShellRed" createVehicle _lzPos; _k2 setPos (_lzPos); }; //go to lz _heli limitSpeed 40; _heli flyInHeight 40; _pilot1 doMove _lzPos; //**** from lz_ip to dropoff for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do { _distance1 = (position _heli) distance (_lzPos); if (_distance1 >= 125) then { hintSilent parseText format["<t color='#e5b348'>Airlift:</t> Lift Chopper is %1m from release", round((position _heli) distance _lzPos)]; }; if (_distance1 <= 125 && speed _heli > 1) then {_rloop=1;}; if (vehicle player == player) then {_canceled = 1;_rloop=1;}; if (!alive _heli || !alive _pilot1) then {_destroyed = 1;_rloop=1;}; if (!alive player) then {_dead = 1;_rloop=1;}; }; if (_canceled == 1) then {[] call fnc_cancelAirlift}; if (_destroyed == 1) then {[] call fnc_heliDead}; if (_dead == 1) then {[] call fnc_playerDead}; if (_canceled == 0) then { //release vehicle detach _veh; _veh setPos [_lzPos select 0, _lzPos select 1, 0]; _veh setVelocity [0,0,0]; sleep 1; _veh allowDamage true; _veh setFuel 1; _veh engineOn true; _veh lock false; sleep 1; }; //go to end mark _heli flyInHeight 150; _pilot1 doMove _heliSpawn; //**** from dropoff to ending for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do { _distance1 = (position _heli) distance (_heliSpawn); _distance2 = (position _heli) distance (vehicle player); if (_distance1 >= 500) then { hintSilent parseText format["<t color='#e5b348'>Airlift:</t> Lift Chopper is %1m from base", round((position _heli) distance _heliSpawn)]; }; if (_distance1 <= 500 || _distance2 >= 1500) then {_rloop=1;}; if (!alive _heli || !alive _pilot1) then {_destroyed = 1;_rloop=1;}; }; if (_destroyed == 1) then {[] call fnc_heliDead}; [] call fnc_removeAirlift; deleteMarker "lzmarker"; hintSilent parseText "<t color='#e5b348'>Airlift:</t> Lift Chopper Out Of Area."; }; //REMOVE HELICOPTER FUNCTION fnc_removeAirlift = { if (alive _heli) then {deleteVehicle _heli}; if (alive _pilot1) then {deleteVehicle _pilot1}; if (alive _gunner1) then {deleteVehicle _gunner1}; if (alive _gunner2) then {deleteVehicle _gunner2}; if (alive _gunner3) then {deleteVehicle _gunner3}; deleteGroup _grp; }; //PLAYER OUT OF VEHICLE FUNCTION // fnc_outOfVeh = { // _i = 15; // for [{_rloop=0}, {_rloop<1}, {_rloop=_rloop}] do // { // if (vehicle player == player) then { // if (_i > 0) then { // hintSilent parseText format["<t color='#e5b348'>Airlift:</t> You have %1 seconds to return to your vehicle before the airlift is canceled!", _i]; // _heli setVelocity [0,0,0]; // _i = _i - 1 // } else { // hintSilent parseText "<t color='#e5b348'>Airlift:</t> The airlift request has been canceled!"; // _canceled = 1; // _rloop=1; // }; // } else { // _heli setVelocity [100,0,0]; // _canceled = 0; // _rloop=1; // }; // sleep 1.0; // }; // }; // HELICOPTER DESTROYED / PILOT DEAD FUNCTION fnc_heliDead = { hint parseText "<t color='#ff0000'>Lift Chopper Has Been Destroyed!</t>"; deleteMarker "lzmarker"; [] call fnc_removeAirlift; if(_destroyed == 1) exitwith {}; }; //PLAYER DEAD FUNCTION fnc_playerDead = { hint parseText "<t color='#ff0000'>Player Died!</t>"; deleteMarker "lzmarker"; [] call fnc_removeAirlift; if (_dead == 1) exitwith {}; }; //CANCEL AIRLIFT FUNCTION fnc_cancelAirlift = { hint parseText "<t color='#ff0000'>Airlift Canceled By Player!</t>"; deleteMarker "lzmarker"; _veh allowDamage true; _veh setFuel 1; _veh engineOn true; _veh lock false; _veh setPos [_playerPos select 0, _playerPos select 1, 0]; [] call fnc_removeAirlift; if (_canceled == 1) exitwith {}; }; //************************************************************** START ******************************************************* if (vehicle player != player) then { if ((vehicle player isKindOf "Tank") || (vehicle player isKindOf "Car") || (vehicle player isKindOf "Ship")) then { //open map, get position from single click and run fnc_airLift airlift = true; hint "Click on the map where you'd like to to be dropped off. BE SURE THE LZ IS CLEAR FOR AT LEAST 1.0k IN ALL DIRECTIONS AND THAT ANY AAA THREAT IN THE VICINTITY HAS BEEN ELIMIATED!!"; openMap true; onMapSingleClick "onMapSingleClick """";[player, _pos] spawn fnc_airlift;airlift = false;openMap false;"; } else { hint "You Must Be In A Ground Vehicle To Use This!"; }; } else { hint "You Must Be In A Vehicle To Use This!"; }; -
AI Piloted Helicopter And MoveTo Command
louderthanu posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have an airlift script that spawns a Ch-47 that flies to the players vehicle, picks the vehicle and player up, carries it to the point the player had previously marked on the map, drops the player and vehicle on the mark and flies back to its spawn point despawning after getting out of sight of the player. Amazingly, it works! Um, most of the time that is. The problem is often the helicopter stops 100 meters from the dropoff ip and goes no further. I'd started using waypoints, swiched to doMove and have the problem with both. Here's the idea: 1. Player starts the script from an add action while in a vehicle, map opens and a dropoff point is selected by a left click on the map. 2. Helicopter and crew spawn, fly to an IP point (500 meters from the pickup... eg. (vehPos is the player and is set and updated in the script) ipPos = [ (vehPos select 0)+500, (vehPos select 1)+500, 75]) 3. Just short of the IP (125m) the loop exits and the code issues a doMove with the coordinates of the vehicle/player (pickup location) 4. Helicopter gets within 50m of the vehicle/player, the 2nd loop exits and an attachto is called to "pick" up the vehicle 5. Helicopter flys to 2nd IP (eg. (dropPos is the corridnates of the mapclick) ip2Pos = [(dropPos select 0)+500, (dropPos select 1)+500, 50]) 6. Just short of the 2nd IP that loop exits and the code issues a doMove with the corridnates of the drop point 7. Helicopter gets within 50m of the drop point, that loop exits and script "deattaches" the vehicle placing it at the "drop zone" cooridnates. 8. Helicopter is issued a doMove to its spawn point, flies away from the dropoff and despawns when 1500m from the player 99% of the time, 1-5 work as exactally as expected, but hangs at Step #6 . When it doesn't hang, steps 6-8 function as expected. I've hinted the position values and they exist and they're correct but the (_heli distance _ip2 <= xxx) never seems to trigger to exit that loop- and the helicopter will stop 100m (consistantly) from whatever value I'm checking. For instance, If I've set it to exit the loop at 500m, it will stop at 600 and never trigger the loop exit. If I set it to 100m, it will stop at 200m. If I set it to 0m it will stop at 100m and so forth.... Never more or less that 100m... weird huh? The pilot is being issued the doMove command, the pilot is set to combat status green and is made captive (and that really does prevent him from flying off on his own!). Again, I've tried waypoints and doMovecommands, the behaviour is the same with both methods. I've noticed that the problem is most acute in MP. In other words the script completes 80% of the time in single player but only 20% in MP. I've also noticed that in both SP and MP, if the script runs succesfully once- the second attempt will stall at #6. Any suggestions? Thanks in advance! TAW_louderthanu -
Tonic makes good stuff! I steal his ideas all the time.... <louderthanu>
-
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
I just wanted to stop by an tell you how much I appreciate the work you've done. I've spent tens of hours (maybe hundreds?) on the island and nearly every time I see or come across something that makes me stop and say "oh, nice touch!". In my epic sandbox "mission" I have script that spawns random ai driven vehicles that drive random waypoints. I often get in one of these and let the AI drive me around the island and just sight-see. I probably need a life, but this leisure time activity has taken me to all corners of your map and it just never fails to impress. Thank YOU! louderthanu -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Thank you. I was asking about the default. I figured that was the case, but it doesn't hurt to ask! Has anyone outhere done anything with gangs factions? The possiblilites abound. -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Are the GAL & POL factions BLUE side? -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Will units be updated to Six-Updater in the near future? Thank you! -
Support Radio
louderthanu replied to neokika's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks NEO, again.... I got it doing what I wanted to do. The "stock bis" behaviour is still there but I worked around it. My solution was to have a dialog accessable from my "Command Post" that will respawn a partially damaged asset "manually" and find/delete the roaming, extra pilots. I noticed the pilots never roamed far from thier vehicle so finding them was a piece of cake as long as I knew where the chopper / spawn point was. The problem with spawning incomplete crew turns out to be more a function of BIS and the missions' unit count than your script. Most missions this isn't an issue, but on this particular mission overall count can cause great havoc with spawining functions late in the mission.... Thank you so much for the excellent framework! louderthanyou -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
I never said that he did. -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Removed by post's author. -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Rgr that! That was my solution. Unfortunatly, some of my buds didn't think to archive the old version before updating. I'm just giddy with excitement! (and I really need a life...) <Louderthanyou -
Jungle Wars: Island of Lingor
louderthanu replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Removed by post's author