gianluca matrix 1 Posted March 10, 2018 Hi, have a problem I've been trying to solve for several days but I do not know what to do anymore. I state that I have already created other modules and all working both locally and sever but this drives me crazy. In local it works perfectly but on the server NO. The script called by the module has also been tested on the server and it works great. (spawn civilians to x distance modules in map) Then I connected the script to the module (see config) and tested on the server and it works but when I added the first arguments with its variable _logic it does not work anymore on the server. No error, as if the config did not start the fn_ModuleCiv.sqf script. Sorry for my english. Illuminate me, ThanksConfig class CfgPatches { class Gren_ModuleCiv { units[]={"Gren_ModuleCiv"}; weapons[]={}; requiredVersion=0; requiredAddons[]={"A3_Modules_F"}; version="2.0"; author="Grenadier"; }; }; class CfgFactionClasses { class NO_CATEGORY; class GRENADIER: NO_CATEGORY { displayName="GRENADIER"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class ArgumentsBaseUnits { class Units; }; class ModuleDescription; }; class Gren_ModuleCiv: Module_F // riga per singolo modulo { scope=2; author="Grenadier"; displayName="Modulo spawn civili"; dlc="Gren_Module_Civ"; icon="\Gren_ModuleCiv\icons\civilian.paa"; category="GRENADIER"; function="Gren_fnc_ModuleCiv"; isGlobal=0; isDisposable = 0; isTriggerActivated = 0; functionPriority = 1; class Arguments: ArgumentsBaseUnits { class Attiva_avv_civ { displayName="Distanza attivazione"; description="Decidi a quale distanza, in metri, il giocatore attiva il modulo"; typeName="Number"; defaultValue=500; }; }; class ModuleDescription: ModuleDescription { description="$STR_Last_Service_description"; }; }; }; class CfgFunctions { class Gren { class GRENADIER { file="\Gren_ModuleCiv\RSTAIx_G"; class ModuleCiv{}; }; }; };Script //==== added this part the script on the server does not workprivate ["_logic", "_units", "_activated"]; private ["_Radius_activation"]; _logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; _units = [_this,1,[],[[]]] call BIS_fnc_param; _activated = [_this,2,true,[true]] call BIS_fnc_param; missionNamespace setVariable ["Gren_ModuleCiv", _logic]; if (_activated) then {_Radius_activation = _logic getVariable ["Attiva_avv_civ",500]; }; //================== private ["_fulcro","_Radius_activation"]; _fulcro=_this select 0; _Origine = 0; _limit = 1; _ActiveFH = false; _Use_Mezzo = true; _Radius_Patrol = [50,75,100]; _limit_vehicle = [_limit+5,0] call BIS_fnc_cutDecimals; waituntil {((player distance _fulcro)<=_Radius_activation)}; _pos = getpos _fulcro; While {_Origine<_limit} do { _Raggio = floor random _Radius_Patrol; _DecMezzo = floor random _limit_vehicle; _DecEdifici = floor random 3; _Stanza = floor random 5; _NonMuovere = floor random 8; _myGroup = createGroup civilian; { _soldierName = _x select 0; _soldierRank = _x select 1; _soldato = ["C_man_1","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_6_F"] call BIS_fnc_selectRandom; _tempSoldier = _myGroup createUnit [ _soldato, _pos, [], 0, "FORM" ]; _tempSoldier setRank _soldierRank; _tempSoldier setVehicleVarName _soldierName; missionNamespace setVariable [ _soldierName, _tempSoldier ]; publicVariable _soldierName; }forEach [ [ "civ1", "SERGEANT" ], [ "civ2", "PRIVATE" ] ]; if (_DecMezzo ==0 && _Use_Mezzo) then { _veicolo = ["C_Offroad_01_F","C_Truck_02_transport_F","C_Van_01_transport_F"] call BIS_fnc_selectRandom; _Raggio =_Raggio *5; _truck = _veicolo createVehicle getPos civ1; civ1 moveInDriver _truck; civ2 moveInCargo _truck; }; if ((_ActiveFH) AND (_DecEdifici==0) AND !(_DecMezzo ==0)) then { doStop [civ1, civ2]; civ1 setpos (nearestBuilding civ1 buildingPos _Stanza); civ2 setpos (nearestBuilding civ2 buildingPos _Stanza+2); } else{ if (_NonMuovere ==1) then {} else { if (isClass(configFile >> "CfgPatches" >> "cba_main")) then{ [_mygroup, _mygroup, _Raggio, 5, "MOVE", "CARELESS", "WHITE", "LIMITED", "STAG COLUMN", "civ1 spawn CBA_fnc_searchNearby", [3,6,9]] call CBA_fnc_taskPatrol; } else { [_mygroup, getPos _fulcro, _Raggio] call bis_fnc_taskPatrol; }; }; }; _Origine=_Origine+1; }; deletevehicle _fulcro; Share this post Link to post Share on other sites
Larrow 2823 Posted March 11, 2018 On 3/10/2018 at 7:43 PM, gianluca matrix said: In local it works perfectly but on the server NO. You mean specifically a dedicated server? If so everything looks fine except... On 3/10/2018 at 7:43 PM, gianluca matrix said: waituntil {((player distance _fulcro)<=_Radius_activation)}; There is no player on a dedicated server. Maybe... waitUntil { { _x distance _fulcro <= _Radius_activation }count allPlayers > 0 }; ...once any player comes within activation distance. 1 Share this post Link to post Share on other sites
gianluca matrix 1 Posted March 12, 2018 In the afternoon I'll try immediately and I'll let you know. Thank you so much for now! Share this post Link to post Share on other sites
gianluca matrix 1 Posted March 13, 2018 Tested and it works !!!! Thanks again. 1 Share this post Link to post Share on other sites