Kaniva58 10 Posted December 26, 2014 Hi all, I have a problem with creating a VAS supply drop module in my multiplayer game i have used the crate init as described in other posts: _this addAction["<t color=#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf]; but with no effect the helicopter flys over and drops a crate but its not the VAS. I've tried this addaction and it works in editor and when localhost it just not in multiplayer. Also read in another post that this was a older know bugg and wondering if anyone has found the answer to this problem. Greetz, Share this post Link to post Share on other sites
kahna 13 Posted December 26, 2014 I don't know much about modules, call me old school, but I prefer scripts to get things done. _this is simply referring to the object when placed in the init. If you want to spawn a supply drop in during the mission, the best way to do it would be to script it in along the lines of: _pos = getMarkerPos "DropPoint"; _supplyDrop = "B_supplyCrate_F" createVehicle (position _pos); _supplyDrop addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; _supplyDrop allowdamage false; clearItemCargoGlobal _supplyDrop; clearMagazineCargoGlobal _supplyDrop; clearWeaponCargoGlobal _supplyDrop; clearBackpackCargo _supplyDrop; You can get creative and add elevation to _pos and attach a parachute to _supplyDrop as well. You can even get a Heli to do a fly by to coincide with it. Share this post Link to post Share on other sites
cruoriss 12 Posted December 26, 2014 You can't do much about it , official supply drop module is broken since release (http://feedback.arma3.com/view.php?id=19360 that was the issue before but patch changed the problem multiple times ) Of course you can script an alternative supply drop but can't have a "proper" official one . Share this post Link to post Share on other sites
soolie 189 Posted December 27, 2014 Hey, been working on this and it's not ready for release but I added the VAS addaction. See My Thread and for more details. Like I said, it's not ready for release but with a little work you could probably get it working for what you need. openMap [true,true]; clicked = 0; hintc "Left click on the map where you want the supplies dropped"; ["supplymapclick", "onMapSingleClick", { _supplyLocArray = [+1000,-1375,-1500,-1125,+1250,-1000,+1375,-1250,+1500,+1125]; //~~~~~~~~~~Use the one below for testing. It spawns the heli much closer~~~~~~~~~~~~~~~~~~ //_supplyLocArray = [+500,-500]; _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; _supply = [[(_pos select 0)+_supplyRandomLocX, (_pos select 1)+_supplyRandomLocY, (_pos select 2)+50], 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _supplyHeli = _supply select 0; _supplyHeliPos = getPos _supplyHeli; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _supplyCrew = _supply select 1; _supplyGrp = _supply select 2; _supplyGrp setSpeedMode "FULL"; _supplyGrp setBehaviour "CARELESS"; _supplyWP1 =_supplyGrp addWaypoint [(_pos),1]; _supplyWP1 setWaypointType "MOVE"; _supplyWP2 = _supplyGrp addWaypoint [[(_pos select 0)+_supplyRandomLocX, (_pos select 1)+_supplyRandomLocY, _pos select 2], 2]; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _pos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; clicked = 1; openmap [false,false]; onMapSingleClick '';}] call BIS_fnc_addStackedEventHandler; waitUntil {(clicked == 1)}; //hint "After clicked"; _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; _supplyHeli = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; waitUntil {( _supplyLZ distance _supplyHeli)<200}; _supplyHeli animateDoor ["CargoRamp_Open",1]; waitUntil {( _supplyLZ distance _supplyHeli)<100}; sleep 1.2; _supplyHeli allowDammage false; _supplyBox = "Box_NATO_Ammo_F" createVehicle position _supplyHeli; //~~~~~~~~~~~~~~~~~~~Edit Box Contents~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ clearWeaponCargo _supplyBox; clearMagazineCargo _supplyBox; clearItemCargo _supplyBox; //_supplyBox addweaponcargo ["srifle_EBR_F",10]; //_supplyBox addweaponcargo ["hgun_P07_F",10]; //_supplyBox addmagazinecargo ["20Rnd_762x51_Mag", 100]; //_supplyBox addmagazinecargo ["16Rnd_9x21_Mag", 30]; //_supplyBox addmagazinecargo ["30Rnd_9x21_Mag", 10]; //_supplyBox additemcargo ["optic_Aco", 10]; //_supplyBox additemcargo ["optic_Hamr", 10]; //_supplyBox additemcargo ["optic_Holosight", 10]; //_supplyBox additemcargo ["acc_flashlight", 10]; //_supplyBox additemcargo ["acc_pointer_IR", 10]; //_supplyBox additemcargo ["U_B_CombatUniform_mcam", 10]; //_supplyBox additemcargo ["U_B_CombatUniform_mcam_tshirt", 10]; //_supplyBox additemcargo ["U_B_CombatUniform_mcam_vest", 10]; //_supplyBox additemcargo ["H_HelmetB", 10]; //_supplyBox additemcargo ["H_HelmetB_light", 10]; //_supplyBox additemcargo ["H_HelmetB_paint", 10]; //_supplyBox additemcargo ["V_PlateCarrier1_rgr", 10]; //_supplyBox additemcargo ["V_PlateCarrier2_rgr", 10]; //_supplyBox additemcargo ["V_PlateCarrierGL_rgr", 10]; //_supplyBox addbackpackcargo ["B_AssaultPack_ocamo", 10]; //~~~~~~~~~~~~~~~~Add VAS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _supplyBox addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; deleteVehicle _supplyLZ; _supplyBox attachTo [_supplyHeli, [0, 0, -2] ]; detach _supplyBox; _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; _supplyLight = "Chemlight_green" createVehicle (position _supplyBox); _supplyLight attachTo [_supplyBox, [0,0,0]]; sleep 1; _supplyChute hideObject false; _supplyHeli allowDammage true; _supplyHeli animateDoor ["CargoRamp_Open",0]; waitUntil {(getPos _supplyBox select 2)<3}; detach _supplyBox; sleep 10; {deleteVehicle _x;}forEach crew _supplyHeli;deleteVehicle _supplyHeli; //hint "end"; Share this post Link to post Share on other sites
Kaniva58 10 Posted December 28, 2014 Awesome script Soolie thx just one little error the chute seems do vanish right after drop making the crate fall and damage it any simple way to fix that ? Share this post Link to post Share on other sites
soolie 189 Posted December 28, 2014 (edited) Awesome script Soolie thx just one little error the chute seems do vanish right after drop making the crate fall and damage it any simple way to fix that ? What do you mean right after? Does the chute ever attach to the box? It could be as simple as moving the addaction for VAS. //_supplyBox additemcargo ["V_PlateCarrier1_rgr", 10]; //_supplyBox additemcargo ["V_PlateCarrier2_rgr", 10]; //_supplyBox additemcargo ["V_PlateCarrierGL_rgr", 10]; //_supplyBox addbackpackcargo ["B_AssaultPack_ocamo", 10]; [size=5]//=========REMOVE VAS FROM HERE[/size] _supplyBox addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; [size=5]//=========[/size] deleteVehicle _supplyLZ; _supplyBox attachTo [_supplyHeli, [0, 0, -2] ]; detach _supplyBox; _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; _supplyLight = "Chemlight_green" createVehicle (position _supplyBox); _supplyLight attachTo [_supplyBox, [0,0,0]]; sleep 1; _supplyChute hideObject false; _supplyHeli allowDammage true; _supplyHeli animateDoor ["CargoRamp_Open",0]; waitUntil {(getPos _supplyBox select 2)<3}; detach _supplyBox; [size=5]//===========Put VAS here[/size] _supplyBox addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; [size=5]//===================[/size] sleep 10; {deleteVehicle _x;}forEach crew _supplyHeli;deleteVehicle _supplyHeli; //hint "end"; I'm at work right now, can help more when I'm home (4hrs from now) Edited December 28, 2014 by Soolie Share this post Link to post Share on other sites
Beerkan 71 Posted December 28, 2014 Tested, and working in MP Put this in your init.sqf FNC_AddVASAction = { _this addAction["<t color='#ff11ff'>Virtual Ammobox</t>", "VAS\open.sqf"]; }; Then after you spawn your Ammobox add this line. [_supplyBox,"Fnc_AddVASAction",nil,true] spawn BIS_fnc_MP; Share this post Link to post Share on other sites
Kaniva58 10 Posted December 28, 2014 (edited) yes Soolie the chute does attach to the box but disappears after a second or 2 then the ammo box freefals down sometimes its ok but on a few tries it burned up. also tried with the VAS on new line in script. Edited December 28, 2014 by Kaniva58 Share this post Link to post Share on other sites
soolie 189 Posted December 28, 2014 comment out these lines (they're toward the end) waitUntil {(getPos _supplyBox select 2)<3}; detach _supplyBox; Share this post Link to post Share on other sites
Kaniva58 10 Posted December 28, 2014 (edited) still detaching 3-4 seconds after the dropoff : / at least in editor tho dont suppose it will be different in mp Edited December 30, 2014 by Kaniva58 Share this post Link to post Share on other sites
soolie 189 Posted December 29, 2014 (edited) still detaching 3-4 seconds after the dropoff : / at least in editor tho dont suppose it will be different in mp I believe the problem is the flyinheight working on it now. ---------- Post added at 21:16 ---------- Previous post was at 19:39 ---------- OK, seems to be working nicely now I added an action to Beerkan's fnc to turn off the light(you have to change the chemlight classname there if you change it on the box) init.sqf FNC_AddVASAction = { _this addAction["<t color='#ff11ff'>Virtual Ammobox</t>", "VAS\open.sqf"]; lightVAS = _this addAction ["Light Off",{_supplyLight = nearestObject [player, "Chemlight_green"]; deleteVehicle _supplyLight; _this select 0 removeAction lightVAS;}]; }; supply.sqf openMap [true,true]; clicked = 0; hintc "Left click on the map where you want the supplies dropped"; ["supplymapclick", "onMapSingleClick", { _supplyLocArray = [+1000,-1375,-1500,-1125,+1250,-1000,+1375,-1250,+1500,+1125]; //===============Use the one below for testing. It spawns the heli much closer.===================================== // _supplyLocArray = [+500,-500]; _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; _supply = [[(_pos select 0)+_supplyRandomLocX, (_pos select 1)+_supplyRandomLocY, (_pos select 2)+50], 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _supplyHeli = _supply select 0; _supplyHeliPos = getPos _supplyHeli; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _supplyCrew = _supply select 1; _supplyGrp = _supply select 2; _supplyGrp setSpeedMode "FULL"; _supplyGrp setBehaviour "CARELESS"; _supplyWP1 =_supplyGrp addWaypoint [(_pos),1]; _supplyWP1 setWaypointType "MOVE"; _supplyWP2 = _supplyGrp addWaypoint [[(_pos select 0)+_supplyRandomLocX, (_pos select 1)+_supplyRandomLocY, _pos select 2], 2]; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _pos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; _supplyHeli flyInHeight 150; clicked = 1; openmap [false,false]; onMapSingleClick '';}] call BIS_fnc_addStackedEventHandler; waitUntil {(clicked == 1)}; hint "The supplies are on the way"; _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; _supplyHeli = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; waitUntil {( _supplyLZ distance _supplyHeli)<400}; _supplyHeli animateDoor ["CargoRamp_Open",1]; waitUntil {( _supplyLZ distance _supplyHeli)<200}; sleep 2; _supplyHeli allowDammage false; _supplyBox = createVehicle ["B_supplyCrate_F", position _supplyHeli, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; [_supplyBox,"Fnc_AddVASAction",nil,true] spawn BIS_fnc_MP; deleteVehicle _supplyLZ; _supplyBox attachTo [_supplyHeli, [0, 0, -2] ]; detach _supplyBox; _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; _supplyLight = "Chemlight_green" createVehicle (position _supplyBox); _supplyLight attachTo [_supplyBox, [0,0,0]]; sleep 1; hint "The supplies have been dropped"; _supplyChute hideObject false; _supplyHeli allowDammage true; _supplyHeli animateDoor ["CargoRamp_Open",0]; waitUntil {(getPos _supplyBox select 2)<1}; detach _supplyBox; _supplyChute setPos [ getPos _supplyChute select 0, getPos _supplyChute select 1, 0]; hint ""; sleep 5; {deleteVehicle _x;}forEach crew _supplyHeli;deleteVehicle _supplyHeli; //hint "end"; Edited December 29, 2014 by Soolie Share this post Link to post Share on other sites
Kaniva58 10 Posted December 31, 2014 (edited) it drops beautifully, tho the crate is empty and no VAS either tried in mp also on server. this is the error i get: [bIS_fnc_MPexec] Function or scripting command "Fnc_AddVASAction" does not exist Edited December 31, 2014 by Kaniva58 Share this post Link to post Share on other sites
soolie 189 Posted December 31, 2014 I'm really not sure, it's working fine for me. How are you calling it? It does the same in the editor? and post your init.sqf Share this post Link to post Share on other sites
Kaniva58 10 Posted December 31, 2014 This only as its testmission init.sqf while {True} do { player setfatigue (getfatigue player - 0.2 - random 0.2); sleep 5; }; FNC_AddVASAction = { _this addAction["<t color='#ff11ff'>Virtual Ammobox</t>", "VAS\open.sqf"]; lightVAS = _this addAction ["Light Off",{_supplyLight = nearestObject [player, "Chemlight_green"]; deleteVehicle _supplyLight; _this select 0 removeAction lightVAS;}]; }; it was like that. now after u mentioned the init tried a clean init with only your init line and it worked just gotta test it on server now. after the clean one i added the line below and it works now its like this FNC_AddVASAction = { _this addAction["<t color='#ff11ff'>Virtual Ammobox</t>", "VAS\open.sqf"]; lightVAS = _this addAction ["Light Off",{_supplyLight = nearestObject [player, "Chemlight_green"]; deleteVehicle _supplyLight; _this select 0 removeAction lightVAS;}]; }; while {True} do { player setfatigue (getfatigue player - 0.2 - random 0.2); sleep 5; }; tried in server in MP and its working NICE :D Share this post Link to post Share on other sites
jshock 513 Posted December 31, 2014 Put a spawn on your while loop for better coding :): //simple example [] spawn { while {true} do { //do stuff }; }; Share this post Link to post Share on other sites
soolie 189 Posted January 12, 2015 I finished it! Release Thread Share this post Link to post Share on other sites