Jump to content

RNM-SpaceGhost

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Community Reputation

2 Neutral

1 Follower

About RNM-SpaceGhost

  • Rank
    Private First Class

Recent Profile Visitors

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

  1. guys, i tried to find help in exile mod forums but people there dont seem to be as much active as you guys are here. Im posting here to find some help cuz im stuck with this problem for more than a week. here it is: So guys, ive made a custom loot generator for DMS boxes. it runs great on arma 3 editor, but after a weak trying to make it generate loot for DMS boxes i gave up and came here. The thing is, i saw on DMS's fn_fillCrate.sqf script that i can create a custom function and make it spawn the loot for me. But the comments from Defent were not very clear, where should i put my script for dms to read? should i declare it in DMS's config.cpp like its vanila functions? how should i parse the function name in the _crate_loot_values1 variable? a string? is there a pattern for me to create my custom file for my function? Any captain out there to help me with this? I REALLY NEED HELP! ive made the hard part to program how i want the loot to be generated, i know how should i return my function to DMS's accepted pattern. I just dont know where should i put my function, and how DMS is expecting me to call it. DMS's instructions: For example, _weapons could simply be a number, in which case the given number of weapons are selected from "DMS_boxWeapons", or an array as [_wepCount,_weps], where _wepCount is the number of weapons, and _weps is an array of weapons from which the guns are randomly selected. OR: [ _customLootFunctionParams, _customLootFunction ] In this case, "_customLootFunctionParams" is passed to "_customLootFunction", and the custom loot function must return the loot in the form: [ [ weapon1, weapon2, [weapon_that_appears_twice,2], ... weaponN ], [ item1, item2, [item_that_appears_5_times,5], ... itemN ], [ backpack1, backpack2, [backpack_that_appears_3_times,3], ... backpackN ] ] this DMS instructions are located in a3_dms/scripts/fn_fillCrate.sqf ive tried to insert my function like the vanilla functions of DMS in the folder "/scripts" but i got no success, the missions wont spawn 😕 DMS error log says the mission spawned successfully with no errors (but it didnt) thank you guys!
  2. RNM-SpaceGhost

    Custom Loot Spawning

    @GEORGE FLOROS GR. Ive already wrote the code with the logic that i wanted. but something on it is wrong (probably some kind of weird syntax of SQF that im missing. may you take a look on it and help? you are alot more familiar with this stuff and i would appreciate a tip 😕 thanks for the recommendation, and attention.
  3. RNM-SpaceGhost

    Custom Loot Spawning

    hmm, since it is a section for "ARMA 3 - ADDONS & MODS: COMPLETE", i think its ok to post here.... no? Edit: Since im talking about "mods and addons"
  4. So guys here is the problem, i might be taking your time for something very stupid like syntax error or something like this, since im new to scripting in Arma. But the problem is: I have a EXIlLE server, and i use a very customized DMS mission system. In most cases, its great standard config variables give me what i need to make what i want. But since im trying to do some kind of RPG in exile, i need more things that depends on players lucky. In most cases Im developing very simple systems that spawn everything with some kind of probability, like vehicles and, missions and other stuff. Now im trying to do this in the loot of DMS missions and im looking to this code for like, 2 days! ive already read all the arma wiki documentation to check, double-check, triple-check, infinite-check my logic and syntax and i cant find the error. every time that i start the sever with my script it wont spawn ANY mission. even ZCP stop spawning. im using in this case "sniper camp" mission: here is my code for dynamic loot (not using selectRandomWeighted at the moment for testing proposes): _weaponCountSG = round (random 4); if (_weaponCountSG == 0) then {_weaponCountSG = 1}; _weaponsSG = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _spawnWeaponsSG = []; _spawnMagSG = []; _spawnListSG = []; for [{_sgW = 1}, {_sgW <= _weaponCountSG}, {_sgW = _sgW + 1}] do { _selectedWeaponSG = selectRandom _weaponsSG; _spawnWeaponsSG = _spawnWeaponsSG + _selectedWeaponSG; _magCountSG = round (random 3); if (_magCountSG == 0) then {_magCountSG = 1}; { _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); for "_sgM" from 1 to _magCountSG do { spawnMagSG = _spawnMagSG + _selectedMagSG; }; }forEach _spawnWeaponsSG; //other syntax that ive tried to do the same stuff /*for [{_sgM = 1}, {_sgM <= _magCountSG}, {_sgM = _sgM + 1}] do { private _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); _spawnMagSG = _spawnMagSG + _selectedMagSG; };*/ }; so the complete code for "Sniper Camp" in my server was (in case you did not saw anything wrong up there (search for "SpaceGhost" to see all my modifications): /* Sniper Camp Mission with new difficulty selection system Hardcore has persistent vehicle based on work by Defent and eraser1 easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk */ private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty"]; // For logging purposes _num = DMS_MissionCount; // Set mission side (only "bandit" is supported for now) _side = "bandit"; // This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos. // It also allows anybody to modify the default calling parameters easily. if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then { _this = [ [10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists], [ [] ], _this ]; }; // Check calling parameters for manually defined mission position. // You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass] _OK = (_this call DMS_fnc_MissionParams) params [ ["_pos",[],[[]],[3],[],[],[]], ["_extraParams",[]] ]; if !(_OK) exitWith { diag_log format ["DMS ERROR :: Called MISSION nedsnipercamp_mission.sqf with invalid parameters: %1",_this]; }; //create possible difficulty add more of one difficulty to weight it towards that _PossibleDifficulty = [ "easy" //"easy" //"moderate" //"moderate" //"difficult" //"difficult" //"difficult" //"hardcore" ]; //choose difficulty and set value _difficulty = selectRandom _PossibleDifficulty; //SpaceGhost start _weaponCountSG = round (random 4); if (_weaponCountSG == 0) then {_weaponCountSG = 1}; _weaponsSG = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _spawnWeaponsSG = []; _spawnMagSG = []; _spawnListSG = []; //SpaceGhost end switch (_difficulty) do { case "easy": { _AICount = (4 + (round (random 4))); //SpaceGhost Start for [{_sgW = 1}, {_sgW <= _weaponCountSG}, {_sgW = _sgW + 1}] do { _selectedWeaponSG = selectRandom _weaponsSG; _spawnWeaponsSG = _spawnWeaponsSG + _selectedWeaponSG; _magCountSG = round (random 3); if (_magCountSG == 0) then {_magCountSG = 1}; { _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); for "_sgM" from 1 to _magCountSG do { spawnMagSG = _spawnMagSG + _selectedMagSG; }; }forEach _spawnWeaponsSG; /*for [{_sgM = 1}, {_sgM <= _magCountSG}, {_sgM = _sgM + 1}] do { private _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); _spawnMagSG = _spawnMagSG + _selectedMagSG; };*/ }; _spawnListSG = _spawnWeaponsSG + _spawnMagSG; //SpaceGhost End _crate_weapons = (4 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (8 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (1 + (round (random 1))); }; //COMMENTED THIS FOR TESTING PROPOSES /*case "moderate": { _AICount = (6 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a moderate training camp, go steal their rifles"]; _crate_weapons = (6 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (10 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (2 + (round (random 1))); }; case "difficult": { _AICount = (8 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a difficult training camp, go steal their rifles"]; _crate_weapons = (9 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (14 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (3 + (round (random 1))); }; //case "hardcore": default { _AICount = (8 + (round (random 8))); _msgStart = ['#FFFF00',"Snipers have set up an advanced training camp, go steal their rifles"]; _crate_weapons = (14 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (17 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (4 + (round (random 1))); };*/ }; //_msgStart = ['#FFFF00',format["Snipers have set up a %1 training camp, go steal their rifles",_difficulty]]; _msgStart = ['#FFFF00',"Snipers have set up a training camp, go steal their rifles"]; // Hardcore needs different settings for AI and message and vehicle spawning if (_difficulty isEqualTo "hardcore") then { _pinCode = (1000 +(round (random 8999))); _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0],_pinCode] call DMS_fnc_SpawnPersistentVehicle; _msgWIN = ['#0080ff',format ["Convicts have killed the snipers and stolen their rifles,the truck code is %1...",_pinCode]]; _group = [ [[(_pos select 0)+3,(_pos select 1)-3,0],[(_pos select 0)+(10+(random 20)),(_pos select 1)+(10+(random 20)),0]], // Position AI in tent + 2nd squad _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup_MultiPos; } else { _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0,0],[], 0, "CAN_COLLIDE"] call DMS_fnc_SpawnNonPersistentVehicle; _msgWIN = ['#0080ff',"Convicts have killed the snipers and stolen their rifles"]; _group = [ [(_pos select 0)+3,(_pos select 1)-3,0], // Position AI in tent _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup; }; // add vehicle patrol and randomise a little - same for all levels (as it uses variable) _veh = [ [ [(_pos select 0) -(75-(random 25)),(_pos select 1) +(75+(random 25)),0] ], _group, "assault", _difficulty, _side ] call DMS_fnc_SpawnAIVehicle; // add static guns - same for all levels _staticGuns = [ [ // make statically positioned relative to centre point and randomise a little [(_pos select 0) -(5-(random 1)),(_pos select 1)+(5-(random 1)),0], [(_pos select 0) +(5-(random 1)),(_pos select 1)-(5-(random 1)),0] ], _group, "assault", "static", "bandit" ] call DMS_fnc_SpawnAIStaticMG; // Create Buildings - use seperate file as found in the mercbase mission - same for all levels _baseObjs = [ "nedsnipercamp_objects", _pos ] call DMS_fnc_ImportFromM3E; // Create Crate type - same for all levels _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate; // setup crate iteself with items - same for all levels _crate_loot_values1 = [ _spawnListSG, // Weapons SpaceGhost [], // Items + selection list _crate_backpacks // Backpacks ]; // Define mission-spawned AI Units _missionAIUnits = [ _group // We only spawned the single group for this mission ]; // Define mission-spawned objects and loot values _missionObjs = [ _staticGuns+_baseObjs+[_veh], // armed AI vehicle, base objects, and static guns [_vehicle], //this is prize vehicle [[_crate1,_crate_loot_values1]] //this is prize crate ]; //not start message here as they are defined in random choice to make the intro message different for each // Define Mission Win message - defined in choices // Define Mission Lose message - same for all levels _msgLOSE = ['#FF0000',"The Snipers have packed up and left, no rifles for you!"]; // Define mission name (for map marker and logging) - same for all levels _missionName = "Sniper Camp"; // Create Markers - same for all levels _markers = [ _pos, _missionName, _difficulty ] call DMS_fnc_CreateMarker; // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly) _time = diag_tickTime; // Parse and add mission info to missions monitor _added = [ _pos, [ [ "kill", _group ], [ "playerNear", [_pos,DMS_playerNearRadius] ] ], [ _time, (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0)) ], _missionAIUnits, _missionObjs, [_missionName,_msgWIN,_msgLOSE], _markers, _side, _difficulty, [] ] call DMS_fnc_AddMissionToMonitor; // Check to see if it was added correctly, otherwise delete the stuff if !(_added) exitWith { diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName]; // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly) _cleanup = []; { _cleanup pushBack _x; } forEach _missionAIUnits; _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1)); { _cleanup pushBack (_x select 0); } foreach (_missionObjs select 2); _cleanup call DMS_fnc_CleanUp; // Delete the markers directly {deleteMarker _x;} forEach _markers; // Reset the mission count DMS_MissionCount = DMS_MissionCount - 1; }; // Notify players [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus; if (DMS_DEBUG) then { (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; }; In case you want to compare to the original, Here it is: /* Sniper Camp Mission with new difficulty selection system Hardcore has persistent vehicle based on work by Defent and eraser1 easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk */ private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty"]; // For logging purposes _num = DMS_MissionCount; // Set mission side (only "bandit" is supported for now) _side = "bandit"; // This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos. // It also allows anybody to modify the default calling parameters easily. if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then { _this = [ [10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists], [ [] ], _this ]; }; // Check calling parameters for manually defined mission position. // You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass] _OK = (_this call DMS_fnc_MissionParams) params [ ["_pos",[],[[]],[3],[],[],[]], ["_extraParams",[]] ]; if !(_OK) exitWith { diag_log format ["DMS ERROR :: Called MISSION nedsnipercamp_mission.sqf with invalid parameters: %1",_this]; }; //create possible difficulty add more of one difficulty to weight it towards that _PossibleDifficulty = [ "easy", "easy", "moderate", "moderate", "difficult", "difficult", "difficult", "hardcore" ]; //choose difficulty and set value _difficulty = selectRandom _PossibleDifficulty; switch (_difficulty) do { case "easy": { _AICount = (4 + (round (random 4))); _crate_weapons = (4 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (8 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (1 + (round (random 1))); }; case "moderate": { _AICount = (6 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a moderate training camp, go steal their rifles"]; _crate_weapons = (6 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (10 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (2 + (round (random 1))); }; case "difficult": { _AICount = (8 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a difficult training camp, go steal their rifles"]; _crate_weapons = (9 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (14 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (3 + (round (random 1))); }; //case "hardcore": default { _AICount = (8 + (round (random 8))); _msgStart = ['#FFFF00',"Snipers have set up an advanced training camp, go steal their rifles"]; _crate_weapons = (14 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (17 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (4 + (round (random 1))); }; }; //_msgStart = ['#FFFF00',format["Snipers have set up a %1 training camp, go steal their rifles",_difficulty]]; _msgStart = ['#FFFF00',"Snipers have set up a training camp, go steal their rifles"]; // Hardcore needs different settings for AI and message and vehicle spawning if (_difficulty isEqualTo "hardcore") then { _pinCode = (1000 +(round (random 8999))); _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0],_pinCode] call DMS_fnc_SpawnPersistentVehicle; _msgWIN = ['#0080ff',format ["Convicts have killed the snipers and stolen their rifles,the truck code is %1...",_pinCode]]; _group = [ [[(_pos select 0)+3,(_pos select 1)-3,0],[(_pos select 0)+(10+(random 20)),(_pos select 1)+(10+(random 20)),0]], // Position AI in tent + 2nd squad _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup_MultiPos; } else { _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0,0],[], 0, "CAN_COLLIDE"] call DMS_fnc_SpawnNonPersistentVehicle; _msgWIN = ['#0080ff',"Convicts have killed the snipers and stolen their rifles"]; _group = [ [(_pos select 0)+3,(_pos select 1)-3,0], // Position AI in tent _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup; }; // add vehicle patrol and randomise a little - same for all levels (as it uses variable) _veh = [ [ [(_pos select 0) -(75-(random 25)),(_pos select 1) +(75+(random 25)),0] ], _group, "assault", _difficulty, _side ] call DMS_fnc_SpawnAIVehicle; // add static guns - same for all levels _staticGuns = [ [ // make statically positioned relative to centre point and randomise a little [(_pos select 0) -(5-(random 1)),(_pos select 1)+(5-(random 1)),0], [(_pos select 0) +(5-(random 1)),(_pos select 1)-(5-(random 1)),0] ], _group, "assault", "static", "bandit" ] call DMS_fnc_SpawnAIStaticMG; // Create Buildings - use seperate file as found in the mercbase mission - same for all levels _baseObjs = [ "nedsnipercamp_objects", _pos ] call DMS_fnc_ImportFromM3E; // Create Crate type - same for all levels _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate; // setup crate iteself with items - same for all levels _crate_loot_values1 = [ [_crate_weapons,_crate_weapon_list], // Weapons [_crate_items,_crate_item_list], // Items + selection list _crate_backpacks // Backpacks ]; // Define mission-spawned AI Units _missionAIUnits = [ _group // We only spawned the single group for this mission ]; // Define mission-spawned objects and loot values _missionObjs = [ _staticGuns+_baseObjs+[_veh], // armed AI vehicle, base objects, and static guns [_vehicle], //this is prize vehicle [[_crate1,_crate_loot_values1]] //this is prize crate ]; //not start message here as they are defined in random choice to make the intro message different for each // Define Mission Win message - defined in choices // Define Mission Lose message - same for all levels _msgLOSE = ['#FF0000',"The Snipers have packed up and left, no rifles for you!"]; // Define mission name (for map marker and logging) - same for all levels _missionName = "Sniper Camp"; // Create Markers - same for all levels _markers = [ _pos, _missionName, _difficulty ] call DMS_fnc_CreateMarker; // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly) _time = diag_tickTime; // Parse and add mission info to missions monitor _added = [ _pos, [ [ "kill", _group ], [ "playerNear", [_pos,DMS_playerNearRadius] ] ], [ _time, (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0)) ], _missionAIUnits, _missionObjs, [_missionName,_msgWIN,_msgLOSE], _markers, _side, _difficulty, [] ] call DMS_fnc_AddMissionToMonitor; // Check to see if it was added correctly, otherwise delete the stuff if !(_added) exitWith { diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName]; // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly) _cleanup = []; { _cleanup pushBack _x; } forEach _missionAIUnits; _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1)); { _cleanup pushBack (_x select 0); } foreach (_missionObjs select 2); _cleanup call DMS_fnc_CleanUp; // Delete the markers directly {deleteMarker _x;} forEach _markers; // Reset the mission count DMS_MissionCount = DMS_MissionCount - 1; }; // Notify players [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus; if (DMS_DEBUG) then { (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; }; (I dont think that i need to do this, but just to be clear, This code is not mine, its a nedsnipercamp_mission for DMS. Im just modding it. Thanks to the original creators.) So can anyone find what i did wrong? Is it really a syntax error? Can someone help me? BTW, if someone can help me to know how can i insert this functions of code in server side to prevent from people just downloading the mission and using it pretending they made it. it would be great. thank you for the attention =D
  5. RNM-SpaceGhost

    Making AI ignore specific players

    so guys sorry for the delay. I was a bit buzy last days... so, with @pierremgi help i made progress, and came out with some code that worked. buy the way, its very possible that the first code that you sent me was working. but one thing that i did not know is that getPlayerUID, on single player returns _SP_PLAYER_, and not the UID of the player. So thats probably the reason, it did not work. i was creating this for a ARMA 3 EXILE Server, but since i was testing on ARMA 3 Editor, the only option you have is to play on single player. once i tested my code with "_SP_PLAYER_" in admins UID array it worked perfectly. So, here is the code that i created with Pierre's help included this at the very end of intServer.sqf: //creates a group for all static AAs in EXILE it has to be "east" so the units join OPFOR becoming enemies with players airDefences = createGroup east; //inserted on this array all variable names set on editor for each unit created on Editor and make them join the created Opfor group [centurion01,centurion02, praetorian01, praetorian02, praetorian03, spartan01, spartan02] joinSilent airDefences; and in the very end of initPlayerLocal.sqf: //array with all ADM UIDs that you want _admArray = ["123456789","987654321"]; _uid = getPlayerUID player; //verify if player is ADM if (_uid in _admArray ) then { //cool msg just to tell player that he is alowed to go to the area where AI is titleText ["<t color='#ff0000' size='2'>Air defences, Reporting in!</t>", "PLAIN", 1, true, true]; //makes player join the same group that the AI is. [player] joinSilent airDefences; }; it worked fine for me. but if you guys get any suggestions to make the code better i would appreciate =D @GEORGE FLOROS GR, i have to agree with you that im new with this, i've already created about 8 severs of ARMA 2 dayz and ARMA 3 EXILE, but in terms of coding, im starting now. Im a php dev, but im not familiar with sqf language and for sure ill read the documentation that you sent me to get better in this and stop making "dumb questions" LOL. but is nice to have people that answer this questions for me to have a start point in what, and where should i look and study. At least for me, i need a objective to start studding, like just read the documentation would not help me if im not trying to code anything. And thanks for the welcome =D but seriously, thanks for you guys time and attention, without people to help me start i would need alot of time just to make this simple codes. my next step will be create a infiSTAR custom function to add and remove players on the airDefence group =D. But maybe this isnt the right place to discuss this, as long it has to do with infiSTAR... but i really would like to understand better the code that @pierremgi made: ["doNotMess","onEachFrame", { if (player in (airDefences targets [true,300]) && getPlayerUID player in ["321654987","987654321"] ) then { airDefences forgetTarget player }; }] call bis_fnc_addStackedEventHandler; "doNotMess", i think is the function name. "onEachFrame", i dont have a clue for what it does and in the very end: "call bis_fnc_addStackedEventHandler" what this does? anyway, thank all of you guys that commented and tried to help =D you are the best!!!!!!
  6. RNM-SpaceGhost

    Making AI ignore specific players

    shit! i need to set it just for some units ¬¬
  7. RNM-SpaceGhost

    Making AI ignore specific players

    Hello, i was trying right now some stuff and i discover a new command that maybe can help: West setFriend [Independent, 0]; i think that forgetTarget is not the right command. here is its description: Resets the info a group has about a target, forcing knowsAbout value to 0. https://community.bistudio.com/wiki/forgetTarget ill try to make what you said. if i just crate the initServer.sqf in the same folder as the mission it will run automatically? there is no need to include it anywhere?
  8. RNM-SpaceGhost

    Making AI ignore specific players

    ok, here it is... with your help i made some progress, but still not working as it should. i made this: in the general settings of the editor, in the init option(i imagine that this is the init.sqf) i inserted this: airDefences = createGroup east; [centurion01,centurion02, praetorian01, praetorian02, praetorian03, spartan01, spartan02] join airDefences; this creates a group of opfor (since i cant spawn those guns with opfor crew). this part i know its working because the AI exploded the hell out me. and in the init of my soldier (i assume this is the initPlayerLocal.sqf), this: (on the game i inserted the right UIDs) ["doNotMess","onEachFrame", { { if (player in (airDefences targets [true,300]) && getPlayerUID player in ["321654987","321654987"] ) then { airDefences forgetTarget player }; nil } count units thisEnyGroup }] call bis_fnc_addStackedEventHandler and this should make me, part of their group, as long as my UID is there, but the AI still shoot the hell out of me the same way. i also tried this: ["doNotMess","onEachFrame", { { if (player in (airDefences targets [true,300]) && getPlayerUID player in ["321654987","987654321"] ) then { player join airDefences; }; nil } count units thisEnyGroup }] call bis_fnc_addStackedEventHandler and also tried to replace "player" for "_this" and to insert this on the init.sqf any idea what is wrong?
  9. RNM-SpaceGhost

    Making AI ignore specific players

    ok, if im not asking too much, can you please explain a bit of this code? like 1 - what does "onEachFrame" make? run this function on each frame of the animations?? 2 - (_x targets [true,300]). what is this doing? what "true" and "300" stands for? meters? 3 - uids should be like this player in [123456789, 987654321, 654987321] or like player in ['321654987', '123456789', '654987321']? 4 - count units thisEnyGroup is counting AI group or player group? 5 - call bis_fnc_addStackedEventHandler, i assume that is only a thing to get this on the execution queue or something like this, right? 6 - if this should not be on the Unit initialization, what on this code makes it apply only to the right units, and not for ALL AI of the map? 7 - where should i put this? on the AI initialization or on the mission.sqm or in the init.sqf? thanks for your help
  10. RNM-SpaceGhost

    Making AI ignore specific players

    So, do you have a exemple of this loop to check uid? btw i think that i was really tired when i read the description of forgetTarget. Because it only make the AI "forget" all information of its target... which wont help me in any case here i think, LOL. but i was trying to initialize this AI that spawn with the mission, with some kind of command like _this donotMessWith [player uid]. but i dont know if even exists some command like this :/ or make run the loop you said and set this units friendly to this AIs. it seems that exile players spawn as independent (dont know if this can help) i dont know if im been clear or if my english is too bad, but thanks for trying to help me xD
  11. RNM-SpaceGhost

    Making AI ignore specific players

    In setCaptive i would have the same problems that i have with forgetTarget. Since it is a mpMission for me to set a player to captive i need a way to force this specific player (in this case the adms) to a specific playable unit that only the adms will be allowed to use. And i don't know how to do this. btw, setCaptive will make all AI of the map ignore this players, i want to make just a specific group of AI, that has a fixed spawn at the mission (does not spawn dynamically). Just a reminder that im editing the mission.sqm of EXILE Mod. So bots of the missions like DMS and A3XAI should engage normally. is there any way to make bots ignore players with specific UID? or something like that?
  12. So, here is the problem, im editing a mission on Arma 3 (EXILE) editor and faced this problem. i spawned on the editor some aircraft carriers, and destroyers with its guns well placed around the map to shoot players that go to far in te map down. So i spawned some centurions, praetorians and stuff like that with its crews. I want this to shoot anybody that comes close to the ship, but i want them to ignore the admins and, if its possible, anyone that is on their group. is there any way for me to make the bots ignore some players by the UID, and even better, ignore all players on the group of this specific UID? I searched a lot before get here, because i don't wanna bother. but the closest that i got is using the comand "forgetTarget" on the unit init. But with this i need to force the admins to use a specific playable slot when loggin in and don't allow anyone with other UID to join on these slots. which i don't know how to do as well. if you guys can help me solving this problem in any of the 2 ways, i will thank you for ever. =D
×