Jump to content

JasonTheRed

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Posts posted by JasonTheRed


  1. I can't seem to get this to work. No errors but no spawning either and the credits for the script aren't loaded either.

     

    in initServer.sqf I have this line: 

    [] execVM "GF_Auto_Population_Zombie\Credits.sqf";	// Please keep the Credits or add them to your Diary
    [] execVM "GF_Auto_Population_Zombie\GF_Auto_Population_Zombie_init.sqf";

    When I launch the mission I enter as Zeus and do not see any spawning. I'm using MaxZombies and have the mod loaded as I can drop them in via editor or zeus. I have the latest scripts installed as well. Am I missing something? 

    • Like 1

  2. This is rubbish BI. Although I can understand your perspective that you can't possibly test all scenarios it's clear to me that this is a serious problem which affects many of your customers. This isn't an isolated incident AND today is the 12-Mar and you have yet to send out a rollback which means many of us players can't play. The solution IS NOT to force server owners to manually rollback their versions. You should release a hotfix which removes the changes causing this issue. I installed the latest update last night (automatic updates) and now I cannot access a single server. Awesome customer experience for an online multiplayer game. 

     

    We as customers; server owners and players want YOU as the provider of the software we all paid for to be responsible for fixing this issue. Period.

    • Like 3

  3. 9 hours ago, davidoss said:

    I have no problem with.

    I posted it for GF as example of another point of view and performance.

    I could make my own release but the code has no development state of any kind  because i have no time to support it

    Cool thanks! I posted the mission here: https://steamcommunity.com/sharedfiles/filedetails/?id=1632673343. It's super simple and the map isn't great for perf but it plays pretty well.

    • Like 1

  4. On 12/9/2018 at 2:23 AM, davidoss said:

    we do not sleep because we are armaholics..

    Dynamic version

      Reveal hidden contents
    
    
    /*
    dynanic loot for whole world by DaVidoSS
    usage:
    if (isServer) then {
    		 
    	0 = [5,0.51,0.61] execVM "dynamicLoot.sqf";
    	// 5 = time in min to pass after players leave area (loot deletion)
    	// 0.51 = % of chance to spawn loot in building, range from 0 to 1
    	// 0.61 = % of chance to spawn mags along with spawned weapon, range from 0 to 1
    	
    };
    */
    params [["_loot_despawn_timeout",5,[0]],["_lootchance",0.51,[0]],["_hanceMagsSpawnWithGun",0.51,[0]]];
    private _centerPosition = ATLtoASL [worldSize/2,worldSize/2,0];
    
    _buildings = [];
    
    
    	{
    		_obj = _x;
    		if !( (_obj buildingPos -1) isEqualTo []) then { 
    			//gather enterable buildings
    			_obj setVariable ["lootSpawned",false,false];
    			_buildings pushBack _obj;
    		};
    	} 
    	forEach nearestTerrainObjects 
    	[
    		_centerPosition, 
    		["HOUSE","BUILDING"], 
    		worldSize/2, 
    		false
    	];
    
    fnc_arrRandSeq = {
    
    	params [ ["_array",[],[[]]], ["_indexcnt",1,[0]]];
    	private ["_return_array","_randindex"];
    	if (_array isEqualTo []) exitWith {_array};
    
    	_return_array = [];
    
    	if (_indexcnt isEqualTo 0) then {_indexcnt = 1};
    	if (_indexcnt > (count _array)) then {_indexcnt = count _array};
    	if (_indexcnt isEqualTo (count _array)) exitWith {
    	_return_array = _array call BIS_fnc_arrayShuffle;
    	_return_array
    	};
    
    	for "_i" from 1 to _indexcnt do {
    
    	_randindex = selectRandom _array;
    	_return_array pushBack _randindex;
    	_array = _array - [_randindex];
    	};
    
    	(_return_array)
    };
    
    fnc_getLoot = {
    
    	params [["_types","",[""]]];
    
    	private _array = [];
    	private _config = "";
    	private _type = [];
    	private _class = "";
    	private _cfgPath = "";
    	private _exit = false;
    	private _mags = [];
    	private _inherit  = "";
    
    	switch (true) do {
    		case (_types == "weapon"): {_config = "CfgWeapons";_type = ["rifle","launcher","pistol","mgun","binocular"]};
    		case (_types == "ammo"): {_config = "CfgMagazines";_type = ["ca_magazine"]};
    		case (_types == "item"): {_config = "CfgWeapons";_type = ["itemcore"]};
    		case (_types == "bag"): {_config = "CfgVehicles";_type = ["bag_base"]};
    		default {_exit = true};
    	};
    	if (_exit) exitWith {_array};
    
    	{
    		_cfgPath = _x;
    		_class = (configName _x);
    		{
    			if ((_class isKindOf [_x, configFile >> _config]) && {(getNumber (_cfgPath >> "scope")) isEqualTo 2}) then {
    				if (_types == "ammo") then {
    					if !(_class isKindOf ["VehicleMagazine", configfile >> _config]) exitWith {_array pushBack _class};
    				} else {
    					if (_types == "weapon") exitWith {_mags = (getArray (_cfgPath >> "magazines")); _array pushBack [_class,_mags]};
    					if (_types == "bag") exitWith {
    						_inherit = configName (inheritsFrom (_cfgPath));
    						if (getNumber (configFile >> _config >> _inherit >> "scope") == 2) then {_array pushBack _inherit} else {_array pushBack _class};
    					};
    					_array pushBack _class;
    				};	
    			};
    		} forEach _type;
    	} forEach ("isClass _x" configClasses (configfile >> _config));
    
    	(_array)
    };	
    
    fnc_checkForPlayers = {
    	params [["_pos", [], [[],objNull]], ["_area", 0, [0]]];
    	private _stdOut = false;
    	private _players = [] call BIS_fnc_listPlayers;
    	{if ((_pos distance2D _x) < _area) exitWith {_stdOut = true}} forEach _players;
    	(_stdOut)
    };
    
    fnc_spawnLoot = {
    
    	params [["_building",objNull,[objNull]],["_chance",1,[0]],["_chanceAmmo",1,[0]]];
    
    	private _weaponHolders = [];
    	private _weaponHolder = objNull;
    	private _buldingPosition = [];
    	private _type = "";
    	private _buldingPositions = _building buildingPos -1;
    	if (count _buldingPositions > 3) then {
    		_buldingPosition = [_buldingPositions, (floor random [1,2,4])] call fnc_arrRandSeq;
    	} else {
    		_buldingPosition pushBack (selectRandom _buldingPositions);
    	};
    	{
    		_type = selectRandom ["item","weapon","ammo","item","item","bag","item","item","ammo"];
    		if (random 1 < _chance) then {
    		
    			switch _type do {
    				case "weapon": {
    					
    					private _randomGun = selectRandom (allweapons call BIS_fnc_arrayShuffle);
    					_randomGun params ["_gun","_ammo"];
    					_weaponHolder = createVehicle ["WeaponHolderSimulated", _x, [], 0, "CAN_COLLIDE"];
    					_weaponHolder setPosATL _x;
    					if (random 1 < _chanceAmmo) then {
    						_weaponHolder addMagazineCargoGlobal [selectRandom _ammo, floor (random [1,2,4])];
    					};
    					_weaponHolder addWeaponCargoGlobal [_gun, 1];
    				};
    				case "item": {
    				
    					private _itemarray = [(allitems call BIS_fnc_arrayShuffle), floor (random [1,2,4])] call fnc_arrRandSeq;
    					_weaponHolder = createVehicle ["WeaponHolderSimulated", _x, [], 0, "CAN_COLLIDE"];
    					_weaponHolder setPosATL _x;
    					{_weaponHolder addItemCargoGlobal [_x, 1]} forEach _itemarray;
    				
    				};
    				case "bag": {
    			
    					private _bag = selectRandom (allbackpack call BIS_fnc_arrayShuffle);
    					_weaponHolder = createVehicle ["WeaponHolderSimulated", _x, [], 0, "CAN_COLLIDE"];
    					_weaponHolder setPosATL _x;
    					_weaponHolder addBackpackCargoGlobal [_bag, 1];
    				};
    				case "ammo": {
    			
    					private _ammoarray = [(allmagazines call BIS_fnc_arrayShuffle), floor (random [1,2,4])] call fnc_arrRandSeq;
    					_weaponHolder = createVehicle ["WeaponHolderSimulated", _x, [], 0, "CAN_COLLIDE"];
    					_weaponHolder setPosATL _x;
    					{_weaponHolder addMagazineCargoGlobal [_x, 1]} forEach _ammoarray;
    				};
    				default {};
    			};
    		};
    		_weaponHolders pushBack _weaponHolder;
    	} forEach _buldingPosition;
    (_weaponHolders)
    };
    
    allweapons = ["weapon"] call fnc_getLoot;
    allmagazines = ["ammo"] call fnc_getLoot;
    allitems = ["item"] call fnc_getLoot;
    allbackpack = ["bag"] call fnc_getLoot;
    loot_despawn_timeout = _loot_despawn_timeout*60;
    
    private _aktivebuildings = [];
    private ["_building","_lootSpawned","_weaponHolder"];
    while {true} do {
    
        _aktivebuildings = _buildings select {[_x, 100] call fnc_checkForPlayers};
    	if !(_aktivebuildings isEqualTo []) then {
    		{
    		
    			_building = _x;
    			_lootSpawned = _building getVariable "lootSpawned";
    			if (!_lootSpawned) then {
    				_weaponHolder = [_building,_lootchance,_hanceMagsSpawnWithGun] call fnc_spawnLoot;
    				_building setVariable ["lootSpawned",true,false];
    				
    				0 = [_building,_weaponHolder] spawn {
    					params [["_house",objNull,[objNull]],["_loot",[],[[]]]];
    					waitUntil {sleep 5; !([_house, 100] call fnc_checkForPlayers)};
    					private _time = (time + loot_despawn_timeout);
    					waitUntil {sleep 5; !([_house, 100] call fnc_checkForPlayers) && {time >= _time}};
    					{if (isNull _x) then {deleteVehicle _x}} forEach _loot;
    					_house setVariable ["lootSpawned",false,false];
    				};
    			};
    		} forEach _aktivebuildings;
    	};
    	
    	sleep 5;
    };

     

     

    @davidoss do you mind if I use your loot spawner in a mission I'm publishing? The fact it spawns loot around players (and deletes it) is great! Just making sure before I enable it. I've given you credit BTW. 

    • Like 1

  5. I'm testing this and it seems a couple things are not working quite right. 

     

    1. Loot seems to spawn automatically regardless whether the player is nearby or not (script and mod version)

    2. Loot DOES NOT spawn in military areas. I'm guessing because none of the military buildings are classified as "house"?

    3. Loot continues to spawn in the same area which leads to loot spawning atop existing loot which leads to FPS lag. 

     

    Any thoughts @GEORGE FLOROS GR?

    • Like 1

  6. @Vandeanson I've done some more performance testing. I've found inserting sleep doesn't really help. However, as I'm using CUP+RHS+NIArms weapons the script has a lot of data to crunch; those arrays are huge! My current theory, and as I've tested so far is that when the script tries to assign mags the actual cfgWeapons lookup hasn't finished and therefore the array is empty. This sets off a cascade of mag failures. This doesn't seem to be an issue for the SW spawner as often and I suspect this is because there simply fewer iterations to go through before assigning cargo.

     

    What I've done is insert waitUntil calls for each of the cfgWeapons lookups. Tested a bunch of times and so far I'm not seeing the errors. I added this all magazine lookups for the equipper function. 

     

    For example: 

    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
    waituntil {(count _magazines) > 0};
    _mag = selectRandom _magazines;

    As you can see there's a loop happening which doesn't proceed until the _magazines loop is not empty. Hope this helps! 

     

    Also, as a performance request, it'd be nice if you disabled simulation on all the spawned AI (except the No Rest group for obvious reasons) until a player was within a certain range. This would help keep frames up for MP even with a large number of camps spawned.

    • Like 1
    • Thanks 1

  7. @Vandeanson don't forget about adding a SW spawner for when you don't want to use markers. I copied/edited your SW spawner to do this. However, it may be better to create a generic script for TC, BC and SW which handles setting the POSes based on a true/false check instead. Then you wouldn't need to duplicate the files.

     

    Spoiler
    
    //VANDEANSONS DYNAMIC SHIPWRECK SPAWNER
    //AUGUST 3, 2018
    //VERSION 2.0
    //DEPENDENCIES: RAVAGE & CBA IF YOU WANT TO USE THE RAVAGE LOOT FUNCTION
    
    
    
    _VD_SW_wreckpos = [getPosATL player, VD_SW_WreckSpawnMinDist, VD_SW_WreckSpawnMaxDist, 5, 0, 100, 1, [], []] call BIS_fnc_findSafePos;
    _VD_SW_wreck = VD_SWwrecks call BIS_fnc_selectRandom createVehicle _VD_SW_wreckpos;
    _VD_SW_wreck allowDamage false;
    _VD_SW_wreck setDir (random 359);
    
    //4.2 LOOTBOX THAT YOU WANT TO LOOT FOR FANCY STUFF! NOTES BELOW:
    sleep 0.2;
    
    _itembox1 = "Box_IND_Ammo_F" createVehicle ([getPosATL _VD_SW_wreck, 15, 30, 5, 0, 0.9, 1, [], []] call BIS_fnc_findSafePos);
    _itembox1 allowDamage false;
    clearMagazineCargoGlobal _itembox1;
    clearWeaponCargoGlobal _itembox1;
    clearItemCargoGlobal _itembox1;
    clearBackpackCargoGlobal _itembox1;
    _weapon = selectrandom VD_WeaponArrayRifles;
    _weapon1 = selectrandom VD_WeaponArrayRifles;
    _itembox1 additemCargoGlobal [selectRandom VD_currencyArray, 50 +random 50];
    _itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
    _itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
    _itembox1 addMagazineCargoGlobal [selectRandom VD_explosivesArray, 1 +random 2];
    _itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
    _itembox1 additemCargoGlobal [selectRandom VD_medicalArray, 1 +random 1];
    _itembox1 addItemCargoGlobal [_weapon call BIS_fnc_compatibleItems, 1];
    _itembox1 addItemCargoGlobal [_weapon call BIS_fnc_compatibleItems, 1];
    _itembox1 addWeaponCargo [_weapon,1 +random 1];
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
    _mag = selectRandom _magazines;
    _itembox1 addMagazineCargoGlobal [_mag, 2 +random 4];
    _itembox1 addWeaponCargo [_weapon1,1 +random 1];
    _magazines1 = getArray (configFile >> "CfgWeapons" >> _weapon1 >> "magazines");
    _mag1 = selectRandom _magazines1;
    _itembox1 addMagazineCargoGlobal [_mag1, 2 +random 4];
    
    
    /////4.3 Ambient or lootable props (if ravage mod is active) selection and spawn point relative to _mark
    sleep 0.3;
        _pos1 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object1 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle ([getPosATL _VD_SW_wreck, 10, 25, 2, 0, 100, 0] call BIS_fnc_findSafePos);
        _object1 allowDamage false;
        _object1 setDir (random 359);
    
    
        _pos2 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object2 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos2;
        _object2 allowDamage false;
        _object2 setDir (random 359);
    
        _pos3 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object3 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos3;
        _object3 allowDamage false;
        _object3 setDir (random 359);
    
        _pos4 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object4 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos4;
        _object4 allowDamage false;
        _object4 setDir (random 359);
    
        _pos5 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object5 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos5;
        _object5 allowDamage false;
        _object5 setDir (random 359);
    
        _pos6 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _object6 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos6;
        _object6 allowDamage false;
        _object6 setDir (random 359);
    
        _pos7 = [getPosATL _VD_SW_wreck, 5, 20, 2, 0, 100, 0] call BIS_fnc_findSafePos;
        _object7 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos7;
        _object7 allowDamage false;
        _object7 setDir (random 359);
    
    {_x setVectorUp surfaceNormal position _x} foreach [_itembox1,_VD_SW_wreck,_object1,_object2,_object3,_object4,_object5,_object6,_object7];
    
    Sleep (random VD_BC_CampUptimeRnd);Sleep VD_BC_CampUptimeFix;
    WaitUntil {player distance (GetPos _VD_SW_wreck) > VD_BC_DeletionSaveZone};
    {deleteVehicle _x} foreach [_itembox1,_VD_SW_wreck,_object1,_object2,_object3,_object4,_object5,_object6,_object7];
    VD_SW_MrkrArray = VD_SW_MrkrArray + [_VD_SW_wreckpos];
    
    execVM "VD_SWSpawner.sqf";

     

     

    • Like 2

  8. I have it working now. Needed to create a SW spawner for when you do not want to use pre-designated markers. The _mag errors are now the only issue; Multiple RHS not in cfg weapons seems to be the cause. I do not know what the equivalent of a try/catch is in C but maybe you could suppress the error logs and send them to the server diag log instead? 

     

    One other thing I do notice is the BC spawns group up a bit. Noticing multiple camps all spawning within a couple dozen metres of each other; kind of neat as it looks like a commune. I suspect this is not intentional. Maybe each loop through the spawner should append/remove the location of each camp to an array in order to blacklist spawning near one of those existing camps? BIS_fnc_findSafePlace does have a param for blacklisting. I poked around to see if I could find simple way of appending/removing items into a Blacklist array but as of yet no joy.

     

    Anyway, this set of scripts are really nice! 


  9. Hey Vandeanson - liking the direction of the scripts. I am not actually able to get this working however. Whenever I try to use the scripts I get tons of cycling errors as it tries to spawn BC. The errors fly by so quickly I can't tell you a list of line numbers but it seems to constantly refer to the fireplace; suggests there isn't one spawned. I've enabled automatic spawning based on location to player over using markers. Could this be the problem? Is that functionality working? I have the grabbed that latest version of the files (90% sure).

     

    However, there's a strange dependency on the EDN_Functions. The VD_Equipper is part of that file. Could you break out the equipper from the EDN code please? 

     

    I also noticed the launchers arrays aren't used. Or if they are I can't find their use...

     

     


  10. Anyone here know how I can find the scriptable states for the M1085 CPBS? I'd like to spawn this vehicle with the CBPS deployed via a script. In the editor I can do it but I'm working on some dynamic mission tasks but cannot find the functions/animations etc in the cfg or functions viewer. AND rhsmods.org docs seem very incomplete. 

     

    Any help would be great! 


  11. Curious why you aren't dynamically generating the arrays for items. For example explained here:

     

    // Automate fetching weapon classes
    _cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");
    
    {
    	_weaponString = configName (_x);
    	_parents = [_x,true] call BIS_fnc_returnParents;
    
    	if ("Rifle" in _parents) then {
    		_WeaponArray append [_weaponString];
    	};
    
    	if ("Pistol" in _parents) then {
    		_weaponArray append [_weaponString];
    	};
    
    	if ("Launcher" in _parents) then {
    		_WeaponArray append [_weaponString];
    	};
    } forEach _cfgWeapons;
    // Automation process

    The above was tested and it works a treat! The weapon crates spawned at the bandit camp includes weapons. Using something like this would mean you could add whatever weapon mods you wanted to a mission without the need manually update the array. I suspect this could be used for other classes too; clothes, magazines (Ravage items etc). 

     

     

    • Like 1
×