thesnypr 38 Posted April 26, 2021 hi all, i would like to create a kind of template script to work in MP, i m starting with litle knowledge even in english.... the idea is to use an already working script (it spawn a determinate number of ex. amobox randomly inside some buildings in a define area) first i ve got this script to spawn some amobox , it spawn atrigger around each amobox with a marker this part seems to be ok with some tweaks i think... // _null = [] execVM "scripts\SPAWN_Boxtriggers.sqf"; // wip script but working! if (isServer) then { countboxtrigger = 0;// set boxtriger counting to zero _chancedispersion = 0.002; // afect the dispesion on map! _boxpawned = 0; // set count to 0 _maxboxspawned = 6; // max num to spawn _houseList2 = getmarkerpos "centerzone" nearObjects ["House",1500]; while {_boxpawned <= _maxboxspawned} do { { if( (random 1) < _chancedispersion) then { _c = 0; while { format ["%1", _x buildingPos _c] != "[0,0,0]" } do {_c = _c + 1}; if (_c > 0) then { _ranNum = floor(random _c); _cratelist = ["HLC_AK_ammobox","HLC_AK_ammobox"]; _crateselected = selectRandom _cratelist; _crate = _crateselected createVehicle [0,0,0]; _crate setPos (_x buildingPos _ranNum); _crate setdir random 360; //[_crate] execVM "scripts\fillcrate.sqf"; //[_crate] execVM "scripts\create_crate_triggers.sqf"; _newMarker0 = createMarker [format ["marker0b%1", _forEachIndex], getPos _crate]; _newMarker0 setMarkerShape "ICON"; _newMarker0 setMarkerType "mil_triangle"; _newMarker0 setMarkerColor "Colorgreen"; _newMarker0 setMarkerSize [0.3,0.3]; _trg = createTrigger ["EmptyDetector", getPos _crate]; _trg setTriggerArea [3, 3, 0, false]; _trg setTriggerActivation ["WEST", "PRESENT", false];//not repeat =false! _trg setTriggerStatements["(Player in thislist or Vehicle Player in thislist)","_trx[thisTrigger]execVM'scripts\boxtrigger_activated.sqf';",""]; _trg setTriggerTimeout [0, 0, 0, false]; _boxpawned = _boxpawned + 1; }; sleep 1; }; } forEach _houseList2; }; }; and the other part when the spawned traigger is activated Quote //_null = [this] execVM "scripts\boxtrigger_activated.sqf"; if !(isServer) exitWith {}; _amobox1 = _this select 0; _chanconbox1 = 0; _chanconbox2 = 0; // Find the nearest marker to trigger using trigger onActivation code _nearestMarker = [allMapMarkers, _amobox1] call BIS_fnc_nearestPosition; deletemarker _nearestMarker; //waitUntil { not alive _amobox1 }; countboxtrigger = countboxtrigger +1 ; //for task otpion WIP! _text = format ["<t size='0.4'>" + "you found" + "</t>" + "<br />" + "<t size='0.5'>" + "a red amobox!" ]; [_text,0.01,0.01,15,-1,0,90]spawn bis_fnc_dynamicText; //set music _typeMusic = [ "LeadTrack04_F","LeadTrack06_F","LeadTrack03_F_EPB"] call BIS_fnc_selectRandom; playMusic _typeMusic; hint format ["amos found %1 /5", countboxtrigger];// debug help _m2 = createMarker [format ["mrk%1",random 100000],getpos _amobox1]; _m2 setMarkerShape "ellipse"; _m2 setMarkerSize [5,5]; _m2 setMarkerAlpha 0.6; _m2 setMarkerColorLocal "Colorgreen"; _m3 = createMarker [format ["mrk%1",random 100000],getpos _amobox1]; _m3 setMarkerShape "ICON"; _m3 setMarkerType "mil_triangle"; _m3 setMarkerColor "Colorblack";; _m3 setMarkerText format ["%1", countboxtrigger]; if ((random 1) < _chanconbox1) then { /// wip for ex spawn enemis around }; if ((random 1) < _chanconbox2) then { /// wip more stuf to happen ;) }; if (daytime >= 20 || daytime < 7) then { /// wip spawn something only if it s night }; // if not enought boxes found if (countboxtrigger <= 4) exitWith {sleep 5; sleep 5; _text = format ["<t size='0.7'>" + "try to found" + "</t>" + "<br />" + "<t size='0.6'>" + "an other one!" ]; [_text,0.01,0.01,15,-1,0,90]spawn bis_fnc_dynamicText; }; // if enought boxes found SUCESS ! if (countboxtrigger > 4) exitWith {sleep 3;_null = [] execVM "MISSION_OUTRO.sqf";}; i need some help to * finish them to hend properly for all players the mission by creating a clean MISSION_OUTRO.sqf * show corectly for each players how much boxes are already found (when trigger activated) * and is it possible to create a mp task for exemple to show first amobox zone to reah it as a task and after it create task on box 2 up to the max zone to reah or is it too hard? the goal is just to have 2 or 3 smalls scripts to add objective (force groups players to cross around the map) to play with Vandeason & ravage, for now im making this template on Grozny winter lov this ambiance too much.. will be happy to share some idea or to get some help.. Share this post Link to post Share on other sites