TMHackSaW 63 Report post Posted October 12, 2015 Hello Guys!!!Does anyone of you can tell me if it is possible to put a loot crate in an area and these to be refill every restart. I wan to do a custom mission and it will be the reward. Thanks in advance. Share this post Link to post Share on other sites
Zlobot 0 Report post Posted October 13, 2015 I use some of the files in a3_custom.pbo in server side. For example: to call boxes in fn_init.sqf register call compile preprocessFileLineNumbers "\ x \ addons \ a3_custom \ spawncrates.sqf";if (isServer) then {_numberofcrates = 1; _spawnCenter = [13510,3297,0]; //_spawnCenter = getmarkerpos "center"; // Use this if you want the global center of the map, it's declared in mission.sqm, island specific_min = 1; // minimum distance from the center position (Number) in meters//_max = 12000; // maximum distance from the center position (Number) in meters _max = 4; // Example : maximum range of spawned crates, to keep them INSIDE the sector B compound_mindist = 1; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters.._water = 0; // water mode (Number) 0: cannot be in water , 1: can either be in water or not , 2: must be in water_shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore_marker = True; // Draw a green circle in which the crate will be spawned randomly_markersize = 50; // Radius of the marker in metersdiag_log format['Starting spawncrates.sqf'];for "_i" from 1 to _numberofcrates do { _pos = [_spawnCenter,_min,_max,_mindist,_water,800,_shoremode] call BIS_fnc_findSafePos; // find a random location within range if (_marker) then { _event_marker = createMarker [ format ["loot_marker_%1", _i], _pos]; _event_marker setMarkerShape "ELLIPSE"; _event_marker setMarkerColor "ColorBlue"; _event_marker setMarkerAlpha 0.45; _event_marker setMarkerSize [(_markersize+15), (_markersize+15)]; //green circle slightly bigger , box can spawn just outside if not increased _pos = [_pos,0,_markersize,0,_water,800,_shoremode] call BIS_fnc_findSafePos; //find a random spot INSIDE the marker area _pos = [_pos select 0, _pos select 1, 0]; }; diag_log format['Spawncrate %1 : Location %2',_i,_pos]; _box = "O_CargoNet_01_ammo_F" createvehicle _pos; //create the crate .. These ARE liftable with chopper like the CH-67 , but will not stay after restarts ! clearMagazineCargoGlobal _box; clearWeaponCargoGlobal _box; clearItemCargoGlobal _box; _box setVariable ["permaLoot",true]; //stay until reset _box allowDamage false; // Prevent boxes to explode when spawning _box addItemCargoGlobal ["Exile_Item_DuctTape", 4 + (random 2)]; // between 4-6 _box addItemCargoGlobal ["Exile_Item_JunkMetal", 10 + (random 10)]; // between 10-20 _box addItemCargoGlobal ["Exile_Item_MetalPole", 8 + (random 7)]; // between 8-15 //...bla,bla,bla... _box addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag", (random 5)]; }}; Share this post Link to post Share on other sites
Zlobot 0 Report post Posted October 13, 2015 Naturally, the need to exclude filters BE. Share this post Link to post Share on other sites
TMHackSaW 63 Report post Posted October 13, 2015 Thank for this . So I can find the file in a3_custom.pbo? Or do I have to create one file spawncrates.sqf and call it from init.just to be clear. Share this post Link to post Share on other sites
DIamond 81 Report post Posted January 7, 2016 On 10/13/2015 at 4:26 AM, TMHackSaW said: Thank for this . So I can find the file in a3_custom.pbo? Or do I have to create one file spawncrates.sqf and call it from init. just to be clear. Did u ever figure out how to call it ? Share this post Link to post Share on other sites
piyrez 4 Report post Posted January 9, 2016 On 1/7/2016 at 2:01 PM, DIamond said: Did u ever figure out how to call it ? You could probably use this as a starting point: http://exile.majormittens.co.uk/topic/5604-putting-your-custom-map-contents-in-its-own-serverside-mod/#comment-21597 Share this post Link to post Share on other sites