usedragon 10 Posted August 10, 2014 Trying to make a simple FIA/NATO mission but kind of annoying but meh. When trying to place a FIA Site module (Base, Obversation, Firebase, etc) on the map, they will attack any NATO forces despite being a Faction of NATO When trying to place individual unit as a FIA person will not attack any NATO people on the map. So, my question would be is there any way to adjust the module so they won't attack NATO? If not, I could just manually place every FIA on the map for my liking. But wanted to use module for little bit faster doing. Share this post Link to post Share on other sites
L3TUC3 32 Posted August 10, 2014 You can only select FIA for the independent sites, but they seem to ignore friend settings. Make a feedback tracker issue for this. Share this post Link to post Share on other sites
LOzan 10 Posted August 10, 2014 Have you tried going into the intel menu (Ctrl-W) in the editor and using the "Independents are friendly to:" option at the bottom? Share this post Link to post Share on other sites
usedragon 10 Posted August 10, 2014 (edited) @L3TUC3 In the editor for me, FIA is considered NATO fraction @LOzan I have them set friendly too NATO. Also included a tracker http://feedback.arma3.com/view.php?id=20218 FIA Site Module is considered NATO enemy, but friendly too OPFOR However, FIA individual soliders is considered friendly each other but enemy too OPFOR. Edited August 10, 2014 by usedragon added fraction next to NATO Share this post Link to post Share on other sites
L3TUC3 32 Posted August 11, 2014 @L3TUC3 In the editor for me, FIA is considered NATO faction Yes, in the editor unit placement (F1) options there's only BLUFOR FIA. But there's only an Independent FIA sites module. Setting Independent relations in intel does nothing. In the configs there's actually three FIA factions, one for each side. But only the blufor are able to be placed in the editor. Share this post Link to post Share on other sites
fight9 14 Posted August 11, 2014 That's got to be a bug. The Independent faction is designed to corporate - or challenge - each faction. The Site module is probably using the East side units by default with no option to change it. Share this post Link to post Share on other sites
silentghoust 132 Posted August 11, 2014 Chances are it was met for a warfare mode at some point in development. Acting as the original garrison force that is hostile to all sides during the start of the match. Sadley if you want a garrisoned FIA base you will have to do it the old fashion way. There is also a few scripts around the forums that automatically grabs units to put into buildings and towers, so you might want to find those as well. Share this post Link to post Share on other sites
Larrow 2814 Posted August 11, 2014 (edited) As others have said, the sites are limited to what actual factions you can choose for them. Luckily the BIS functions for controlling sites are just global functions and are not handled by CFGFunctions or compileFinalled so you can rewrite them. First off in your Description.ext place this. class CfgFunctions { class LARs { class sites { class pickSiteUnit { preInit = 1; file = "pickSiteUnit.sqf"; }; class pickGroup { preInit = 1; file = "pickGroup.sqf"; }; }; }; }; Before anything else happens in the mission this runs pickSiteUnit.sqf and pickGroup.sqf Place in the root of your mission folder... pickSiteUnit.sqf BIS_pickSiteUnit = compileFinal" _faction = _this select 0; _unitPref = _this select 1; switch (_faction) do { case 'BLU_F': {_faction = 'Blue'}; case 'OPF_F': {_faction = 'Red'}; case 'IND_F': {_faction = 'Green_army'}; case 'Guerilla': {_faction = 'Green_para'}; case 'BLU_G_F': {_faction = 'FIA'}; }; _ret = ''; switch (_faction) do { case 'Blue': { switch (_unitPref) do { case 'rifleman': {_ret = 'B_Soldier_F'}; case 'autorifleman': {_ret = 'B_soldier_AR_F'}; case 'AA_battery': {_ret = 'B_Panther_AA_F'}; } }; case 'Red': { switch (_unitPref) do { case 'rifleman': {_ret = 'O_Soldier_F'}; case 'autorifleman': {_ret = 'O_Soldier_AR_F'}; case 'AA_battery': {_ret = 'O_tracked_AA_placeholder_F'}; } }; case 'Green_army': { switch (_unitPref) do { case 'rifleman': {_ret = 'I_Soldier_F'}; case 'autorifleman': {_ret = 'I_Soldier_AR_F'}; case 'AA_battery': {_ret = 'IA_tracked_AA_placeholder_F'}; } }; case 'Green_para': { switch (_unitPref) do { case 'rifleman': {_ret = 'I_G_Soldier_F'}; case 'autorifleman': {_ret = 'I_G_Soldier_AR_F'}; case 'AA_battery': {_ret = 'I_G_offroad_armed'}; } }; case 'FIA': { switch (_unitPref) do { case 'rifleman': {_ret = 'B_G_Soldier_F'}; case 'autorifleman': {_ret = 'B_G_Soldier_AR_F'}; case 'AA_battery': {_ret = 'B_G_Offroad_01_armed_F'}; } }; }; _ret "; This compileFinal's the global variable BIS_pickSiteUnit which is the variable that usually holds the site function for choosing what units to spawn. As it has been compiledFinal on preInit (before anything else happens) when the BIS site module starts it can not over write it with its own version of the function. Here i have added a new case statement for FIA... case 'BLU_G_F': {_faction = 'FIA'}; and added a new switch for the right soldier classes.. case 'FIA': { switch (_unitPref) do { case 'rifleman': {_ret = 'B_G_Soldier_F'}; case 'autorifleman': {_ret = 'B_G_Soldier_AR_F'}; case 'AA_battery': {_ret = 'B_G_Offroad_01_armed_F'}; } }; Also replace the function for spawning patrols.. pickGroup.sqf BIS_pickSiteGroup = compileFinal" _faction = _this select 0; _grpPref = _this select 1; _ret = grpNull; switch (_faction) do { case 'Blue': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'West' >> 'BLU_F' >> 'Infantry' >> 'BUS_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'West' >> 'BLU_F' >> 'Infantry' >> 'BUS_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'West' >> 'BLU_F' >> 'Infantry' >> 'BUS_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'West' >> 'BLU_F' >> 'Motorized' >> 'BUS_MotInf_Team'}; } }; case 'Red': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'East' >> 'OPF_F' >> 'Infantry' >> 'OIA_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'East' >> 'OPF_F' >> 'Infantry' >> 'OIA_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'East' >> 'OPF_F' >> 'Infantry' >> 'OIA_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'East' >> 'OPF_F' >> 'Motorized_MTP' >> 'OIA_MotInf_Team'}; } }; case 'Green_army': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'IND_F' >> 'Infantry' >> 'HAF_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'IND_F' >> 'Infantry' >> 'HAF_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'IND_F' >> 'Infantry' >> 'HAF_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'IND_F' >> 'Motorized' >> 'HAF_MotInf_Team'}; } }; case 'Green_para': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'Indep' >> 'Guerilla' >> 'Motorized_MTP' >> 'IRG_MotInf_Team'}; } }; case 'BLU_G_F': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Motorized_MTP' >> 'IRG_MotInf_Team'}; } }; }; _ret "; Then all you need to do is place your BLUFOR site down as normal picking NATO as the faction and in the initialization place this setVariable ["faction", "BLU_G_F"]; . When the module initializes it will overwrite the faction with BLU_G_F which then modifies the units spawned via our new pickSiteUnits function. I have only put it through a little testing but it seems ok for OP and BASE sites tested in SP, MP & Dedicated. It looks like most of the site functions can be overridden in this way and is handy for making sites behave the way you want (Hopefully this is a feature and BIS devs reading this wont think ah crap and compile final their functions). e.g You could for instance overwrite the occupyBuilding function and instead inject something like Zen's occupy windows function with a little modification. EDIT: opps noticed patrols were missing aswell so added them in also Edited August 11, 2014 by Larrow added patrols in aswell 2 Share this post Link to post Share on other sites
usedragon 10 Posted August 11, 2014 (edited) Thanks Larrow! God! That's a lot of work to do for something that should have been in the editor in the first place lol. I will try that and see how it goes for my end. I will also quote your message on the tracker and hopefully BIS will somewhat acknowledge it. Edit: Once again Larrow, Thanks! @silentghoust I did try too look for FIA scripts out there, there were some scripts but I kept getting errors when loading in the game (maybe it was outdated, found one like 2011/12). idk LOL maybe it was me trying to put everything together. Edited August 11, 2014 by usedragon worked/message to silent Share this post Link to post Share on other sites
jandrews 116 Posted August 5, 2015 So i tried this and its not changing the units. Let me post my code. desc.ext class CfgFunctions { class sites { class pickSiteUnit { preInit = 1; file = "scripts\pickSiteUnit.sqf"; }; class pickGroup { preInit = 1; file = "scripts\pickGroup.sqf"; }; }; }; scripts BIS_pickSiteUnit = compileFinal" _faction = _this select 0; _unitPref = _this select 1; switch (_faction) do { case 'OPF_F': {_faction = 'red'}; }; _ret = ''; switch (_faction) do { case 'red': { switch (_unitPref) do { case 'rifleman': {_ret = 'B_G_Soldier_F'}; case 'autorifleman': {_ret = 'B_G_Soldier_AR_F'}; case 'Marksman': {_ret = 'B_G_Soldier_M_F'}; case 'Grenadier': {_ret = 'B_G_Soldier_GL_F'}; case 'AA_battery': {_ret = 'B_G_Offroad_01_armed_F'}; } }; }; _ret "; BIS_pickSiteGroup = compileFinal" _faction = _this select 0; _grpPref = _this select 1; _ret = grpNull; switch (_faction) do { case 'Red': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'west' >> 'Guerilla' >> 'Motorized_MTP' >> 'IRG_MotInf_Team'}; } }; }; _ret "; I did modify it some to do what i want. Basically RED FIA. Share this post Link to post Share on other sites
Larrow 2814 Posted August 5, 2015 Your missing a class in your CfgFunctions.. class CfgFunctions { class myTag { class sites { class pickSiteUnit { preInit = 1; file = "scripts\pickSiteUnit.sqf"; }; class pickGroup { preInit = 1; file = "scripts\pickGroup.sqf"; }; }; }; }; I notice you have added a couple of new soldier classes to the list as well.By defualt the soldier classes are hard coded in occupyBuilding so just adding them there will not make the sites pick these classes.I have added your classes to the script below on line 155. Just save the script and add it to CfgFunctions like the previous scripts. BIS_occupySiteBuilding = compileFinal" _building = _this select 0; _site = _this select 1; _faction = _site getVariable 'faction'; _coef = 1; if (count _this > 2) then {_coef = _this select 2}; if (!isNil {_building getVariable 'occupied'}) exitWith {}; _building setVariable ['occupied', TRUE]; switch (_faction) do { case 'Blue': {_faction = 'BLU_F'}; case 'Red': {_faction = 'OPF_F'}; case 'Green_army': {_faction = 'IND_F'}; case 'Green_para': {_faction = 'Guerilla'}; }; BIS_getRelPos = { _relDir = [_this, player] call BIS_fnc_relativeDirTo; _dist = [_this, player] call BIS_fnc_distance2D; _elev = ((getPosASL _this) select 2) - ((getPosASL player) select 2); _dir = (direction player) - direction _this; [_relDir, _dist, _elev, _dir]; }; _buildings = [ 'Land_Cargo_HQ_V1_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_HQ_V2_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_HQ_V3_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_Patrol_V1_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Patrol_V2_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Patrol_V3_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Tower_V1_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_Cargo_Tower_V2_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_Cargo_Tower_V3_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_i_Barracks_V1_F', [ [66.6219,14.8599,-3.8678,94.6476], [52.0705,10.0203,-3.86142,4.09206], [11.4515,6.26249,-3.85385,1.42117], [306.455,10.193,-3.84314,0.0715332], [294.846,14.2778,-3.83774,-91.0892], [7.04782,1.86908,-0.502411,-90.3917], [86.3556,7.98911,-0.510651,129.846] ], 'Land_i_Barracks_V2_F', [ [66.6219,14.8599,-3.8678,94.6476], [52.0705,10.0203,-3.86142,4.09206], [11.4515,6.26249,-3.85385,1.42117], [306.455,10.193,-3.84314,0.0715332], [294.846,14.2778,-3.83774,-91.0892], [7.04782,1.86908,-0.502411,-90.3917], [86.3556,7.98911,-0.510651,129.846] ] ]; if (!(typeOf _building in _buildings)) exitWith { }; _paramsArray = (_buildings select ((_buildings find (typeOf _building)) + 1)); _finalCnt = round (count _paramsArray * _coef); while {count _paramsArray > _finalCnt} do { _paramsArray = ([_paramsArray, floor random count _paramsArray] call BIS_fnc_removeIndex) }; if (_finalCnt > 0) then { _newGrp = createGroup ([EAST, WEST, RESISTANCE, CIVILIAN] select (getNumber (configFile >> 'CfgFactionClasses' >> _faction >> 'side'))); if (isNull _newGrp) exitWith {}; { _pos = [_building, _x select 1, (_x select 0) + direction _building] call BIS_fnc_relPos; _pos = [_pos select 0, _pos select 1, ((getPosASL _building) select 2) - (_x select 2)]; ([_faction, ['Marksman','Grenadier','rifleman', 'autorifleman'] select floor random 4] call BIS_pickSiteUnit) createUnit [_pos, _newGrp, 'BIS_currentDude = this']; doStop BIS_currentDude; commandStop BIS_currentDude; BIS_currentDude setPosASL _pos; BIS_currentDude setUnitPos 'UP'; BIS_currentDude doWatch ([BIS_currentDude, 1000, direction _building + (_x select 3)] call BIS_fnc_relPos); BIS_currentDude setDir direction _building + (_x select 3); } forEach _paramsArray; _site setVariable ['garrison', (_site getVariable 'garrison') + [_newGrp]]; ['[SITES] %1 garrisoned by %2', typeOf _building, _newGrp] call BIS_fnc_logFormat; _newGrp selectLeader BIS_currentDude; BIS_currentDude = nil; };"; This is the main script used for placing soldiers in buildings and is also the script where you can change what buildings and positions the soldiers will occupy.The only other places pickSiteUnit is called is if your are using AA or TrafficCheckPoint sites but these script would have to be overidden via an addon as they are not inline functions but loaded via their file name unlike the previous scripts.The above though should be enough to get your 'Marksman' and 'Grenadier' occupying most site buildings. Share this post Link to post Share on other sites
jandrews 116 Posted August 8, 2015 So here I go again. Breaking stuff!! Sry for the wall of code. Still learning this updated forums. Cant find spoiler tab yet. I am attempting to update this code. I added more units and am trying to change their behaviors while "dostop" and "commandStop". But am getting an error. { _pos = [_building, _x select 1, (_x select 0) + direction _building] call BIS_fnc_relPos; _pos = [_pos select 0, _pos select 1, ((getPosASL _building) select 2) - (_x select 2)]; ([_faction, ['Marksman','Grenadier','rifleman','autorifleman','Rifleman (Light)','Team Leader','Combat Life Saver'] select floor random 4] call BIS_pickSiteUnit) createUnit [_pos, _newGrp, 'BIS_currentDude = this']; doStop BIS_currentDude; commandStop BIS_currentDude; BIS_currentDude setPosASL _pos; BIS_currentDude setUnitPos 'UP'; BIS_currentDude setBehaviour 'SAFE'; BIS_currentDude setCombatMode 'YELLOW'; BIS_currentDude doWatch ([BIS_currentDude, 1000, direction _building + (_x select 3)] call BIS_fnc_relPos); BIS_currentDude setDir direction _building + (_x select 3); } forEach _paramsArray; I guess my questions are am I able to adjust the units behaviors much here with dostop and commandstop orders... and I really hate how the units here just stand around even when the other units around same buildings are being engaged. I see why now with the dostop and commandstop to keep them in place. Is there a simple way to have these units patrol around in the positions or react better to fire without having to use an AImod? I dont mind the AImod anyway but just wondering? if(typename _pos == "OBJECT") then {_pos = getpos _p> 10:08:28 Error position: <_pos == "OBJECT") then {_pos = getpos _p> 10:08:28 Error Undefined variable in expression: _pos 10:08:28 File A3\functions_f\geometry\fn_relPos.sqf, line 21 10:08:28 Error in expression <, 'BIS_currentDude = this']; doStop BIS_currentDude; commandStop BIS_cur> 10:08:28 Error position: <BIS_currentDude; commandStop BIS_cur> 10:08:28 Error Undefined variable in expression: bis_currentdude 10:08:28 Warning Message: Bad vehicle type 10:08:28 Error in expression <; _dir = _this select 2; Other scripts/code: Des.ext class CfgFunctions { class myTag { class sites { class siteModuleUpdate { preInit = 1; file = "scripts\siteModuleUpdate.sqf"; }; class pickSiteUnit { preInit = 1; file = "scripts\pickSiteUnit.sqf"; }; class pickGroup { preInit = 1; file = "scripts\pickGroup.sqf"; }; }; }; }; BIS_pickSiteUnit = compileFinal" _faction = _this select 0; _unitPref = _this select 1; switch (_faction) do { case 'red': {_faction = 'OPF_F'}; }; _ret = ''; switch (_faction) do { case 'red': { switch (_unitPref) do { case 'rifleman': {_ret = 'O_G_Soldier_F'}; case 'autorifleman': {_ret = 'O_G_Soldier_AR_F'}; case 'Marksman': {_ret = 'O_G_Soldier_M_F'}; case 'Grenadier': {_ret = 'O_G_Soldier_GL_F'}; case 'Team Leader': {_ret = 'O_G_Soldier_TL_F'}; case 'Rifleman (Light)': {_ret = 'O_G_Soldier_lite_F'}; case 'Combat Life Saver': {_ret = 'O_G_medic_F'}; case 'AA_battery': {_ret = 'O_G_Offroad_01_armed_F'}; } }; }; _ret "; BIS_pickSiteGroup = compileFinal" _faction = _this select 0; _grpPref = _this select 1; _ret = grpNull; switch (_faction) do { case 'Red': { switch (_grpPref) do { case 'sentry': {_ret = configFile >> 'CfgGroups' >> 'east' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSentry'}; case 'fireteam': {_ret = configFile >> 'CfgGroups' >> 'east' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfTeam'}; case 'squad': {_ret = configFile >> 'CfgGroups' >> 'east' >> 'Guerilla' >> 'Infantry' >> 'IRG_InfSquad'}; case 'motorized': {_ret = configFile >> 'CfgGroups' >> 'east' >> 'Guerilla' >> 'Motorized_MTP' >> 'IRG_MotInf_Team'}; } }; }; _ret "; Share this post Link to post Share on other sites
Larrow 2814 Posted August 9, 2015 Show me your whole code for "scripts\siteModuleUpdate.sqf" (the replacement for BIS_occupySiteBuilding). Your error shows that BIS_fnc_relPos is failing with the knock on effect that a BIS_currentDude is not getting spawned so all the relevant fails after that. Share this post Link to post Share on other sites
jandrews 116 Posted August 9, 2015 I only added to line 155 and then below for behavior and combatmode. BIS_occupySiteBuilding = compileFinal" _building = _this select 0; _site = _this select 1; _faction = _site getVariable 'faction'; _coef = 1; if (count _this > 2) then {_coef = _this select 2}; if (!isNil {_building getVriable 'occupied'}) exitWith {}; _building setVariable ['occupied', TRUE]; switch (_faction) do { case 'Blue': {_faction = 'BLU_F'}; case 'Red': {_faction = 'OPF_F'}; case 'Green_army': {_faction = 'IND_F'}; case 'Green_para': {_faction = 'Guerilla'}; }; BIS_getRelPos = { _relDir = [_this, player] call BIS_fnc_relativeDirTo; _dist = [_this, player] call BIS_fnc_distance2D; _elev = ((getPosASL _this) select 2) - ((getPosASL player) select 2); _dir = (direction player) - direction _this; [_relDir, _dist, _elev, _dir]; }; _buildings = [ 'Land_Cargo_HQ_V1_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_HQ_V2_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_HQ_V3_F', [ [-89.3972,5.45408,-0.724457,-89.757], [160.876,5.95225,-0.59613,-0.245575], [30.379,5.37352,-3.03543,-32.9396], [49.9438,7.04951,-3.03488,1.15405], [109.73,7.20652,-3.12396,-273.082], [190.289,6.1683,-3.12094,-181.174], [212.535,6.83544,-3.1217,-154.507] ], 'Land_Cargo_Patrol_V1_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Patrol_V2_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Patrol_V3_F', [ [84.1156,2.21253,-4.3396,88.6112], [316.962,3.65801,-4.14061,270.592], [31.6563,3.61418,-4.13602,-0.194908] ], 'Land_Cargo_Tower_V1_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_Cargo_Tower_V2_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_Cargo_Tower_V3_F', [ [99.5325,3.79597,-4.62543,-271,3285], [-65.1654,4.17803,-8.59327,2,79], [-50.097,4.35226,-12.7691,2,703], [115.749,5.55055,-12.7623,-270,6282], [-143.89,7.92183,-12.9027,-180,867], [67.2957,6.75608,-15.4993,-270,672], [-68.9994,7.14031,-15.507,-88,597], [195.095,7.46374,-17.792,-182,651], [-144.962,8.67736,-17.7939,-178,337], [111.831,6.52689,-17.7889,-271,5161], [-48.2151,6.2476,-17.7976,-1,334], [-24.622,4.62995,-17.796,1,79] ], 'Land_i_Barracks_V1_F', [ [66.6219,14.8599,-3.8678,94.6476], [52.0705,10.0203,-3.86142,4.09206], [11.4515,6.26249,-3.85385,1.42117], [306.455,10.193,-3.84314,0.0715332], [294.846,14.2778,-3.83774,-91.0892], [7.04782,1.86908,-0.502411,-90.3917], [86.3556,7.98911,-0.510651,129.846] ], 'Land_i_Barracks_V2_F', [ [66.6219,14.8599,-3.8678,94.6476], [52.0705,10.0203,-3.86142,4.09206], [11.4515,6.26249,-3.85385,1.42117], [306.455,10.193,-3.84314,0.0715332], [294.846,14.2778,-3.83774,-91.0892], [7.04782,1.86908,-0.502411,-90.3917], [86.3556,7.98911,-0.510651,129.846] ] ]; if (!(typeOf _building in _buildings)) exitWith { }; _paramsArray = (_buildings select ((_buildings find (typeOf _building)) + 1)); _finalCnt = round (count _paramsArray * _coef); while {count _paramsArray > _finalCnt} do { _paramsArray = ([_paramsArray, floor random count _paramsArray] call BIS_fnc_removeIndex) }; if (_finalCnt > 0) then { _newGrp = createGroup ([EAST, WEST, RESISTANCE, CIVILIAN] select (getNumber (configFile >> 'CfgFactionClasses' >> _faction >> 'side'))); if (isNull _newGrp) exitWith {}; { _pos = [_building, _x select 1, (_x select 0) + direction _building] call BIS_fnc_relPos; _pos = [_pos select 0, _pos select 1, ((getPosASL _building) select 2) - (_x select 2)]; ([_faction, ['Marksman','Grenadier','rifleman', 'autorifleman','Rifleman (Light)','Team Leader','Combat Life Saver'] select floor random 4] call BIS_pickSiteUnit) createUnit [_pos, _newGrp, 'BIS_currentDude = this']; doStop BIS_currentDude; commandStop BIS_currentDude; BIS_currentDude setPosASL _pos; BIS_currentDude setUnitPos 'UP'; BIS_currentDude setBehaviour 'SAFE'; BIS_currentDude setCombatMode 'YELLOW'; BIS_currentDude doWatch ([BIS_currentDude, 1000, direction _building + (_x select 3)] call BIS_fnc_relPos); BIS_currentDude setDir direction _building + (_x select 3); } forEach _paramsArray; _site setVariable ['garrison', (_site getVariable 'garrison') + [_newGrp]]; ['[SITES] %1 garrisoned by %2', typeOf _building, _newGrp] call BIS_fnc_logFormat; _newGrp selectLeader BIS_currentDude; BIS_currentDude = nil; };"; Share this post Link to post Share on other sites
Larrow 2814 Posted August 9, 2015 Couple of problems.. 1. Original code in post #11-spoiler for BIS_occupySiteBuilding did not paste paste properly, getVaraible on line 9 was spelt incorrectly. Went back a checked my test mission and is correct there so must be something to do with forum formating gone wrong. I have corrected post #11. 2. You have swapped round the faction names for checking in BIS_pickSiteUnit it should be... switch (_faction) do { case 'OPF_F': {_faction = 'red'}; }; OPF_F - red not red - OPF_F as you have it in post #12 Also when adding to the unit types passed for spawning you need to increase the random count as well to match.. BIS_occupySiteBuilding line 155 ([_faction, ['Marksman','Grenadier','rifleman', 'autorifleman','Rifleman (Light)','Team Leader','Combat Life Saver'] select floor random 7] call BIS_pickSiteUnit) createUnit [_pos, _newGrp, 'BIS_currentDude = this']; You have 7 different types to choose from. Have tested the above changes and every thing is good. Share this post Link to post Share on other sites
jandrews 116 Posted August 9, 2015 hey thanks Larrow. its working great. i make stupid errors. Share this post Link to post Share on other sites
jandrews 116 Posted August 19, 2015 Hey I have this error starting to spam me. Any ideas to why? 20:47:39 Error in expression < getVariable "description"), _i, count (BIS_missionScope getVariable "sites")] c> 20:47:39 Error position: <BIS_missionScope getVariable "sites")] c> 20:47:39 Error Undefined variable in expression: bis_missionscope 20:47:39 File A3\modules_f\sites\procedures\coreInit.sqf, line 16 20:47:39 Error in expression <ites; _sites = (_sites - _lateSites); BIS_missionScope setVariable ["sites", _> 20:47:39 Error position: <BIS_missionScope setVariable ["sites", _> 20:47:39 Error Undefined variable in expression: bis_missionscope 20:47:39 File A3\modules_f\sites\init_core.sqf, line 33 Share this post Link to post Share on other sites
Larrow 2814 Posted August 19, 2015 I have no idea why BIS_missionscope would be undefined. It is the name of the logic setup by some of the BIS framework for storing all sorts of stuff on. Share this post Link to post Share on other sites