fixes to typos, started removal of bandit / hero switching. New models
now can carry backbacks, removed dupe issue but regained ammo dupe
issue. DVS vehicle spawn limits introduced.
This commit is contained in:
A Clark
2012-12-27 11:33:58 -06:00
parent de7f3a17d0
commit 5208bc9719
12 changed files with 64 additions and 34 deletions

View File

@@ -29,7 +29,7 @@ if (!isNull _object) then {
{ [_x,"gear"] call server_updateObject } foreach
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]);
if (alive _object) then {
[_object,[],true] call server_playerSync;
[_object,(magazines _object),true] call server_playerSync;
_myGroup = group _object;
deleteVehicle _object;
deleteGroup _myGroup;

View File

@@ -16,7 +16,7 @@ if ( typeName(_this) == "OBJECT" ) then {
_character = _this select 0;
_magazines = _this select 1;
_force = _this select 2;
//_force = _this select 2;
_force = true;

View File

@@ -171,21 +171,37 @@ RoadList = MarkerPosition nearRoads DynamicVehicleArea;
BuildingList = MarkerPosition nearObjects ["House",DynamicVehicleArea];
spawn_vehicles = {
private["_vehicle","_isAir","_isShip","_position","_roadlist","_buildinglist","_istoomany","_marker","_veh","_objPosition","_weights","_index","_uid"];
private["_vehicle","_isAir","_isShip","_position","_roadlist","_buildinglist","_istoomany","_marker","_veh","_objPosition","_weights","_index","_uid","_velimit","_counter"];
if (isDedicated) then {
_counter = _this select 0;
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [AllowedVehiclesList,AllowedVehiclesChance] call fnc_buildWeightedArray;
waitUntil{!isNil "BIS_fnc_selectRandom"};
// get index from fnc_buildWeightedArray
_index = _weights call BIS_fnc_selectRandom;
// select vehicle
_vehicle = AllowedVehiclesList select _index;
_isOverLimit = true;
while {_isOverLimit} do {
waitUntil{!isNil "BIS_fnc_selectRandom"};
_index = _weights call BIS_fnc_selectRandom;
_vehicle = AllowedVehiclesList select _index;
_velimit = AllowedVehiclesLimit select _index;
_qty = {_x == _vehicle} count _counter;
// If under limit allow to proceed
if(_qty < _velimit) then {
_isOverLimit = false;
};
// TODO add counter to stop after X attempts
};
// Find Vehicle Type to better control spawns
_isAir = _vehicle isKindOf "Air";

View File

@@ -3,6 +3,8 @@
dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
_serverVehicleCounter = [];
if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};
@@ -165,6 +167,10 @@ diag_log "HIVE: Starting";
};
_object call fnc_vehicleEventHandler;
_totalvehicles = _totalvehicles + 1;
// total each vehicle
_serverVehicleCounter set [count _serverVehicleCounter,_type];
};
//Monitor the object
@@ -220,11 +226,12 @@ _vehLimit = MaxVehicleLimit - _totalvehicles;
diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit));
if(_vehLimit > 0) then {
for "_x" from 1 to _vehLimit do {
_id = [] spawn spawn_vehicles; // Needs setup
_id = [_serverVehicleCounter] spawn spawn_vehicles; // Needs setup
waitUntil{scriptDone _id};
};
};
// spawn_roadblocks
for "_x" from 1 to MaxDynamicDebris do {
_id = [] spawn spawn_roadblocks;